SqlTranslatingExpressionVisitor SqlTranslatingExpressionVisitor Class

The default relational LINQ translating expression visitor.

Syntax

Declaration

public class SqlTranslatingExpressionVisitor : ThrowingExpressionVisitorPublic Class SqlTranslatingExpressionVisitor
    Inherits ThrowingExpressionVisitor

Inheritance Hierarchy

  • System.Object
    System.Object
  • SqlTranslatingExpressionVisitor
    SqlTranslatingExpressionVisitor

Constructors summary

Creates a new instance of SqlTranslatingExpressionVisitor.

Properties summary

When translating a predicate expression, returns a client expression corresponding to the part of the target expression that should be evaluated locally.

Methods summary

Creates an unhandled item exception.

Visits the given expression.

Visit a binary expression.

Visits a conditional expression.

Visits a constant expression.

Visits an extension expression.

Visit a member expression.

Visits a method call expression.

Visits a new expression.

Visits a parameter expression.

Visits a query source reference expression.

Visits a sub-query expression.

Visit a unary expression.

Called when an unhandled item is visited. This method provides the item the visitor cannot handle (unhandledItem), the visitMethod that is not implemented in the visitor, and a delegate that can be used to invoke the baseBehavior of the Remotion.Linq.Parsing.RelinqExpressionVisitor class. The default behavior of this method is to call the

Remotion.Linq.Parsing.ThrowingExpressionVisitor.CreateUnhandledItemException``1(``0,System.String) method, but it can be overridden to do something else.

Constructors

  • SqlTranslatingExpressionVisitor(IRelationalAnnotationProvider, IExpressionFragmentTranslator, IMethodCallTranslator, IMemberTranslator, IRelationalTypeMapper, RelationalQueryModelVisitor, SelectExpression, Expression, Boolean, Boolean)
    SqlTranslatingExpressionVisitor(IRelationalAnnotationProvider, IExpressionFragmentTranslator, IMethodCallTranslator, IMemberTranslator, IRelationalTypeMapper, RelationalQueryModelVisitor, SelectExpression, Expression, Boolean, Boolean)

    Creates a new instance of SqlTranslatingExpressionVisitor.

    public SqlTranslatingExpressionVisitor(IRelationalAnnotationProvider relationalAnnotationProvider, IExpressionFragmentTranslator compositeExpressionFragmentTranslator, IMethodCallTranslator methodCallTranslator, IMemberTranslator memberTranslator, IRelationalTypeMapper relationalTypeMapper, RelationalQueryModelVisitor queryModelVisitor, SelectExpression targetSelectExpression = null, Expression topLevelPredicate = null, bool bindParentQueries = false, bool inProjection = false)Public Sub New(relationalAnnotationProvider As IRelationalAnnotationProvider, compositeExpressionFragmentTranslator As IExpressionFragmentTranslator, methodCallTranslator As IMethodCallTranslator, memberTranslator As IMemberTranslator, relationalTypeMapper As IRelationalTypeMapper, queryModelVisitor As RelationalQueryModelVisitor, targetSelectExpression As SelectExpression = Nothing, topLevelPredicate As Expression = Nothing, bindParentQueries As Boolean = False, inProjection As Boolean = False)

    Parameters

Properties

  • ClientEvalPredicate
    ClientEvalPredicate

    When translating a predicate expression, returns a client expression corresponding to the part of the target expression that should be evaluated locally.

    public virtual Expression ClientEvalPredicate { get; }Public Overridable ReadOnly Property ClientEvalPredicate As Expression

    Property Value

    • System.Linq.Expressions.Expression
      System.Linq.Expressions.Expression

      The client eval predicate.

