System.Data.Common.CommandTrees.DbExpression.GetEntityRef()

Here are the examples of the csharp api class System.Data.Common.CommandTrees.DbExpression.GetEntityRef() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

5 Examples 7

1. Example

Project: referencesource
Source File: SemanticAnalyzer.cs
private static ExpressionResolution ConvertRefExpr(AST.Node astExpr, SemanticResolver sr)
        {
            AST.RefExpr refExpr = (AST.RefExpr)astExpr;

            DbExpression converted = ConvertValueExpression(refExpr.ArgExpr, sr);

            //
            // check if is entity type
            //
            if (!TypeSemantics.IsEntityType(converted.ResultType))
            {
                throw EntityUtil.EntitySqlError(refExpr.ArgExpr.ErrCtx, Strings.RefArgIsNotOfEntityType(converted.ResultType.EdmType.FullName));
            }

            //
            // create ref expression
            //
            converted = converted.GetEntityRef();
            Debug.Assert(null != converted, "null != converted");

            return new ValueExpression(converted);
        }

2. Example

Project: referencesource
Source File: SemanticAnalyzer.cs
private static ExpressionResolution ConvertKeyExpr(AST.Node astExpr, SemanticResolver sr)
        {
            AST.KeyExpr keyExpr = (AST.KeyExpr)astExpr;

            DbExpression converted = ConvertValueExpression(keyExpr.ArgExpr, sr);

            if (TypeSemantics.IsEntityType(converted.ResultType))
            {
                converted = converted.GetEntityRef();
            }
            else if (!TypeSemantics.IsReferenceType(converted.ResultType))
            {
                throw EntityUtil.EntitySqlError(keyExpr.ArgExpr.ErrCtx, Strings.InvalidKeyArgument(converted.ResultType.EdmType.FullName));
            }

            converted = converted.GetRefKey();
            Debug.Assert(null != converted, "null != converted");

            return new ValueExpression(converted);
        }

3. Example

Project: referencesource
Source File: ITreeGenerator.cs
private bool TryRewriteKeyPropertyAccess(DbPropertyExpression propertyExpression, out DbExpression r/n ..... /n //View Source file for more details /n }

4. Example

Project: referencesource
Source File: ObjectSpanRewriter.cs
private DbExpression RewriteEntity(DbExpression expression, EntityType entityType)
        {
       /n ..... /n //View Source file for more details /n }

5. Example

Project: referencesource
Source File: ObjectContext.cs
private int BatchRefreshEntitiesByKey(RefreshMode refreshMode, Dictionary<EntityKey, EntityEntry&/n ..... /n //View Source file for more details /n }