public virtual Expression ApplyContext(Expression expression, SqlExpressionContext expressionContext, IMappingResolutionContext mappingResolutionContext) { ArgumentUtility.CheckNotNull("expression", expression); ArgumentUtility.CheckNotNull("mappingResolutionContext", mappingResolutionContext); return(SqlContextExpressionVisitor.ApplySqlExpressionContext(expression, expressionContext, this, mappingResolutionContext)); }
public virtual SqlStatement ApplySelectionContext(SqlStatement sqlStatement, SqlExpressionContext expressionContext, IMappingResolutionContext mappingResolutionContext) { ArgumentUtility.CheckNotNull("sqlStatement", sqlStatement); ArgumentUtility.CheckNotNull("mappingResolutionContext", mappingResolutionContext); return(SqlContextSelectionAdjuster.ApplyContext(sqlStatement, expressionContext, this, mappingResolutionContext)); }
public virtual ITableInfo ApplyContext(ITableInfo tableInfo, SqlExpressionContext expressionContext, IMappingResolutionContext mappingResolutionContext) { ArgumentUtility.CheckNotNull("tableInfo", tableInfo); ArgumentUtility.CheckNotNull("mappingResolutionContext", mappingResolutionContext); return(SqlContextTableInfoVisitor.ApplyContext(tableInfo, expressionContext, this, mappingResolutionContext)); }
public virtual IJoinInfo ApplyContext(IJoinInfo joinInfo, SqlExpressionContext expressionContext, IMappingResolutionContext mappingResolutionContext) { ArgumentUtility.CheckNotNull("joinInfo", joinInfo); ArgumentUtility.CheckNotNull("mappingResolutionContext", mappingResolutionContext); return(SqlContextJoinInfoVisitor.ApplyContext(joinInfo, expressionContext, this, mappingResolutionContext)); }
public static IJoinInfo ApplyContext (IJoinInfo joinInfo, SqlExpressionContext expressionContext, IMappingResolutionStage stage, IMappingResolutionContext mappingResolutionContext) { ArgumentUtility.CheckNotNull ("joinInfo", joinInfo); ArgumentUtility.CheckNotNull ("stage", stage); var visitor = new SqlContextJoinInfoVisitor (stage, expressionContext, mappingResolutionContext); return joinInfo.Accept (visitor); }
protected SqlContextTableInfoVisitor (IMappingResolutionStage stage, SqlExpressionContext expressionContext, IMappingResolutionContext mappingResolutionContext) { ArgumentUtility.CheckNotNull ("stage", stage); ArgumentUtility.CheckNotNull ("mappingResolutionContext", mappingResolutionContext); _stage = stage; _expressionContext = expressionContext; _mappingResolutionContext = mappingResolutionContext; }
public static IJoinInfo ApplyContext(IJoinInfo joinInfo, SqlExpressionContext expressionContext, IMappingResolutionStage stage, IMappingResolutionContext mappingResolutionContext) { ArgumentUtility.CheckNotNull("joinInfo", joinInfo); ArgumentUtility.CheckNotNull("stage", stage); var visitor = new SqlContextJoinInfoVisitor(stage, expressionContext, mappingResolutionContext); return(joinInfo.Accept(visitor)); }
protected SqlContextExpressionVisitor (SqlExpressionContext currentContext, IMappingResolutionStage stage, IMappingResolutionContext context) { ArgumentUtility.CheckNotNull ("stage", stage); ArgumentUtility.CheckNotNull ("context", context); _currentContext = currentContext; _stage = stage; _context = context; }
protected SqlContextTableInfoVisitor(IMappingResolutionStage stage, SqlExpressionContext expressionContext, IMappingResolutionContext mappingResolutionContext) { ArgumentUtility.CheckNotNull("stage", stage); ArgumentUtility.CheckNotNull("mappingResolutionContext", mappingResolutionContext); _stage = stage; _expressionContext = expressionContext; _mappingResolutionContext = mappingResolutionContext; }
protected SqlContextExpressionVisitor(SqlExpressionContext currentContext, IMappingResolutionStage stage, IMappingResolutionContext context) { ArgumentUtility.CheckNotNull("stage", stage); ArgumentUtility.CheckNotNull("context", context); _currentContext = currentContext; _stage = stage; _context = context; }
public static SqlStatement ApplyContext (SqlStatement sqlStatement, SqlExpressionContext expressionContext, IMappingResolutionStage stage, IMappingResolutionContext mappingresolutionContext) { ArgumentUtility.CheckNotNull ("sqlStatement", sqlStatement); ArgumentUtility.CheckNotNull ("stage", stage); ArgumentUtility.CheckNotNull ("mappingresolutionContext", mappingresolutionContext); var visitor = new SqlContextSelectionAdjuster (stage, mappingresolutionContext); return visitor.VisitSqlStatement (sqlStatement, expressionContext); }
public static Expression ApplySqlExpressionContext ( Expression expression, SqlExpressionContext initialSemantics, IMappingResolutionStage stage, IMappingResolutionContext context) { ArgumentUtility.CheckNotNull ("expression", expression); ArgumentUtility.CheckNotNull ("stage", stage); ArgumentUtility.CheckNotNull ("context", context); var visitor = new SqlContextExpressionVisitor (initialSemantics, stage, context); return visitor.VisitExpression (expression); }
public static SqlStatement ApplyContext(SqlStatement sqlStatement, SqlExpressionContext expressionContext, IMappingResolutionStage stage, IMappingResolutionContext mappingresolutionContext) { ArgumentUtility.CheckNotNull("sqlStatement", sqlStatement); ArgumentUtility.CheckNotNull("stage", stage); ArgumentUtility.CheckNotNull("mappingresolutionContext", mappingresolutionContext); var visitor = new SqlContextSelectionAdjuster(stage, mappingresolutionContext); return(visitor.VisitSqlStatement(sqlStatement, expressionContext)); }
public SqlExpression(IDatabase database) { modelDef = PocoData.ForType(typeof(T), database.PocoDataFactory); _database = database; _databaseType = database.DatabaseType; PrefixFieldWithTableName = false; WhereStatementWithoutWhereString = false; paramPrefix = "@"; members = new List <string>(); Context = new SqlExpressionContext(this); }
public static Expression ApplySqlExpressionContext( Expression expression, SqlExpressionContext initialSemantics, IMappingResolutionStage stage, IMappingResolutionContext context) { ArgumentUtility.CheckNotNull("expression", expression); ArgumentUtility.CheckNotNull("stage", stage); ArgumentUtility.CheckNotNull("context", context); var visitor = new SqlContextExpressionVisitor(initialSemantics, stage, context); return(visitor.Visit(expression)); }
public SqlStatement VisitSqlStatement (SqlStatement sqlStatement, SqlExpressionContext expressionContext) { ArgumentUtility.CheckNotNull ("sqlStatement", sqlStatement); if (expressionContext == SqlExpressionContext.PredicateRequired) throw new InvalidOperationException ("A SqlStatement cannot be used as a predicate."); var statementBuilder = new SqlStatementBuilder (sqlStatement); var newSelectProjection = _stage.ApplyContext (sqlStatement.SelectProjection, expressionContext, _mappingResolutionContext); statementBuilder.SelectProjection = newSelectProjection; statementBuilder.RecalculateDataInfo (sqlStatement.SelectProjection); var newSqlStatement = statementBuilder.GetSqlStatement(); return newSqlStatement.Equals (sqlStatement) ? sqlStatement : newSqlStatement; }
public SqlStatement VisitSqlStatement(SqlStatement sqlStatement, SqlExpressionContext expressionContext) { ArgumentUtility.CheckNotNull("sqlStatement", sqlStatement); if (expressionContext == SqlExpressionContext.PredicateRequired) { throw new InvalidOperationException("A SqlStatement cannot be used as a predicate."); } var statementBuilder = new SqlStatementBuilder(sqlStatement); var newSelectProjection = _stage.ApplyContext(sqlStatement.SelectProjection, expressionContext, _mappingResolutionContext); statementBuilder.SelectProjection = newSelectProjection; statementBuilder.RecalculateDataInfo(sqlStatement.SelectProjection); var newSqlStatement = statementBuilder.GetSqlStatement(); return(newSqlStatement.Equals(sqlStatement) ? sqlStatement : newSqlStatement); }
private Expression ApplySqlExpressionContext(Expression expression, SqlExpressionContext expressionContext) { return(ApplySqlExpressionContext(expression, expressionContext, _stage, _context)); }
private Expression VisitChildrenWithGivenSemantics(Expression expression, SqlExpressionContext childContext) { var visitor = new SqlContextExpressionVisitor(childContext, _stage, _context); return(visitor.VisitExtension(expression)); }
public TestableSqlContextExpressionVisitor (SqlExpressionContext currentContext, IMappingResolutionStage stage, IMappingResolutionContext context) : base (currentContext, stage, context) { }
public virtual IJoinInfo ApplyContext (IJoinInfo joinInfo, SqlExpressionContext expressionContext, IMappingResolutionContext mappingResolutionContext) { ArgumentUtility.CheckNotNull ("joinInfo", joinInfo); ArgumentUtility.CheckNotNull ("mappingResolutionContext", mappingResolutionContext); return SqlContextJoinInfoVisitor.ApplyContext (joinInfo, expressionContext, this, mappingResolutionContext); }
private Expression VisitChildrenWithGivenSemantics (ExtensionExpression expression, SqlExpressionContext childContext) { var visitor = new SqlContextExpressionVisitor (childContext, _stage, _context); return visitor.VisitExtensionExpression (expression); }
public virtual ITableInfo ApplyContext (ITableInfo tableInfo, SqlExpressionContext expressionContext, IMappingResolutionContext mappingResolutionContext) { ArgumentUtility.CheckNotNull ("tableInfo", tableInfo); ArgumentUtility.CheckNotNull ("mappingResolutionContext", mappingResolutionContext); return SqlContextTableInfoVisitor.ApplyContext (tableInfo, expressionContext, this, mappingResolutionContext); }
public virtual Expression ApplyContext (Expression expression, SqlExpressionContext expressionContext, IMappingResolutionContext mappingResolutionContext) { ArgumentUtility.CheckNotNull ("expression", expression); ArgumentUtility.CheckNotNull ("mappingResolutionContext", mappingResolutionContext); return SqlContextExpressionVisitor.ApplySqlExpressionContext (expression, expressionContext, this, mappingResolutionContext); }
public virtual SqlStatement ApplySelectionContext (SqlStatement sqlStatement, SqlExpressionContext expressionContext, IMappingResolutionContext mappingResolutionContext) { ArgumentUtility.CheckNotNull ("sqlStatement", sqlStatement); ArgumentUtility.CheckNotNull ("mappingResolutionContext", mappingResolutionContext); return SqlContextSelectionAdjuster.ApplyContext (sqlStatement, expressionContext, this, mappingResolutionContext); }
public TestableSqlContextExpressionVisitor(SqlExpressionContext currentContext, IMappingResolutionStage stage, IMappingResolutionContext context) : base(currentContext, stage, context) { }
private Expression ApplySqlExpressionContext (Expression expression, SqlExpressionContext expressionContext) { return ApplySqlExpressionContext (expression, expressionContext, _stage, _context); }