public virtual QueryCommand QueryEntityData(DataContext context, DataEntityMapping mapping, ISelector selector, QueryExpression query, OrderExpression order, bool distinct, Region region) { RelationMap relationMap = mapping.GetRelationMap(); if (selector == null) { selector = relationMap.GetDefaultSelector(); } CreateSqlState state = new CreateSqlState(context); CommandData commandData = _factory.CreateSelectDataCommand(mapping, relationMap, selector, query, order, distinct, region, state); DbCommand command = commandData.CreateCommand(this, state); QueryState queryState = new QueryState(); queryState.SetRelationMap(relationMap); queryState.SetSelector(selector); QueryCommand queryCommand = new QueryCommand() { Command = command, InnerPage = commandData.InnerPage, State = queryState }; return(queryCommand); }
public virtual QueryCommand QueryJoinData(DataContext context, DataMapping mapping, ISelector selector, List <IJoinModel> models, QueryExpression query, OrderExpression order, bool distinct, Region region) { CreateSqlState state = new CreateSqlState(context); CommandData commandData = _factory.CreateSelectJoinTableCommand(selector, models, query, order, distinct, region, state); DbCommand command = commandData.CreateCommand(this, state); QueryState queryState = new QueryState(); foreach (IJoinModel model in models) { if (model.NoDataSetEntityNull) { queryState.SetNoDataSetNull(model.AliasTableName); } } queryState.SetSelector(selector); QueryCommand queryCommand = new QueryCommand() { Command = command, InnerPage = commandData.InnerPage, State = queryState }; return(queryCommand); }
public override List <K> ToList() { QueryCommand queryCommand = _context.Database.QueryJoinData(_context, Mapping, Selector, Models, _query, _order, _distinct, _region); return(_context.QueryDataDefineList <K>(Mapping, _level, queryCommand.Command, queryCommand.InnerPage ? null : _region, queryCommand.State, Dele)); }
public async override Task <List <K> > ToListAsync(CancellationToken cancellationToken = default(CancellationToken)) { QueryCommand queryCommand = _context.Database.QueryJoinData(_context, Mapping, Selector, Models, _query, _order, _distinct, _region); return(await _context.QueryDataDefineListAsync <K>(Mapping, _level, queryCommand.Command, queryCommand.InnerPage?null : _region, queryCommand.State, Dele, cancellationToken)); }
public async override Task <List <K> > ToListAsync(CancellationToken cancellationToken = default(CancellationToken)) { QueryCommand queryCommand = _context.Database.QueryDynamicAggregate(_context, Model, _query, _having, _order, _region); return(await _context.QueryDataDefineListAsync <K>(Model.OutputMapping, _level, queryCommand.Command, queryCommand.InnerPage?null : _region, queryCommand.State, null, cancellationToken)); }
public override List <K> ToList() { QueryCommand queryCommand = _context.Database.QueryDynamicAggregate(_context, Model, _query, _having, _order, _region); return(_context.QueryDataDefineList <K>(Model.OutputMapping, _level, queryCommand.Command, queryCommand.InnerPage ? null : _region, queryCommand.State, null)); }
public async override Task <List <T> > ToListAsync(CancellationToken cancellationToken = default(CancellationToken)) { QueryCommand queryCommand = _context.Database.QueryEntityData(_context, Mapping, null, _query, _order, false, _region); return(await _context.QueryDataDefineListAsync <T>(Mapping, _level, queryCommand.Command, queryCommand.InnerPage?null : _region, queryCommand.State, null, cancellationToken)); }
public override List <T> ToList() { QueryCommand queryCommand = _context.Database.QueryEntityData(_context, Mapping, null, _query, _order, false, _region); return(_context.QueryDataDefineList <T>(Mapping, _level, queryCommand.Command, queryCommand.InnerPage ? null : _region, queryCommand.State, null)); }
public override IEnumerator <T> GetEnumerator() { QueryCommand queryCommand = _context.Database.QueryEntityData(_context, Mapping, null, _query, _order, false, _region); return(_context.QueryDataDefineReader <T>(Mapping, _level, queryCommand.Command, queryCommand.InnerPage ? null : _region, queryCommand.State, null).GetEnumerator()); }