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