public async Task <IActionResult> GetByDateRange([FromQuery] UserParams userParams, string startdate, string enddate) { var inspections = await _repo.GetInspectionM2s(userParams, startdate, enddate); var inspectionsToReturn = _mapper.Map <IEnumerable <InspectionForListDto> >(inspections); Response.AddPagination(inspections.CurrentPage, inspections.PageSize, inspections.TotalCount, inspections.TotalPages); return(Ok(inspectionsToReturn)); }