C# Class Remotion.Linq.SqlBackend.MappingResolution.SqlContextExpressionVisitor

Ensures that a given expression matches SQL server value semantics.
SqlContextExpressionVisitor traverses an expression tree and ensures that the tree fits SQL server requirements for expressions. In scenarios where a value is required as per SQL server standards, boolean expressions are converted to integers using CASE WHEN expressions. In such situations, and constants are converted to 1 and 0 values, and boolean columns are interpreted as integer values. In scenarios where a predicate is required, boolean expressions are constructed by comparing those integer values to 1 and 0 literals. In scenarios where a single value is required, an exception is thrown where compound values (NewExpression) or entities are encountered.
Inheritance: System.Linq.Expressions.ExpressionTreeVisitor, ISqlSpecificExpressionVisitor, IResolvedSqlExpressionVisitor, ISqlSubStatementVisitor, ISqlGroupingSelectExpressionVisitor, ISqlConvertedBooleanExpressionVisitor, INamedExpressionVisitor, IAggregationExpressionVisitor
Mostrar archivo Open project: re-motion/Relinq-SqlBackend Class Usage Examples

Public Methods

Method Description
ApplySqlExpressionContext ( Expression expression, SqlExpressionContext initialSemantics, IMappingResolutionStage stage, IMappingResolutionContext context ) : Expression
VisitAggregationExpression ( AggregationExpression expression ) : Expression
VisitExpression ( Expression expression ) : Expression
VisitNamedExpression ( NamedExpression expression ) : Expression
VisitSqlCaseExpression ( SqlCaseExpression expression ) : Expression
VisitSqlColumnExpression ( SqlColumnExpression expression ) : Expression
VisitSqlConvertExpression ( SqlConvertExpression expression ) : Expression
VisitSqlConvertedBooleanExpression ( SqlConvertedBooleanExpression expression ) : Expression
VisitSqlEntityConstantExpression ( SqlEntityConstantExpression expression ) : Expression
VisitSqlEntityExpression ( SqlEntityExpression expression ) : Expression
VisitSqlExistsExpression ( SqlExistsExpression expression ) : Expression
VisitSqlFunctionExpression ( SqlFunctionExpression expression ) : Expression
VisitSqlGroupingSelectExpression ( SqlGroupingSelectExpression expression ) : Expression
VisitSqlInExpression ( SqlInExpression expression ) : Expression
VisitSqlIsNotNullExpression ( SqlIsNotNullExpression expression ) : Expression
VisitSqlIsNullExpression ( SqlIsNullExpression expression ) : Expression
VisitSqlLengthExpression ( SqlLengthExpression expression ) : Expression
VisitSqlLikeExpression ( SqlLikeExpression expression ) : Expression
VisitSqlLiteralExpression ( SqlLiteralExpression expression ) : Expression
VisitSqlRowNumberExpression ( SqlRowNumberExpression expression ) : Expression
VisitSqlSubStatementExpression ( SqlSubStatementExpression expression ) : Expression

Protected Methods

Method Description
SqlContextExpressionVisitor ( SqlExpressionContext currentContext, IMappingResolutionStage stage, IMappingResolutionContext context ) : System
VisitBinaryExpression ( BinaryExpression expression ) : Expression
VisitConstantExpression ( ConstantExpression expression ) : Expression
VisitInvocationExpression ( InvocationExpression expression ) : Expression
VisitLambdaExpression ( LambdaExpression expression ) : Expression
VisitMethodCallExpression ( MethodCallExpression expression ) : Expression
VisitNewExpression ( NewExpression expression ) : Expression
VisitUnaryExpression ( UnaryExpression expression ) : Expression

Private Methods

