コード例 #1
0
        /// <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);
        }
コード例 #2
0
        /// <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);
        }
コード例 #3
0
        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));
        }
コード例 #4
0
 /// <summary>
 ///
 /// </summary>
 public AppHost(IConfiguration config)
     : this(RpcConfigHelper.GetConfig(config))
 {
 }