Exemple #1
0
        public async Task <IResultModel> Query(ResourceQueryModel model)
        {
            var result = new QueryResultModel <ResourceEntity>
            {
                Rows  = await _resourceRepository.Query(model),
                Total = model.TotalCount
            };

            return(ResultModel.Success(result));
        }
        public async Task <IList <ResourceEntity> > Query(ResourceQueryModel model)
        {
            var conditions = await _filter.GetConditions <ResourceEntity, ResourceQueryModel>(model);

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

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

            model.TotalCount = totalCount;

            return(data);
        }
 public Task <IResultModel> Query([FromQuery] ResourceQueryModel model)
 {
     return(_service.Query(model));
 }