Bedingung vom Typ new() entfernen

This commit is contained in:
Developer 02
2024-06-27 16:02:41 +02:00
parent 8f09ec4255
commit b0f5738390
7 changed files with 10 additions and 7 deletions

View File

@@ -1,4 +1,5 @@
using Microsoft.Extensions.DependencyInjection;
using DigitalData.Core.Abstractions.Client;
using Microsoft.Extensions.DependencyInjection;
namespace DigitalData.Core.Client
{
@@ -17,5 +18,8 @@ namespace DigitalData.Core.Client
private static IServiceProvider Build() => _services.BuildServiceProvider();
public static T Provide<T>() where T : notnull => _lazyProvider.Value.GetRequiredService<T>();
public static IHttpClientService<TOptions> ProvideHttpClientService<TOptions>() where TOptions : notnull
=> _lazyProvider.Value.GetRequiredService<IHttpClientService<TOptions>>();
}
}