C# Class SqlFu.Builders.Expressions.ExpressionSqlGenerator

Inheritance: System.Linq.Expressions.ExpressionVisitor, IGenerateSqlFromExpressions
Datei anzeigen Open project: sapiens/SqlFu

Public Methods

Method Description
ExpressionSqlGenerator ( IDbProviderExpressions provider, ITableInfoFactory factory, IEscapeIdentifier escape, ParametersManager param = null ) : System
GetColumnsSql ( ) : string

Only to generate "select columns"

GetSql ( Expression expression ) : string

For everything except "select columns"

ToString ( ) : string

Protected Methods

Method Description
VisitBinary ( BinaryExpression node ) : Expression
VisitConstant ( ConstantExpression node ) : Expression
VisitMember ( MemberExpression node ) : Expression

This is called only in criterias. It shouldn't be called when in generating columns

VisitMemberInit ( MemberInitExpression node ) : Expression
VisitMethodCall ( MethodCallExpression node ) : Expression
VisitNew ( NewExpression node ) : Expression
VisitUnary ( UnaryExpression node ) : Expression

Private Methods

Method Description
GetColumnName ( MemberExpression member ) : string
GetColumnName ( MemberInfo column ) : string
GetColumnName ( UnaryExpression member ) : string
HandleAnonymous ( NewExpression node ) : void
HandleContains ( MethodCallExpression meth ) : void
HandleDateTimeProperties ( MemberExpression node ) : void
HandleInject ( MethodCallExpression node ) : void
HandleObject ( NewExpression node ) : int

Returns how many columns were written

HandleParamStringFunctions ( MethodCallExpression node ) : void
HandleParameter ( MemberExpression node ) : void
HandleParameter ( MethodCallExpression node ) : void
HandleParameterSubProperty ( MemberExpression node ) : void

For properties of a parameter property. Used to for properties that can be translated into db functions

HandleSingleBooleanConstant ( ConstantExpression node ) : void
HandleSingleBooleanProperty ( MemberExpression node, bool b ) : void
HandleStringProperties ( MemberExpression node ) : void
IsLambdaBooleanConstantHandled ( LambdaExpression expression ) : bool
IsSingleBooleanConstant ( ConstantExpression node ) : bool
IsSingleBooleanProperty ( Expression node ) : bool
VisitProjection ( NewExpression node ) : void
WriteParameter ( Expression node ) : void

Method Details

ExpressionSqlGenerator() public method

public ExpressionSqlGenerator ( IDbProviderExpressions provider, ITableInfoFactory factory, IEscapeIdentifier escape, ParametersManager param = null ) : System
provider IDbProviderExpressions
factory ITableInfoFactory
escape IEscapeIdentifier
param ParametersManager
return System

GetColumnsSql() public method

Only to generate "select columns"
public GetColumnsSql ( ) : string
return string

GetSql() public method

For everything except "select columns"
public GetSql ( Expression expression ) : string
expression System.Linq.Expressions.Expression
return string

ToString() public method

public ToString ( ) : string
return string

VisitBinary() protected method

protected VisitBinary ( BinaryExpression node ) : Expression
node System.Linq.Expressions.BinaryExpression
return System.Linq.Expressions.Expression

VisitConstant() protected method

protected VisitConstant ( ConstantExpression node ) : Expression
node System.Linq.Expressions.ConstantExpression
return System.Linq.Expressions.Expression

VisitMember() protected method

This is called only in criterias. It shouldn't be called when in generating columns
protected VisitMember ( MemberExpression node ) : Expression
node System.Linq.Expressions.MemberExpression
return System.Linq.Expressions.Expression

VisitMemberInit() protected method

protected VisitMemberInit ( MemberInitExpression node ) : Expression
node System.Linq.Expressions.MemberInitExpression
return System.Linq.Expressions.Expression

VisitMethodCall() protected method

protected VisitMethodCall ( MethodCallExpression node ) : Expression
node System.Linq.Expressions.MethodCallExpression
return System.Linq.Expressions.Expression

VisitNew() protected method

protected VisitNew ( NewExpression node ) : Expression
node System.Linq.Expressions.NewExpression
return System.Linq.Expressions.Expression

VisitUnary() protected method

protected VisitUnary ( UnaryExpression node ) : Expression
node System.Linq.Expressions.UnaryExpression
return System.Linq.Expressions.Expression