This commit is contained in:
2020-01-28 19:19:50 +00:00
parent 9a9641a96b
commit 861d8624a7
4 changed files with 26 additions and 11 deletions

View File

@@ -25,11 +25,12 @@ namespace AyaNova.Util
{
get
{
#if (DEBUG)
if(_provider==null){
#if (DEBUG)
if (_provider == null)
{
throw new System.NotSupportedException("ServiceProviderProvider.cs - Attempt to use service provider before it's been initialized");
}
#endif
#endif
return _provider;
}
set
@@ -57,6 +58,14 @@ namespace AyaNova.Util
}
}
// https://docs.microsoft.com/en-us/aspnet/core/fundamentals/http-requests?view=aspnetcore-3.1
internal static System.Net.Http.IHttpClientFactory HttpClientFactory
{
get
{
return Scope.ServiceProvider.GetRequiredService<System.Net.Http.IHttpClientFactory>();
}
}
}