public async Task <IResultModel> Query(ModulesQueryModel model) { var result = new QueryResultModel <ModulesEntity> { Rows = await _repository.Query(model), Total = model.TotalCount }; return(ResultModel.Success(result)); }
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); }
public Task <IResultModel> Query([FromQuery] ModulesQueryModel model) { return(_service.Query(model)); }