Example #1
0
        public async override Task <List <K> > ToListAsync(CancellationToken cancellationToken = default(CancellationToken))
        {
            QueryCommand queryCommand = _context.Database.QuerySingleField(_context, SpecifiedFieldInfo, _query, _order, false, _region);
            DataDefine   define       = DataDefine.GetDefine(typeof(K));

            return(await _context.QueryDataDefineListAsync <K>(define, _level, queryCommand.Command, queryCommand.InnerPage?null : _region, null, null, cancellationToken));
        }
Example #2
0
        public override List <K> ToList()
        {
            QueryCommand queryCommand = _context.Database.QuerySingleField(_context, SpecifiedFieldInfo, _query, _order, false, _region);
            DataDefine   define       = DataDefine.GetDefine(typeof(K));

            return(_context.QueryDataDefineList <K>(define, _level, queryCommand.Command, queryCommand.InnerPage ? null : _region, null, null));
        }
        public override IEnumerator <K> GetEnumerator()
        {
            var queryCommand = _context.Database.QuerySingleField(_context, SpecifiedFieldInfo, _query, _order, false, _region);
            var define       = DataDefine.GetDefine(typeof(K));

            return(_context.QueryDataDefineReader <K>(define, _level, queryCommand.Command, queryCommand.InnerPage ? null : _region, null, null).GetEnumerator());
        }
Example #4
0
        public override K ElementAt(int index)
        {
            Region       region       = new Region(index, 1);
            QueryCommand queryCommand = _context.Database.QuerySingleField(_context, SpecifiedFieldInfo, _query, _order, false, region);
            DataDefine   define       = DataDefine.GetDefine(typeof(K));

            return(_context.QueryDataDefineSingle <K>(define, _level, queryCommand.Command, queryCommand.InnerPage ? 0 : region.Start, null, null));
        }
Example #5
0
        public async override Task <K> ElementAtAsync(int index, CancellationToken cancellationToken = default(CancellationToken))
        {
            Region       region       = new Region(index, 1);
            QueryCommand queryCommand = _context.Database.QuerySingleField(_context, SpecifiedFieldInfo, _query, _order, false, region);
            DataDefine   define       = DataDefine.GetDefine(typeof(K));

            return(await _context.QueryDataDefineSingleAsync <K>(define, _level, queryCommand.Command, queryCommand.InnerPage? 0 : region.Start, null, null, cancellationToken));
        }
Example #6
0
        public override async Task <bool> ExistsAsync(CancellationToken cancellationToken = default)
        {
            var queryCommand = _context.Database.Exists(_context, _mapping, _query);
            var define       = DataDefine.GetDefine(typeof(int?));
            var obj          = await _context.QueryDataDefineSingleAsync <int?>(define, _level, queryCommand.Command, 0, null, null, cancellationToken);

            return(obj.HasValue);
        }
Example #7
0
        public override bool Exists()
        {
            var queryCommand = _context.Database.Exists(_context, _mapping, _query);
            var define       = DataDefine.GetDefine(typeof(int?));
            var obj          = _context.QueryDataDefineSingle <int?>(define, _level, queryCommand.Command, 0, null, null);

            return(obj.HasValue);
        }
Example #8
0
 private SoloFieldDataMapping(Type type)
     : base(type)
 {
     dataDefine = DataDefine.GetDefine(type);
 }