mirror of
https://github.com/BeyondDimension/SteamTools.git
synced 2026-10-22 09:36:09 +08:00
更新Linux截图
HttpClient 统一到 HttpClientFactory
This commit is contained in:
@@ -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>();
|
||||
//}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user