public PageData <FunctionOutputDto> Read(PageRequest request) { IFunction function = this.GetExecuteFunction(); request.AddDefaultSortCondition( new SortCondition("Area"), new SortCondition("Controller"), new SortCondition("IsController", ListSortDirection.Descending)); Expression <Func <Function, bool> > predicate = _filterService.GetExpression <Function>(request.FilterGroup); PageResult <FunctionOutputDto> page = _cacheService.ToPageCache <Function, FunctionOutputDto>(_securityManager.Functions, predicate, request.PageCondition, function); return(page.ToPageData()); }
public PageData <AuditEntityOutputDto> Read(PageRequest request) { Expression <Func <AuditEntity, bool> > predicate = _filterService.GetExpression <AuditEntity>(request.FilterGroup); PageResult <AuditEntityOutputDto> page; //有操作参数,是从操作列表来的 if (request.FilterGroup.Rules.Any(m => m.Field == "OperationId")) { page = _auditContract.AuditEntities.ToPage(predicate, request.PageCondition, m => new AuditEntityOutputDto { Id = m.Id, Name = m.Name, TypeName = m.TypeName, EntityKey = m.EntityKey, OperateType = m.OperateType, Properties = _auditContract.AuditProperties.Where(n => n.AuditEntityId == m.Id).OrderBy(n => n.FieldName != "Id").ThenBy(n => n.FieldName).Select(n => new AuditPropertyOutputDto() { DisplayName = n.DisplayName, FieldName = n.FieldName, OriginalValue = n.OriginalValue, NewValue = n.NewValue, DataType = n.DataType }).ToList() }); return(page.ToPageData()); } request.AddDefaultSortCondition(new SortCondition("Operation.CreatedTime", ListSortDirection.Descending)); page = _auditContract.AuditEntities.ToPage(predicate, request.PageCondition, m => new AuditEntityOutputDto { Id = m.Id, Name = m.Name, TypeName = m.TypeName, EntityKey = m.EntityKey, OperateType = m.OperateType, NickName = m.Operation.NickName, FunctionName = m.Operation.FunctionName, CreatedTime = m.Operation.CreatedTime, Properties = _auditContract.AuditProperties.Where(n => n.AuditEntityId == m.Id).OrderBy(n => n.FieldName != "Id").ThenBy(n => n.FieldName).Select(n => new AuditPropertyOutputDto() { DisplayName = n.DisplayName, FieldName = n.FieldName, OriginalValue = n.OriginalValue, NewValue = n.NewValue, DataType = n.DataType }).ToList() }); return(page.ToPageData()); }
public PageData <PackOutputDto> Read(PageRequest request) { request.AddDefaultSortCondition( new SortCondition("Level"), new SortCondition("Order") ); IFunction function = this.GetExecuteFunction(); Expression <Func <OsharpPack, bool> > exp = _filterService.GetExpression <OsharpPack>(request.FilterGroup); IServiceProvider provider = HttpContext.RequestServices; return(_cacheService.ToPageCache(provider.GetAllPacks().AsQueryable(), exp, request.PageCondition, m => new PackOutputDto() { Name = m.GetType().Name, Display = m.GetType().GetDescription(false), Class = m.GetType().FullName, Level = m.Level, Order = m.Order, IsEnabled = m.IsEnabled }, function).ToPageData()); }