Methods

  • CreateUnhandledItemException<T>(T, String)
    CreateUnhandledItemException(Of T)(T, String)

    Creates an unhandled item exception.

    protected override Exception CreateUnhandledItemException<T>(T unhandledItem, string visitMethod)Protected Overrides Function CreateUnhandledItemException(Of T)(unhandledItem As T, visitMethod As String) As Exception

    Parameters

    • unhandledItem
      T
      T

      The unhandled item.

    • visitMethod
      System.String
      System.String

      The visit method that is not implemented.

    Returns

    • System.Exception
      System.Exception

      The new unhandled item exception.

  • Visit(Expression)
    Visit(Expression)

    Visits the given expression.

    public override Expression Visit(Expression expression)Public Overrides Function Visit(expression As Expression) As Expression

    Parameters

    • expression
      System.Linq.Expressions.Expression
      System.Linq.Expressions.Expression

      The expression to visit.

    Returns

    • System.Linq.Expressions.Expression
      System.Linq.Expressions.Expression

      An Expression.

  • VisitBinary(BinaryExpression)
    VisitBinary(BinaryExpression)

    Visit a binary expression.

    protected override Expression VisitBinary(BinaryExpression expression)Protected Overrides Function VisitBinary(expression As BinaryExpression) As Expression

    Parameters

    • expression
      System.Linq.Expressions.BinaryExpression
      System.Linq.Expressions.BinaryExpression

      The expression to visit.

    Returns

    • System.Linq.Expressions.Expression
      System.Linq.Expressions.Expression

      An Expression.

  • VisitConditional(ConditionalExpression)
    VisitConditional(ConditionalExpression)

    Visits a conditional expression.

    protected override Expression VisitConditional(ConditionalExpression expression)Protected Overrides Function VisitConditional(expression As ConditionalExpression) As Expression

    Parameters

    • expression
      System.Linq.Expressions.ConditionalExpression
      System.Linq.Expressions.ConditionalExpression

      The expression to visit.

    Returns

    • System.Linq.Expressions.Expression
      System.Linq.Expressions.Expression

      An Expression.

  • VisitConstant(ConstantExpression)
    VisitConstant(ConstantExpression)

    Visits a constant expression.

    protected override Expression VisitConstant(ConstantExpression expression)Protected Overrides Function VisitConstant(expression As ConstantExpression) As Expression

    Parameters

    • expression
      System.Linq.Expressions.ConstantExpression
      System.Linq.Expressions.ConstantExpression

      The expression to visit.

    Returns

    • System.Linq.Expressions.Expression
      System.Linq.Expressions.Expression

      An Expression.

  • VisitExtension(Expression)
    VisitExtension(Expression)

    Visits an extension expression.

    protected override Expression VisitExtension(Expression expression)Protected Overrides Function VisitExtension(expression As Expression) As Expression

    Parameters

    • expression
      System.Linq.Expressions.Expression
      System.Linq.Expressions.Expression

      The expression to visit.

    Returns

    • System.Linq.Expressions.Expression
      System.Linq.Expressions.Expression

      An Expression.

  • VisitMember(MemberExpression)
    VisitMember(MemberExpression)

    Visit a member expression.

    protected override Expression VisitMember(MemberExpression expression)Protected Overrides Function VisitMember(expression As MemberExpression) As Expression

    Parameters

    • expression
      System.Linq.Expressions.MemberExpression
      System.Linq.Expressions.MemberExpression

      The expression to visit.

    Returns

    • System.Linq.Expressions.Expression
      System.Linq.Expressions.Expression

      An Expression.

  • VisitMethodCall(MethodCallExpression)
    VisitMethodCall(MethodCallExpression)

    Visits a method call expression.

    protected override Expression VisitMethodCall(MethodCallExpression methodCallExpression)Protected Overrides Function VisitMethodCall(methodCallExpression As MethodCallExpression) As Expression

    Parameters

    • methodCallExpression
      System.Linq.Expressions.MethodCallExpression
      System.Linq.Expressions.MethodCallExpression

      The expression to visit.

    Returns

    • System.Linq.Expressions.Expression
      System.Linq.Expressions.Expression

      An Expression.

  • VisitNew(NewExpression)
    VisitNew(NewExpression)

    Visits a new expression.

    protected override Expression VisitNew(NewExpression expression)Protected Overrides Function VisitNew(expression As NewExpression) As Expression

    Parameters

    • expression
      System.Linq.Expressions.NewExpression
      System.Linq.Expressions.NewExpression

      The expression to visit.

    Returns

    • System.Linq.Expressions.Expression
      System.Linq.Expressions.Expression

      An Expression.

  • VisitParameter(ParameterExpression)
    VisitParameter(ParameterExpression)

    Visits a parameter expression.

    protected override Expression VisitParameter(ParameterExpression expression)Protected Overrides Function VisitParameter(expression As ParameterExpression) As Expression

    Parameters

    • expression
      System.Linq.Expressions.ParameterExpression
      System.Linq.Expressions.ParameterExpression

      The expression to visit.

    Returns

    • System.Linq.Expressions.Expression
      System.Linq.Expressions.Expression

      An Expression.

  • VisitQuerySourceReference(QuerySourceReferenceExpression)
    VisitQuerySourceReference(QuerySourceReferenceExpression)

    Visits a query source reference expression.

    protected override Expression VisitQuerySourceReference(QuerySourceReferenceExpression expression)Protected Overrides Function VisitQuerySourceReference(expression As QuerySourceReferenceExpression) As Expression

    Parameters

    • expression
      QuerySourceReferenceExpression
      QuerySourceReferenceExpression

      The expression to visit.

    Returns

    • System.Linq.Expressions.Expression
      System.Linq.Expressions.Expression

      An Expression.

  • VisitSubQuery(SubQueryExpression)
    VisitSubQuery(SubQueryExpression)

    Visits a sub-query expression.

    protected override Expression VisitSubQuery(SubQueryExpression expression)Protected Overrides Function VisitSubQuery(expression As SubQueryExpression) As Expression

    Parameters

    • expression
      SubQueryExpression
      SubQueryExpression

      The expression to visit.

    Returns

    • System.Linq.Expressions.Expression
      System.Linq.Expressions.Expression

      An Expression.

  • VisitUnary(UnaryExpression)
    VisitUnary(UnaryExpression)

    Visit a unary expression.

    protected override Expression VisitUnary(UnaryExpression expression)Protected Overrides Function VisitUnary(expression As UnaryExpression) As Expression

    Parameters

    • expression
      System.Linq.Expressions.UnaryExpression
      System.Linq.Expressions.UnaryExpression

      The expression to visit.

    Returns

    • System.Linq.Expressions.Expression
      System.Linq.Expressions.Expression

      An Expression.

  • VisitUnhandledItem<TItem, TResult>(TItem, String, Func<TItem, TResult>)
    VisitUnhandledItem(Of TItem, TResult)(TItem, String, Func(Of TItem, TResult))

    Called when an unhandled item is visited. This method provides the item the visitor cannot handle (unhandledItem), the visitMethod that is not implemented in the visitor, and a delegate that can be used to invoke the baseBehavior of the Remotion.Linq.Parsing.RelinqExpressionVisitor class. The default behavior of this method is to call the

    Remotion.Linq.Parsing.ThrowingExpressionVisitor.CreateUnhandledItemException``1(``0,System.String) method, but it can be overridden to do something else.

    protected override TResult VisitUnhandledItem<TItem, TResult>(TItem unhandledItem, string visitMethod, Func<TItem, TResult> baseBehavior)Protected Overrides Function VisitUnhandledItem(Of TItem, TResult)(unhandledItem As TItem, visitMethod As String, baseBehavior As Func(Of TItem, TResult)) As TResult

    Parameters

    • unhandledItem
      TItem
      TItem

      The unhandled item.

    • visitMethod
      System.String
      System.String

      The visit method that is not implemented.

    • baseBehavior
      System.Func<T, TResult><TItem, TResult>
      System.Func<T, TResult>(Of TItem, TResult)

      The behavior exposed by Remotion.Linq.Parsing.RelinqExpressionVisitor for this item type.

    Returns

    • TResult
      TResult

      An object to replace unhandledItem in the expression tree. Alternatively, the method can throw any exception.

Details

Assembly

Microsoft.EntityFrameworkCore.Relational.dll