public PagedResultDto <CapPhatDto> GetCapPhats(CapPhatFilter input) { var query = capPhatrepository.GetAll().Where(x => !x.IsDelete); // filter by value if (input.TenDonVi != null) { query = query.Where(x => x.TenDonVi.ToLower().Equals(input.TenDonVi)); } var totalCount = query.Count(); // sorting if (!string.IsNullOrWhiteSpace(input.Sorting)) { query = query.OrderBy(input.Sorting); } // paging var items = query.PageBy(input).ToList(); // result return(new PagedResultDto <CapPhatDto>( totalCount, items.Select(item => ObjectMapper.Map <CapPhatDto>(item)).ToList())); }
public PagedResultDto <CapPhatDto> GetCapPhatsByFilter(CapPhatFilter CapPhatFilter) { return(capPhatAppservice.GetCapPhats(CapPhatFilter)); }