更新Linux截图

HttpClient 统一到 HttpClientFactory
This commit is contained in:
Aigio Liu
2021-02-23 12:05:22 +08:00
parent a0226c8d3a
commit a85f977ccf
24 changed files with 349 additions and 107 deletions
@@ -1,6 +1,7 @@
using Microsoft.Extensions.DependencyInjection.Extensions;
using System.Application.Services;
using System.Application.Services.Implementation;
using System.Net.Http;
// ReSharper disable once CheckNamespace
namespace Microsoft.Extensions.DependencyInjection
@@ -17,5 +18,24 @@ namespace Microsoft.Extensions.DependencyInjection
services.TryAddSingleton<IModelValidator, ModelValidator>();
return services;
}
/// <summary>
/// 尝试添加 <see cref="IHttpPlatformHelper"/>
/// </summary>
/// <param name="services"></param>
/// <returns></returns>
public static IServiceCollection TryAddHttpPlatformHelper(this IServiceCollection services)
{
services.TryAddSingleton<IHttpPlatformHelper, HttpPlatformHelper>();
return services;
}
//public static IServiceCollection AddHttpService(this IServiceCollection services, string name)
//{
// // 此函数为添加HTTP服务模板
// // https://docs.microsoft.com/zh-cn/aspnet/core/fundamentals/http-requests?view=aspnetcore-5.0
// services.AddHttpClient(name);
// services.AddSingleton<IXXHttpService, XXHttpService>();
//}
}
}