//using Autofac; //using System; //namespace Store.Client //{ // /// // /// IServerConfig 的 Keyed DI 注册扩展。 // /// // public static class ServiceConfigRegistrationExtensions // { // /// // /// 注册指定 Key 的服务配置。 // /// // public static ContainerBuilder RegisterServiceConfig(this ContainerBuilder builder, string key, IServerConfig config) // { // if (builder == null) // { // throw new ArgumentNullException(nameof(builder)); // } // if (string.IsNullOrWhiteSpace(key)) // { // throw new ArgumentException("服务配置 Key 不能为空。", nameof(key)); // } // if (config == null) // { // throw new ArgumentNullException(nameof(config)); // } // builder.RegisterInstance(config).Keyed(key); // return builder; // } // /// // /// 注册指定 Key 的服务配置。 // /// // public static ContainerBuilder RegisterServiceConfig(this ContainerBuilder builder, string key, string host, string objUrl) // { // return builder.RegisterServiceConfig(key, new ServiceConfig(host, objUrl)); // } // } //}