mirror of
https://gitee.com/dotnetchina/Furion.git
synced 2025-12-06 07:49:05 +08:00
😊 简化 HTTP 远程请求静态类 HttpRemoteClient 自定义配置
This commit is contained in:
@@ -92,7 +92,17 @@ public static class HttpRemoteClient
|
||||
ObjectDisposedException.ThrowIf(_isDisposed, typeof(HttpRemoteClient));
|
||||
|
||||
// 更新配置委托
|
||||
_configure = configure;
|
||||
_configure = services =>
|
||||
{
|
||||
// 调用自定义配置委托
|
||||
configure(services);
|
||||
|
||||
// 检查 HTTP 远程请求服务是否已注册,若未注册则自动完成注册
|
||||
if (services.All(u => u.ServiceType != typeof(IHttpRemoteService)))
|
||||
{
|
||||
services.AddHttpRemote();
|
||||
}
|
||||
};
|
||||
|
||||
// 重新初始化服务
|
||||
Reinitialize();
|
||||
|
||||
@@ -92,7 +92,17 @@ public static class HttpRemoteClient
|
||||
ObjectDisposedException.ThrowIf(_isDisposed, typeof(HttpRemoteClient));
|
||||
|
||||
// 更新配置委托
|
||||
_configure = configure;
|
||||
_configure = services =>
|
||||
{
|
||||
// 调用自定义配置委托
|
||||
configure(services);
|
||||
|
||||
// 检查 HTTP 远程请求服务是否已注册,若未注册则自动完成注册
|
||||
if (services.All(u => u.ServiceType != typeof(IHttpRemoteService)))
|
||||
{
|
||||
services.AddHttpRemote();
|
||||
}
|
||||
};
|
||||
|
||||
// 重新初始化服务
|
||||
Reinitialize();
|
||||
|
||||
Reference in New Issue
Block a user