Method Description
ApplyPredicateContext ( Expression expression ) : Expression
ApplySingleValueContext ( Expression expression ) : Expression
ApplySqlExpressionContext ( Expression expression, SqlExpressionContext expressionContext ) : Expression
ApplyValueContext ( Expression expression ) : Expression
CreateValueExpressionForPredicate ( Expression predicate ) : Expression
GetChildSemanticsForBinaryBoolExpression ( ExpressionType expressionType ) : SqlExpressionContext
GetChildSemanticsForUnaryExpression ( Expression expression ) : SqlExpressionContext
HandlePredicateSemantics ( Expression expression ) : Expression
HandleValueSemantics ( Expression expression ) : Expression
VisitChildrenWithGivenSemantics ( Remotion.Linq.Clauses.Expressions.ExtensionExpression expression, SqlExpressionContext childContext ) : Expression

Method Details

ApplySqlExpressionContext() public static method

public static ApplySqlExpressionContext ( Expression expression, SqlExpressionContext initialSemantics, IMappingResolutionStage stage, IMappingResolutionContext context ) : Expression
expression System.Linq.Expressions.Expression
initialSemantics SqlExpressionContext
stage IMappingResolutionStage
context IMappingResolutionContext
return System.Linq.Expressions.Expression

SqlContextExpressionVisitor() protected method

protected SqlContextExpressionVisitor ( SqlExpressionContext currentContext, IMappingResolutionStage stage, IMappingResolutionContext context ) : System
currentContext SqlExpressionContext
stage IMappingResolutionStage
context IMappingResolutionContext
return System

VisitAggregationExpression() public method

public VisitAggregationExpression ( AggregationExpression expression ) : Expression
expression Remotion.Linq.SqlBackend.SqlStatementModel.AggregationExpression
return System.Linq.Expressions.Expression

VisitBinaryExpression() protected method

protected VisitBinaryExpression ( BinaryExpression expression ) : Expression
expression System.Linq.Expressions.BinaryExpression
return System.Linq.Expressions.Expression

VisitConstantExpression() protected method

protected VisitConstantExpression ( ConstantExpression expression ) : Expression
expression System.Linq.Expressions.ConstantExpression
return System.Linq.Expressions.Expression

VisitExpression() public method

public VisitExpression ( Expression expression ) : Expression
expression System.Linq.Expressions.Expression
return System.Linq.Expressions.Expression

VisitInvocationExpression() protected method

protected VisitInvocationExpression ( InvocationExpression expression ) : Expression
expression System.Linq.Expressions.InvocationExpression
return System.Linq.Expressions.Expression

VisitLambdaExpression() protected method

protected VisitLambdaExpression ( LambdaExpression expression ) : Expression
expression System.Linq.Expressions.LambdaExpression
return System.Linq.Expressions.Expression

VisitMethodCallExpression() protected method

protected VisitMethodCallExpression ( MethodCallExpression expression ) : Expression
expression System.Linq.Expressions.MethodCallExpression
return System.Linq.Expressions.Expression

VisitNamedExpression() public method

public VisitNamedExpression ( NamedExpression expression ) : Expression
expression Remotion.Linq.SqlBackend.SqlStatementModel.NamedExpression
return System.Linq.Expressions.Expression

VisitNewExpression() protected method

protected VisitNewExpression ( NewExpression expression ) : Expression
expression System.Linq.Expressions.NewExpression
return System.Linq.Expressions.Expression

VisitSqlCaseExpression() public method

public VisitSqlCaseExpression ( SqlCaseExpression expression ) : Expression
expression Remotion.Linq.SqlBackend.SqlStatementModel.SqlSpecificExpressions.SqlCaseExpression
return System.Linq.Expressions.Expression

VisitSqlColumnExpression() public method

public VisitSqlColumnExpression ( SqlColumnExpression expression ) : Expression
expression Remotion.Linq.SqlBackend.SqlStatementModel.Resolved.SqlColumnExpression
return System.Linq.Expressions.Expression

VisitSqlConvertExpression() public method

public VisitSqlConvertExpression ( SqlConvertExpression expression ) : Expression
expression Remotion.Linq.SqlBackend.SqlStatementModel.SqlSpecificExpressions.SqlConvertExpression
return System.Linq.Expressions.Expression

VisitSqlConvertedBooleanExpression() public method

public VisitSqlConvertedBooleanExpression ( SqlConvertedBooleanExpression expression ) : Expression
expression Remotion.Linq.SqlBackend.SqlStatementModel.Resolved.SqlConvertedBooleanExpression
return System.Linq.Expressions.Expression

