public async Task <PagedResultDto <HotelDto> > GetAll(PagedHotelResultRequestDto input) { var newPath = Path.Combine(_hostingEnvironment.WebRootPath, AppConsts.UploadPath); var fullPath = Path.Combine(newPath, input.FileId); var pagedResultDto = await _appService.GetAll(fullPath, input); return(pagedResultDto); }
public async Task <PagedResultDto <HotelDto> > GetAll(string filePath, PagedHotelResultRequestDto input) { //Simulate long running operation //await Task.Delay(TimeSpan.FromSeconds(1)); //Read Hotel Data From Csv Filter, Sort ,Group var result = ReadCsv(filePath).AsQueryable(); var totalRowCount = result.Count(); result = ApplySorting(result, input); result = ApplyPaging(result, input); return(new PagedResultDto <HotelDto>() { Items = result.ToList(), TotalCount = totalRowCount }); }