public override Expression Visit(DbOfTypeExpression expression) { throw new NotImplementedException( string.Format( ExceptionMessages.DbExpressionTransformationNotImplemented, typeof(DbOfTypeExpression).Name)); }
public override DbExpression Visit(DbOfTypeExpression expression) { #if DEBUG_VISITS System.Diagnostics.Debug.Print("Visit(DbOfTypeExpression): OfType={0}", expression.OfType.EdmType.Name); #endif // This visitor is called for TPH & TPT entities that need to map from base entity type to the // actual type. Argument contains the base type expression (i.e. User) and OfType contains the // derived type (i.e. Student). // We need to check for any filters that are defined only on the derived type and apply those filters // here - they will not be detected during the DbScanExpression visitor because those filters will not // exist on the base type. // Filters defined on the base type will be found on both entities. So we only want to apply the filter // that are defined on the OfType entity that are not defined on the Argument entity (as those will be // applied during the DbScanExpression visitor). IEnumerable<DynamicFilterDefinition> scanFilterList = null; var scanExp = expression.Argument as DbScanExpression; if (scanExp != null) scanFilterList = FindFiltersForEntitySet(scanExp.Target.ElementType.MetadataProperties); var ofTypeFilterList = FindFiltersForEntitySet(expression.OfType.EdmType.MetadataProperties); var filtersToApply = ofTypeFilterList.Where(f => (scanFilterList == null) || !scanFilterList.Any(f2 => f2.ID == f.ID)); var baseResult = base.Visit(expression); if (filtersToApply.Any()) { var binding = DbExpressionBuilder.Bind(baseResult); var newFilterExpression = BuildFilterExpressionWithDynamicFilters(filtersToApply, binding, null); if (newFilterExpression != null) { // If not null, a new DbFilterExpression has been created with our dynamic filters. return newFilterExpression; } } return baseResult; }
public override void Visit(DbOfTypeExpression expression) { throw new NotSupportedException("Visit(\"OfTypeExpression\") is not supported."); }
public override object Visit(DbOfTypeExpression expression) { this.Visit(expression.Argument); return(null); }
public override void Visit(DbOfTypeExpression e) { VisitExprKind(e.ExpressionKind); _key.Append('('); e.Argument.Accept(this); _key.Append(":"); _key.Append(e.OfType.EdmType.Identity); _key.Append(')'); }
public override void Visit(DbOfTypeExpression expression) { Contract.Requires(expression != null); }
public override void Visit(DbOfTypeExpression e) { BeginUnary(e); Dump(e.OfType, "OfType"); End(e); }
/// <summary> /// <see cref="VisitUnaryExpression" /> /// </summary> /// <param name="expression"> The DbOfTypeExpression that is being visited. </param> /// <returns> </returns> public override bool Visit(DbOfTypeExpression expression) { Check.NotNull(expression, "expression"); return(VisitUnaryExpression(expression)); }
public override DbExpressionEntitySetInfo Visit(DbOfTypeExpression expression) { Check.NotNull(expression, "expression"); return(null); }
public override LegacyCommandTrees.DbExpression Visit(DbOfTypeExpression expression) { throw new NotImplementedException(); }
public override void Visit(DbOfTypeExpression expression) { throw new NotImplementedException(); }
public override DbExpressionEntitySetInfo Visit(DbOfTypeExpression expression) { return(null); }
public override IPostgreSqlFragment Visit(DbOfTypeExpression expression) { throw new NotImplementedException(); }
public override SqlFragment Visit(DbOfTypeExpression expression) { throw new NotSupportedException(); }
public override ViewValidator.DbExpressionEntitySetInfo Visit( DbOfTypeExpression expression) { Check.NotNull <DbOfTypeExpression>(expression, nameof(expression)); return((ViewValidator.DbExpressionEntitySetInfo)null); }
/// <summary> /// Implements the visitor pattern for <see cref="T:System.Data.Common.CommandTrees.DbOfTypeExpression"/>. /// </summary> /// <param name="expression">The <see cref="T:System.Data.Common.CommandTrees.DbOfTypeExpression"/> that is visited.</param> public override void Visit(DbOfTypeExpression expression) { if (expression == null) { throw new ArgumentNullException("expression"); } expression.Argument.Accept(this); }
public override bool Visit(DbOfTypeExpression expression) { return(VisitUnaryExpression(expression)); }
public override void Visit(DbOfTypeExpression e) { Check.NotNull(e, "e"); BeginUnary(e); Dump(e.OfType, "OfType"); End(e); }
public override void Visit(DbOfTypeExpression expression) { }
/// <summary> /// Visitor pattern method for <see cref="DbOfTypeExpression" />. /// </summary> /// <param name="expression"> The DbOfTypeExpression that is being visited. </param> /// <exception cref="ArgumentNullException"> /// <paramref name="expression" /> /// is null /// </exception> public override void Visit(DbOfTypeExpression expression) { Check.NotNull(expression, "expression"); VisitUnaryExpression(expression); }
/// <summary> /// Visitor pattern method for DbOfTypeExpression. /// </summary> /// <param name="expression"> The DbOfTypeExpression that is being visited. </param> public abstract void Visit(DbOfTypeExpression expression);
public override TReturn Visit(DbOfTypeExpression expression) { Check.NotNull(expression, "expression"); throw ConstructNotSupportedException(expression); }
public override void Visit(DbOfTypeExpression expression) { VisitUnaryExpression(expression); }
/// <summary> /// Implements the visitor pattern for <see cref="T:System.Data.Common.CommandTrees.DbOfTypeExpression"/>. /// </summary> /// <param name="expression">The <see cref="T:System.Data.Common.CommandTrees.DbOfTypeExpression"/> that is visited.</param> public override void Visit(DbOfTypeExpression expression) { expression.Argument.Accept(this); }