public AggregateSelector GetSelector() { var selecor = new AggregateSelector(); foreach (var item in _aggregateDict.Values) { selecor.SetSelectField(item); } return(selecor); }
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 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); }