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

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

4 Examples 7

1. Example

Project: referencesource
Source File: SemanticAnalyzer.cs
View license
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);
        }

2. Example

Project: referencesource
Source File: MemberPath.cs
View license
internal DbExpression AsCqt(DbExpression row)
        {
            DbExpression cqt = row;

            // Process all items in the path.
            AsCql(
                // accessMember action
                (memberName) =>
                {
                    cqt = DbExpressionBuilder.Property(cqt, memberName);
                },
                // getKey action
                () =>
                {
                    cqt = cqt.GetRefKey();
                },
                // treatAs action
                (treatAsType) =>
                {
                    var typeUsage = TypeUsage.Create(treatAsType);
                    cqt = cqt.TreatAs(typeUsage);
                });

            return cqt;
        }

3. Example

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

4. Example

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