/// <summary> /// default initialize from rpclite.config.json /// </summary> /// <param name="routers">used to UseMiddleware, keep null if not need set</param> public static void Initialize(IRouteBuilder routers) { var config = RpcInitializer.GetConfiguration(null); var rpcConfig = RpcConfigHelper.GetConfig(new CoreConfigurationSection(config)); Initialize(routers, rpcConfig); }
/// <summary> /// <para>initialize with default config file "rpclite.config.json" in specific basePath</para> /// </summary> /// <param name="app">used to UseMiddleware, keep null if not need set</param> /// <param name="basePath">base path to search config file rpclite.config.json</param> public static void Initialize(IApplicationBuilder app, string basePath) { var config = RpcInitializer.GetConfiguration(basePath); var rpcConfig = RpcConfigHelper.GetConfig(new CoreConfigurationSection(config)); Initialize(app, rpcConfig); }
private static void ConfigReadTest() { var configBuilder = new ConfigurationBuilder(); //if (!string.IsNullOrWhiteSpace(basePath)) // configBuilder.SetBasePath(basePath); configBuilder .AddJsonFile("rpclite.config.json"); var config = configBuilder.Build(); var rpcConfig = RpcConfigHelper.GetConfig(new CoreConfigurationSection(config)); }
/// <summary> /// /// </summary> public AppHost(IConfiguration config) : this(RpcConfigHelper.GetConfig(config)) { }