Files
KJD/Store.Framework/Configs/ServiceConfigRegistrationExtensions.cs
T
2026-09-11 19:11:12 +08:00

41 lines
1.4 KiB
C#

//using Autofac;
//using System;
//namespace Store.Client
//{
// /// <summary>
// /// IServerConfig 的 Keyed DI 注册扩展。
// /// </summary>
// public static class ServiceConfigRegistrationExtensions
// {
// /// <summary>
// /// 注册指定 Key 的服务配置。
// /// </summary>
// 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<IServerConfig>(key);
// return builder;
// }
// /// <summary>
// /// 注册指定 Key 的服务配置。
// /// </summary>
// public static ContainerBuilder RegisterServiceConfig(this ContainerBuilder builder, string key, string host, string objUrl)
// {
// return builder.RegisterServiceConfig(key, new ServiceConfig(host, objUrl));
// }
// }
//}