public object SystemInfo() { IServiceProvider provider = HttpContext.RequestServices; dynamic info = new ExpandoObject(); IOsharpPackManager packManager = provider.GetService <IOsharpPackManager>(); info.Packs = packManager.SourcePacks.OrderBy(m => m.Level).ThenBy(m => m.Order).ThenBy(m => m.GetType().FullName).Select(m => new { m.GetType().Name, Class = m.GetType().FullName, Level = m.Level.ToString(), m.Order, m.IsEnabled }).ToList(); string cliVersion = AssemblyExtensions.GetCliVersion(); string osharpVersion = Assembly.GetExecutingAssembly().GetProductVersion(); info.Object = new { Message = "WebApi 数据服务已启动", CliVersion = cliVersion, OSharpVersion = osharpVersion }; return(info); }
/// <summary> /// Common框架初始化,适用于非AspNetCore环境 /// </summary> public static IServiceProvider UseOsharp(this IServiceProvider provider) { IOsharpPackManager packManager = provider.GetService <IOsharpPackManager>(); packManager.UsePack(provider); return(provider); }
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; IOsharpPackManager manager = provider.GetService <IOsharpPackManager>(); return(_cacheService.ToPageCache(manager.SourcePacks.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()); }
public HomeController(IOsharpPackManager packManager, IServiceProvider provider) { _packManager = packManager; _provider = provider; }