public async Task <IList <GetAllWarehouseDto> > GetAll(string filter, int pageId) { var GoodCount = await _repository.CountGoodByFilter(filter); int take = 2; int totalPageCount = (int)Math.Ceiling((double)GoodCount / take); if (totalPageCount < pageId) { pageId = 1; } int skip = (pageId - 1) * take; return(await _repository.GetAll(filter, skip, take)); }