/// <inheritdoc /> protected override void Print(ExpressionPrinter expressionPrinter) { if (!string.IsNullOrEmpty(Schema)) { expressionPrinter.Append(Schema).Append(".").Append(Name); } else { Check.DebugAssert(Instance is null, "Instance is null"); expressionPrinter.Append(Name); } if (!IsNiladic) { expressionPrinter.Append("("); if (IsAggregateDistinct) { expressionPrinter.Append("DISTINCT "); } expressionPrinter.VisitCollection(Arguments); if (AggregateOrderings.Count > 0) { expressionPrinter.Append(" ORDER BY "); expressionPrinter.VisitCollection(AggregateOrderings); } expressionPrinter.Append(")"); if (AggregatePredicate is not null) { expressionPrinter.Append(" FILTER (WHERE "); expressionPrinter.Visit(AggregatePredicate); expressionPrinter.Append(")"); } } }
protected override void Print(ExpressionPrinter expressionPrinter) { Check.NotNull(expressionPrinter, nameof(expressionPrinter)); if (OperatorType == ExpressionType.Convert && TypeMapping != null) { expressionPrinter.Append("CAST("); expressionPrinter.Visit(Operand); expressionPrinter.Append(")"); expressionPrinter.Append(" AS "); expressionPrinter.Append(TypeMapping.StoreType); expressionPrinter.Append(")"); } else { expressionPrinter.Append(OperatorType.ToString()); expressionPrinter.Append("("); expressionPrinter.Visit(Operand); expressionPrinter.Append(")"); } }
private void Print( object?value, ExpressionPrinter expressionPrinter) { if (value is IEnumerable enumerable && !(value is string) && !(value is byte[])) { var first = true; foreach (var item in enumerable) { if (!first) { expressionPrinter.Append(", "); } first = false; Print(item, expressionPrinter); } }
protected override void Print(ExpressionPrinter expressionPrinter) { var requiresBrackets = RequiresBrackets(Left); if (requiresBrackets) { expressionPrinter.Append("("); } expressionPrinter.Visit(Left); if (requiresBrackets) { expressionPrinter.Append(")"); } switch (OperatorType) { case MySqlBinaryExpressionOperatorType.IntegerDivision: expressionPrinter.Append(" DIV "); break; case MySqlBinaryExpressionOperatorType.NonOptimizedEqual: expressionPrinter.Append(" = "); break; default: throw new ArgumentOutOfRangeException(); } requiresBrackets = RequiresBrackets(Right); if (requiresBrackets) { expressionPrinter.Append("("); } expressionPrinter.Visit(Right); if (requiresBrackets) { expressionPrinter.Append(")"); } }
public virtual void Print(ExpressionPrinter expressionPrinter) { expressionPrinter.AppendLine(nameof(InMemoryQueryExpression) + ": "); using (expressionPrinter.Indent()) { expressionPrinter.AppendLine(nameof(ServerQueryExpression) + ": "); using (expressionPrinter.Indent()) { expressionPrinter.Visit(ServerQueryExpression); } expressionPrinter.AppendLine("ProjectionMapping:"); using (expressionPrinter.Indent()) { foreach (var projectionMapping in _projectionMapping) { expressionPrinter.Append("Member: " + projectionMapping.Key + " Projection: "); expressionPrinter.Visit(projectionMapping.Value); } } expressionPrinter.AppendLine(); } }
protected override void Print(ExpressionPrinter expressionPrinter) { expressionPrinter.Append("MATCH "); expressionPrinter.Append($"({expressionPrinter.Visit(Match)})"); expressionPrinter.Append(" AGAINST "); expressionPrinter.Append($"({expressionPrinter.Visit(Against)}"); switch (SearchMode) { case MySqlMatchSearchMode.NaturalLanguage: break; case MySqlMatchSearchMode.NaturalLanguageWithQueryExpansion: expressionPrinter.Append(" WITH QUERY EXPANSION"); break; case MySqlMatchSearchMode.Boolean: expressionPrinter.Append(" IN BOOLEAN MODE"); break; } expressionPrinter.Append(")"); }
void IPrintableExpression.Print(ExpressionPrinter expressionPrinter) { Check.NotNull(expressionPrinter, nameof(expressionPrinter)); expressionPrinter.Append(ToString()); }
/// <inheritdoc /> protected override void Print(ExpressionPrinter expressionPrinter) { expressionPrinter.Append("CROSS APPLY "); expressionPrinter.Visit(Table); }
/// <summary> /// This is an internal API that supports the Entity Framework Core infrastructure and not subject to /// the same compatibility standards as public APIs. It may be changed or removed without notice in /// any release. You should only use it directly in your code with extreme caution and knowing that /// doing so can result in application failures when updating to a new Entity Framework Core release. /// </summary> public virtual void Print(ExpressionPrinter expressionPrinter) { Check.NotNull(expressionPrinter, nameof(expressionPrinter)); expressionPrinter.Append(ToString()); }
protected override void Print(ExpressionPrinter expressionPrinter) => expressionPrinter.Append("FakeSqlExpression");
/// <summary> /// This is an internal API that supports the Entity Framework Core infrastructure and not subject to /// the same compatibility standards as public APIs. It may be changed or removed without notice in /// any release. You should only use it directly in your code with extreme caution and knowing that /// doing so can result in application failures when updating to a new Entity Framework Core release. /// </summary> public override void Print(ExpressionPrinter expressionPrinter) => expressionPrinter.Append(ToString());
protected override void Print(ExpressionPrinter expressionPrinter) { Check.NotNull(expressionPrinter, nameof(expressionPrinter)); expressionPrinter.Append("@" + _parameterExpression.Name); }
public override void Print(ExpressionPrinter expressionPrinter) => expressionPrinter.Append("@" + _parameterExpression.Name);
/// <inheritdoc /> void IPrintableExpression.Print(ExpressionPrinter expressionPrinter) { expressionPrinter.Visit(Expression); expressionPrinter.Append(IsAscending ? " ASC" : " DESC"); }
protected override void Print(ExpressionPrinter expressionPrinter) { expressionPrinter.ThrowIfNull(nameof(expressionPrinter)); expressionPrinter.Append(Name).Append(" AS ").Append(Alias); }
/// <inheritdoc /> protected override void Print(ExpressionPrinter expressionPrinter) { expressionPrinter.Append(TableAlias).Append("."); expressionPrinter.Append(Name); }
/// <inheritdoc /> protected override void Print(ExpressionPrinter expressionPrinter) { expressionPrinter.Append("OUTER APPLY "); expressionPrinter.Visit(Table); PrintAnnotations(expressionPrinter); }
/// <summary> /// This is an internal API that supports the Entity Framework Core infrastructure and not subject to /// the same compatibility standards as public APIs. It may be changed or removed without notice in /// any release. You should only use it directly in your code with extreme caution and knowing that /// doing so can result in application failures when updating to a new Entity Framework Core release. /// </summary> public virtual void Print(ExpressionPrinter expressionPrinter) { expressionPrinter.Visit(Expression); expressionPrinter.Append(IsAscending ? " ASC" : " DESC"); }
void IPrintableExpression.Print(ExpressionPrinter expressionPrinter) { Check.NotNull(expressionPrinter, nameof(expressionPrinter)); expressionPrinter.Append(nameof(InMemoryTableExpression) + ": Entity: " + EntityType.DisplayName()); }
protected override void Print(ExpressionPrinter expressionPrinter) => expressionPrinter.Append(ToString());
private void Print(object value, ExpressionPrinter expressionPrinter) => expressionPrinter.Append(TypeMapping?.GenerateSqlLiteral(value) ?? Value?.ToString() ?? "NULL");
public virtual void Print(ExpressionPrinter expressionPrinter) => expressionPrinter.Append(ToString());
public override void Print(ExpressionPrinter expressionPrinter) { expressionPrinter.Append(ToString()); // TODO: ist this correct? }
/// <summary> /// This is an internal API that supports the Entity Framework Core infrastructure and not subject to /// the same compatibility standards as public APIs. It may be changed or removed without notice in /// any release. You should only use it directly in your code with extreme caution and knowing that /// doing so can result in application failures when updating to a new Entity Framework Core release. /// </summary> protected override void Print(ExpressionPrinter expressionPrinter) { base.Print(expressionPrinter); expressionPrinter.Append($".TemporalContainedIn({From}, {To})"); }
/// <inheritdoc /> protected override void Print(ExpressionPrinter expressionPrinter) { Check.NotNull(expressionPrinter, nameof(expressionPrinter)); expressionPrinter.Append(Sql); }
public override void Print(ExpressionPrinter expressionPrinter) { expressionPrinter.Visit(Left); expressionPrinter.Append(Operator); expressionPrinter.Visit(Right); }
public override void Print(ExpressionPrinter expressionPrinter) { expressionPrinter.Visit(LambdaParameter); expressionPrinter.Append(" -> "); expressionPrinter.Visit(Inner); }
public override void Print(ExpressionPrinter expressionPrinter) { expressionPrinter.Append(this.Function); expressionPrinter.VisitList(this.Arguments); }
public virtual void Print(ExpressionPrinter expressionPrinter) { expressionPrinter.Append(nameof(HarmonyTableExpression) + ": Entity: " + EntityType.DisplayName()); }
/// <inheritdoc /> protected override void Print(ExpressionPrinter expressionPrinter) { Check.NotNull(expressionPrinter, nameof(expressionPrinter)); var requiresBrackets = RequiresBrackets(Left); if (requiresBrackets) { expressionPrinter.Append("("); } expressionPrinter.Visit(Left); if (requiresBrackets) { expressionPrinter.Append(")"); } expressionPrinter .Append(" ") .Append(OperatorType switch { PostgresExpressionType.Contains => "@>", PostgresExpressionType.ContainedBy => "<@", PostgresExpressionType.Overlaps => "&&", PostgresExpressionType.NetworkContainedByOrEqual => "<<=", PostgresExpressionType.NetworkContainsOrEqual => ">>=", PostgresExpressionType.NetworkContainsOrContainedBy => "&&", PostgresExpressionType.RangeIsStrictlyLeftOf => "<<", PostgresExpressionType.RangeIsStrictlyRightOf => ">>", PostgresExpressionType.RangeDoesNotExtendRightOf => "&<", PostgresExpressionType.RangeDoesNotExtendLeftOf => "&>", PostgresExpressionType.RangeIsAdjacentTo => "-|-", PostgresExpressionType.RangeUnion => "+", PostgresExpressionType.RangeIntersect => "*", PostgresExpressionType.RangeExcept => "-", PostgresExpressionType.TextSearchMatch => "@@", PostgresExpressionType.TextSearchAnd => "&&", PostgresExpressionType.TextSearchOr => "||", PostgresExpressionType.JsonExists => "?", PostgresExpressionType.JsonExistsAny => "?|", PostgresExpressionType.JsonExistsAll => "?&", PostgresExpressionType.LTreeMatches when Right.TypeMapping?.StoreType == "lquery" || Right.TypeMapping is NpgsqlArrayTypeMapping arrayMapping && arrayMapping.ElementMapping.StoreType == "lquery" => "~", PostgresExpressionType.LTreeMatches when Right.TypeMapping?.StoreType == "ltxtquery" => "@", PostgresExpressionType.LTreeMatchesAny => "?", PostgresExpressionType.LTreeFirstAncestor => "?@>", PostgresExpressionType.LTreeFirstDescendent => "?<@", PostgresExpressionType.LTreeFirstMatches when Right.TypeMapping?.StoreType == "lquery" => "?~", PostgresExpressionType.LTreeFirstMatches when Right.TypeMapping?.StoreType == "ltxtquery" => "?@", PostgresExpressionType.PostgisDistanceKnn => "<->", _ => throw new ArgumentOutOfRangeException($"Unhandled operator type: {OperatorType}") })