Exemple #1
0
        public async Task <IEnumerable <TApplication> > FindAsync(CancellationToken cancellationToken)
        {
            cancellationToken.ThrowIfCancellationRequested();

            var search = _context.FromScanAsync <TApplication>(new ScanOperationConfig
            {
            });

            return(await search.GetRemainingAsync(cancellationToken));
        }
Exemple #2
0
 public Task <IEnumerable <Item> > GetAllItems()
 {
     return(_context.FromScanAsync <Item>(new ScanOperationConfig(), Cfg())
            .GetRemainingAsync()
            .ContinueWith(x =>
     {
         return (IEnumerable <Item>)x.Result.OrderBy(y => y.Id);
     }));
     //yes scan and return all items
 }
        public async Task <IEnumerable <Expense> > GetExpenses()
        {
            ScanFilter scanFilter = new ScanFilter();

            scanFilter.AddCondition("Id", ScanOperator.NotEqual, 0);

            ScanOperationConfig soc = new ScanOperationConfig()
            {
                Filter = scanFilter
            };
            AsyncSearch <Expense> search       = context.FromScanAsync <Expense>(soc, null);
            List <Expense>        documentList = new List <Expense>();

            do
            {
                documentList = await search.GetNextSetAsync(default(System.Threading.CancellationToken));
            } while (!search.IsDone);

            return(documentList);
        }