public async Task <PagingResult <TItem> > Get <TItem>(int pageNumber, int pageSize) { Logger.LogDebug($"{nameof(DinosaursService)}.{nameof(Get)}({pageNumber}, {pageSize})"); int offset = (pageNumber - 1) * pageSize; int count = await _dinosaursRepository.DinosaursCount(); var items = await _dinosaursRepository.GetAll(pageSize, offset); var mappedItems = Mapper.Map <IEnumerable <TItem> >(items); return(new PagingResult <TItem>(mappedItems, pageNumber, pageSize, count)); }
public IEnumerable <Dino> GetDinos([Service] IDinoRepository repo) { return(repo.GetAll()); }