VisitSqlEntityConstantExpression() public method

public VisitSqlEntityConstantExpression ( SqlEntityConstantExpression expression ) : Expression
expression Remotion.Linq.SqlBackend.SqlStatementModel.Resolved.SqlEntityConstantExpression
return System.Linq.Expressions.Expression

VisitSqlEntityExpression() public method

public VisitSqlEntityExpression ( SqlEntityExpression expression ) : Expression
expression Remotion.Linq.SqlBackend.SqlStatementModel.Resolved.SqlEntityExpression
return System.Linq.Expressions.Expression

VisitSqlExistsExpression() public method

public VisitSqlExistsExpression ( SqlExistsExpression expression ) : Expression
expression Remotion.Linq.SqlBackend.SqlStatementModel.SqlSpecificExpressions.SqlExistsExpression
return System.Linq.Expressions.Expression

VisitSqlFunctionExpression() public method

public VisitSqlFunctionExpression ( SqlFunctionExpression expression ) : Expression
expression Remotion.Linq.SqlBackend.SqlStatementModel.SqlSpecificExpressions.SqlFunctionExpression
return System.Linq.Expressions.Expression

VisitSqlGroupingSelectExpression() public method

public VisitSqlGroupingSelectExpression ( SqlGroupingSelectExpression expression ) : Expression
expression Remotion.Linq.SqlBackend.SqlStatementModel.SqlGroupingSelectExpression
return System.Linq.Expressions.Expression

VisitSqlInExpression() public method

public VisitSqlInExpression ( SqlInExpression expression ) : Expression
expression Remotion.Linq.SqlBackend.SqlStatementModel.SqlSpecificExpressions.SqlInExpression
return System.Linq.Expressions.Expression

VisitSqlIsNotNullExpression() public method

public VisitSqlIsNotNullExpression ( SqlIsNotNullExpression expression ) : Expression
expression Remotion.Linq.SqlBackend.SqlStatementModel.SqlSpecificExpressions.SqlIsNotNullExpression
return System.Linq.Expressions.Expression

VisitSqlIsNullExpression() public method

public VisitSqlIsNullExpression ( SqlIsNullExpression expression ) : Expression
expression Remotion.Linq.SqlBackend.SqlStatementModel.SqlSpecificExpressions.SqlIsNullExpression
return System.Linq.Expressions.Expression

VisitSqlLengthExpression() public method

public VisitSqlLengthExpression ( SqlLengthExpression expression ) : Expression
expression Remotion.Linq.SqlBackend.SqlStatementModel.SqlSpecificExpressions.SqlLengthExpression
return System.Linq.Expressions.Expression

VisitSqlLikeExpression() public method

public VisitSqlLikeExpression ( SqlLikeExpression expression ) : Expression
expression Remotion.Linq.SqlBackend.SqlStatementModel.SqlSpecificExpressions.SqlLikeExpression
return System.Linq.Expressions.Expression

VisitSqlLiteralExpression() public method

public VisitSqlLiteralExpression ( SqlLiteralExpression expression ) : Expression
expression Remotion.Linq.SqlBackend.SqlStatementModel.SqlSpecificExpressions.SqlLiteralExpression
return System.Linq.Expressions.Expression

VisitSqlRowNumberExpression() public method

public VisitSqlRowNumberExpression ( SqlRowNumberExpression expression ) : Expression
expression Remotion.Linq.SqlBackend.SqlStatementModel.SqlSpecificExpressions.SqlRowNumberExpression
return System.Linq.Expressions.Expression

VisitSqlSubStatementExpression() public method

public VisitSqlSubStatementExpression ( SqlSubStatementExpression expression ) : Expression
expression Remotion.Linq.SqlBackend.SqlStatementModel.SqlSubStatementExpression
return System.Linq.Expressions.Expression

VisitUnaryExpression() protected method

protected VisitUnaryExpression ( UnaryExpression expression ) : Expression
expression System.Linq.Expressions.UnaryExpression
return System.Linq.Expressions.Expression