public override DbExpression Visit(DbRefExpression expression)
        {
            EntityUtil.CheckArgumentNull(expression, "expression");

            DbExpression result = expression;

            EntityType targetType = (EntityType)TypeHelpers.GetEdmType <RefType>(expression.ResultType).ElementType;

            DbExpression newArgument = this.VisitExpression(expression.Argument);
            EntityType   newType     = (EntityType)this.VisitType(targetType);
            EntitySet    newSet      = (EntitySet)this.VisitEntitySet(expression.EntitySet);

            if (!object.ReferenceEquals(expression.Argument, newArgument) ||
                !object.ReferenceEquals(targetType, newType) ||
                !object.ReferenceEquals(expression.EntitySet, newSet))
            {
                result = CqtBuilder.RefFromKey(newSet, newArgument, newType);
            }
            NotifyIfChanged(expression, result);
            return(result);
        }
 /// <summary>
 /// Typed visitor pattern method for DbRefExpression.
 /// </summary>
 /// <param name="expression">The DbRefExpression that is being visited.</param>
 /// <returns>An instance of TResultType.</returns>
 public abstract TResultType Visit(DbRefExpression expression);
 /// <summary>
 /// Visitor pattern method for <see cref="DbRefExpression"/>.
 /// </summary>
 /// <param name="expression">The DbRefExpression that is being visited.</param>
 /// <exception cref="ArgumentNullException"><paramref name="expression"/> is null</exception>
 public override void Visit(DbRefExpression expression)
 {
     VisitUnaryExpression(expression);
 }
Пример #4
0
 /// <summary>
 /// Visitor pattern method for DbRefExpression.
 /// </summary>
 /// <param name="expression">The DbRefExpression that is being visited.</param>
 public abstract void Visit(DbRefExpression expression);