public async Task <TableDataModel> LoadDataAsync(TaskInfoRequestModel model)
        {
            string conditions = "";

            if (!model.Key.IsNullOrWhiteSpace())
            {
                conditions += $"where Name like '%@Key%'";
            }

            return(new TableDataModel
            {
                count = await _repository.RecordCountAsync(conditions),
                data = await _repository.GetListPagedAsync(model.Page, model.Limit, conditions, "Id desc", new
                {
                    Key = model.Key,
                }),
            });
        }
示例#2
0
 public async Task <string> LoadData([FromQuery] TaskInfoRequestModel model)
 {
     return(JsonHelper.ObjectToJSON(await _service.LoadDataAsync(model)));
 }