Ejemplo n.º 1
0
        public async IAsyncEnumerable <Visit> GetVisitsOfRediretableBetween(string redirectableKey, DateTime @from, DateTime to)
        {
            var storage = _storageFactory.CreateStorage <VisitEntity>();
            var result  = storage.QueryAsync(StorageFilter.And(
                                                 StorageFilter.Equals <VisitEntity>(x => x.Key, redirectableKey),
                                                 StorageFilter.LessThan <VisitEntity>(x => x.Created, to),
                                                 StorageFilter.GreaterThan <VisitEntity>(x => x.Created, from)));

            await foreach (var item in result)
            {
                yield return(_mapper.Map <Visit>(item));
            }
        }