예제 #1
0
 public Task <Responses.PagedResponse <JumperResponseModel> > GetJumpers(GetJumpersRequestModel model)
 {
     return(_jumperService.GetPagedJumpers(model));
 }
예제 #2
0
        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));
        }