public BaseDataProvider <Task> ListTask(TaskSearchRequest search, TaskPaginationRequest request) { IQueryable <Task> query = this._context.Tasks; if (search.DataFrom != null && search.DataTo != null) { query = query.Where(t => t.DateFoTask >= search.DataFrom && t.DateFoTask <= search.DataTo); } //if (search.DataFrom != null) //{ // query = query.Where(t => t.DateFoTask >= search.DataFrom); //} if (search.Title != null) { query = query.Where(t => EF.Functions.Like(t.Title, "%" + search.Title + "%")); } return(new BaseDataProvider <Task>(query, request)); }
public ActionResult GetTasks([FromQuery] TaskSearchRequest request, [FromQuery] TaskPaginationRequest paginator) { return(this.Ok(this._eFRepository.ListTask(request, paginator))); }