public async Task <PagedList <Transaction_Main_Dto> > FilterMissingPrint(PaginationParams param, FilterMissingParam filterParam) { var lists = _repoTransactionMain.GetAll() .ProjectTo <Transaction_Main_Dto>(_configMapper) .Where(x => x.Missing_No != string.Empty && x.Transac_Type.Trim() == "I"); if (filterParam.MO_No != null && filterParam.MO_No != "") { lists = lists.Where(x => x.MO_No.Trim() == filterParam.MO_No.Trim()); } if (filterParam.Material_ID != null && filterParam.Material_ID != "") { lists = lists.Where(x => x.Material_ID.Trim() == filterParam.Material_ID.Trim()); } lists = lists.Distinct().OrderByDescending(x => x.Updated_Time); return(await PagedList <Transaction_Main_Dto> .CreateAsync(lists, param.PageNumber, param.PageSize)); }
public async Task <IActionResult> FilterMissingPrint([FromQuery] PaginationParams param, FilterMissingParam filterParam) { var data = await _service.FilterMissingPrint(param, filterParam); Response.AddPagination(data.CurrentPage, data.PageSize, data.TotalCount, data.TotalPages); return(Ok(data)); }