示例#1
0
        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);
        }
示例#2
0
        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);
        }
示例#3
0
        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));
        }
示例#4
0
        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));
        }
示例#5
0
        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));
        }
示例#6
0
        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));
        }
示例#7
0
        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));
        }
示例#8
0
        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));
        }
示例#9
0
        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());
        }