/// <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; }
/// <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); }