Пример #1
0
        public async Task <IResultModel> Query(ButtonQueryModel model)
        {
            var result = new QueryResultModel <Button>();
            var paging = model.Paging();

            result.Rows = await _buttonRepository.Query(paging, model.MenuId, model.Name);

            result.Total = paging.TotalCount;

            return(ResultModel.Success(result));
        }
Пример #2
0
        public async Task <IList <ButtonEntity> > Query(ButtonQueryModel model)
        {
            var paging = model.Paging();

            var query = Db.Find(m => m.MenuCode == model.MenuCode)
                        .WhereNotNull(model.Name, m => m.Name.Contains(model.Name));

            var list = 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(list);
        }