public AggregateLambdaState(ParameterExpression parameter, AggregateModel model) { aggregateModel = model; aggregateName = parameter.Name; aggregateType = parameter.Type; MainMapping = model.EntityMapping; }
public AggregateJoinModel(AggregateModel model, string aliasTableName, JoinConnect connect, QueryExpression query, QueryExpression having, OrderExpression order, JoinSetting setting) { this._model = model; this._connect = connect; this._query = query; this._having = having; this._order = order; this._aliasTableName = aliasTableName; this._joinMapping = model.OutputMapping; if ((setting & JoinSetting.NoDataSetEntityNull) == JoinSetting.NoDataSetEntityNull) { _noDataSetEntityNull = true; } }
public AggregateJoinModel(AggregateModel model, string aliasTableName, JoinConnect connect, QueryExpression query, QueryExpression having, OrderExpression order, JoinSetting setting) { Model = model; Connect = connect; Query = query; Having = having; Order = order; AliasTableName = aliasTableName; JoinMapping = model.OutputDataMapping; if ((setting & JoinSetting.NoDataSetEntityNull) == JoinSetting.NoDataSetEntityNull) { NoDataSetEntityNull = true; } }
public async override Task <K> AggregateFieldAsync <K>(Expression <Func <T, K> > expression, CancellationToken cancellationToken = default(CancellationToken)) { AggregateModel model = LambdaExpressionExtend.CreateAggregateModel(expression); model.OnlyAggregate = true; Region region = new Region(0, 1); QueryCommand queryCommand = _context.Database.QueryDynamicAggregate(_context, model, _query, null, _order, region); K target = await _context.QueryDataDefineSingleAsync <K>(model.OutputMapping, _level, queryCommand.Command, queryCommand.InnerPage? 0 : region.Start, queryCommand.State, null, cancellationToken); if (target == null) { object obj = model.OutputMapping.InitialData(); target = (K)obj; } return(target); }
public override K AggregateField <K>(Expression <Func <T, K> > expression) { AggregateModel model = LambdaExpressionExtend.CreateAggregateModel(expression); model.OnlyAggregate = true; Region region = new Region(0, 1); //target = _context.QueryDynamicAggregateSingle<K>(model, _query, null, _order, region, _level, null); QueryCommand queryCommand = _context.Database.QueryDynamicAggregate(_context, model, _query, null, _order, region); K target = _context.QueryDataDefineSingle <K>(model.OutputMapping, _level, queryCommand.Command, queryCommand.InnerPage ? 0 : region.Start, queryCommand.State, null); if (target == null) { object obj = model.OutputMapping.InitialData(); target = (K)obj; } return(target); }
public virtual QueryCommand QueryDynamicAggregate(DataContext context, AggregateModel model, QueryExpression query, QueryExpression having, OrderExpression order, Region region) { CreateSqlState state = new CreateSqlState(context); AggregateSelector selector = model.GetSelector(); AggregateGroupBy groupBy = model.GetGroupBy(); CommandData commandData = _factory.CreateAggregateTableCommand(model.EntityMapping, selector, groupBy, query, having, order, region, state); DbCommand command = commandData.CreateCommand(this, state); QueryState queryState = new QueryState(); queryState.SetSelector(selector); QueryCommand queryCommand = new QueryCommand() { Command = command, InnerPage = commandData.InnerPage, State = queryState }; return(queryCommand); }
public virtual QueryCommand SelectInsertWithAggregate(DataContext context, InsertSelector selector, AggregateModel model, QueryExpression query, QueryExpression having, OrderExpression order) { CreateSqlState state = new CreateSqlState(context); AggregateSelector aselector = model.GetSelector(); AggregateGroupBy groupBy = model.GetGroupBy(); CommandData commandData = _factory.CreateSelectInsertCommand(selector, model.EntityMapping, aselector, groupBy, query, having, order, state); DbCommand command = commandData.CreateCommand(this, state); QueryCommand queryCommand = new QueryCommand() { Command = command }; return(queryCommand); }
public AggregateMap(AggregateModel model) { _model = model; }
public AggregateMap(AggregateModel model) { this._model = model; }