Example #1
0
            private async Task <PaginatedList <GroupAdministratorDto> > ReadFromCache(ListQuery query)
            {
                var cache = await _cache.GetAsync <PaginatedList <GroupAdministratorDto> >();

                cache.Restore(query.PageNumber, query.PageSize);

                return(cache);
            }
Example #2
0
            private async Task <PaginatedList <GroupAdministratorDto> > ReadFromDatabase(ListQuery query)
            {
                var administrators = await _context.GroupAdministrators
                                     .ProjectTo <GroupAdministratorDto>(_mapper.ConfigurationProvider)
                                     .PaginatedListAsync(query.PageNumber, query.PageSize);

                await _cache.CreateAsync(administrators);

                return(administrators);
            }