Пример #1
0
        /// <summary>
        /// get RpcLiteConfig from IConfiguration
        /// </summary>
        /// <param name="config"></param>
        /// <returns></returns>
        public static RpcConfig GetConfig(IConfiguration config)
        {
            var version = GetVersion(config);

            IRpcConfigParser parser;
            if (version <= new Version(1, 0))
            {
                parser = new RpcConfigParserV1();
            }
            //else if (version == new Version(1, 1))
            //{
            //	parser = new RpcLiteParserV11();
            //}
            else
            {
                parser = new RpcConfigParserV11();
            }

            var instance = parser.GetConfig(config);
            return instance;
        }
Пример #2
0
        /// <summary>
        /// get RpcLiteConfig from IConfiguration
        /// </summary>
        /// <param name="config"></param>
        /// <returns></returns>
        public static RpcConfig GetConfig(IConfiguration config)
        {
            var version = GetVersion(config);

            IRpcConfigParser parser;

            if (version <= new Version(1, 0))
            {
                parser = new RpcConfigParserV1();
            }
            //else if (version == new Version(1, 1))
            //{
            //	parser = new RpcLiteParserV11();
            //}
            else
            {
                parser = new RpcConfigParserV11();
            }

            var instance = parser.GetConfig(config);

            return(instance);
        }