public async Task <IResultModel> Query(OnlineModuleQueryModel model)
        {
            var result = new QueryResultModel <OnlineModuleEntity>
            {
                Rows  = await _repository.Query(model),
                Total = model.TotalCount
            };

            return(ResultModel.Success(result));
        }
        public async Task <IList <OnlineModuleEntity> > Query(OnlineModuleQueryModel model)
        {
            var paging = model.Paging();

            var query = Db.Find();

            if (!paging.OrderBy.Any())
            {
                query.OrderByDescending(m => m.Id);
            }

            var result = await query.PaginationAsync(paging);

            model.TotalCount = paging.TotalCount;

            return(result);
        }
Beispiel #3
0
 public Task <IResultModel> Query([FromQuery] OnlineModuleQueryModel model)
 {
     return(_service.Query(model));
 }