C# Class SqlFu.Builders.Expressions.ExpressionSqlGenerator

Inheritance: System.Linq.Expressions.ExpressionVisitor, IGenerateSqlFromExpressions
Afficher le fichier Open project: sapiens/SqlFu

Méthodes publiques

Méthode 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

Méthodes protégées

Méthode 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

Méthode 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 méthode

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

GetColumnsSql() public méthode

Only to generate "select columns"
public GetColumnsSql ( ) : string
Résultat string

GetSql() public méthode

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

ToString() public méthode

public ToString ( ) : string
Résultat string

VisitBinary() protected méthode

protected VisitBinary ( BinaryExpression node ) : Expression
node System.Linq.Expressions.BinaryExpression
Résultat System.Linq.Expressions.Expression

VisitConstant() protected méthode

protected VisitConstant ( ConstantExpression node ) : Expression
node System.Linq.Expressions.ConstantExpression
Résultat System.Linq.Expressions.Expression

VisitMember() protected méthode

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
Résultat System.Linq.Expressions.Expression

VisitMemberInit() protected méthode

protected VisitMemberInit ( MemberInitExpression node ) : Expression
node System.Linq.Expressions.MemberInitExpression
Résultat System.Linq.Expressions.Expression

VisitMethodCall() protected méthode

protected VisitMethodCall ( MethodCallExpression node ) : Expression
node System.Linq.Expressions.MethodCallExpression
Résultat System.Linq.Expressions.Expression

VisitNew() protected méthode

protected VisitNew ( NewExpression node ) : Expression
node System.Linq.Expressions.NewExpression
Résultat System.Linq.Expressions.Expression

VisitUnary() protected méthode

protected VisitUnary ( UnaryExpression node ) : Expression
node System.Linq.Expressions.UnaryExpression
Résultat System.Linq.Expressions.Expression