コード例 #1
0
        public async Task <IResultModel> Query(TagQueryModel model)
        {
            var result = new QueryResultModel <TagEntity>
            {
                Rows  = await _repository.Query(model),
                Total = model.TotalCount
            };

            return(ResultModel.Success(result));
        }
コード例 #2
0
        public async Task <IList <TagEntity> > Query(TagQueryModel 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);
        }
コード例 #3
0
        public async Task <IList <TagEntity> > Query(TagQueryModel model)
        {
            var paging = model.Paging();

            var query = Db.Find();

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

            var result = await query.LeftJoin <AccountEntity>((x, y) => x.CreatedBy == y.Id)
                         .Select((x, y) => new { x, Creator = y.Name })
                         .PaginationAsync(paging);

            model.TotalCount = paging.TotalCount;

            return(result);
        }
コード例 #4
0
ファイル: TagController.cs プロジェクト: zhangbo27/NetModular
 public Task<IResultModel> Query([FromQuery] TagQueryModel model)
 {
     return _service.Query(model);
 }