public Task <Responses.PagedResponse <JumperResponseModel> > GetJumpers(GetJumpersRequestModel model) { return(_jumperService.GetPagedJumpers(model)); }
public async Task <Responses.PagedResponse <JumperResponseModel> > GetPagedJumpers(GetJumpersRequestModel model) { var(data, count) = await _database.JumperQuery() .Where("j.name ILIKE @Query", new { Query = $"%{model.Q}%" }, onlyIf: !string.IsNullOrWhiteSpace(model.Q)) .OrderBy(model.Sort) .PageAndCountAsync(model.Page, model.PageSize); return(new Responses.PagedResponse <JumperResponseModel>(data, model.Page, model.PageSize, count)); }