public async Task <IResultModel> Query(ResourceFilterQueryModel model) { var result = new QueryResultModel <ResourceFilterEntity> { Rows = await _repository.Query(model), Total = model.TotalCount }; return(ResultModel.Success(result)); }
public async Task <IList <ResourceFilterEntity> > Query(ResourceFilterQueryModel model) { var conditions = await _filter.GetConditions <ResourceFilterEntity, ResourceFilterQueryModel>(model); var query = _dbContext.Db.Queryable <ResourceFilterEntity>() .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] ResourceFilterQueryModel model) { return(_service.Query(model)); }