예제 #1
0
        public async Task <IResultModel> Query(ModulesQueryModel model)
        {
            var result = new QueryResultModel <ModulesEntity>
            {
                Rows  = await _repository.Query(model),
                Total = model.TotalCount
            };

            return(ResultModel.Success(result));
        }
예제 #2
0
        public async Task <IList <ModulesEntity> > Query(ModulesQueryModel model)
        {
            var conditions = await _filter.GetConditions <ModulesEntity, ModulesQueryModel>(model);

            var query = _dbContext.Db.Queryable <ModulesEntity>()
                        .Where(conditions)
                        .OrderBy(model.OrderFileds);

            RefAsync <int> totalCount = 0;
            var            data       = await query.ToPageListAsync(model.PageIndex, model.PageSize, totalCount);

            model.TotalCount = totalCount;

            return(data);
        }
예제 #3
0
 public Task <IResultModel> Query([FromQuery] ModulesQueryModel model)
 {
     return(_service.Query(model));
 }