fix: CryptFactory.Instance in Getter-Methode für träges Laden umwandeln
This commit is contained in:
parent
6ce4a08c53
commit
ed36015d1e
@ -4,8 +4,8 @@ namespace DigitalData.Core.Security
|
|||||||
{
|
{
|
||||||
public class CryptFactory : ICryptFactory
|
public class CryptFactory : ICryptFactory
|
||||||
{
|
{
|
||||||
private static readonly Lazy<ICryptFactory> LazyStaticCryptFactory = new (() => new CryptFactory());
|
private static readonly Lazy<CryptFactory> LazyStaticCryptFactory = new (() => new ());
|
||||||
|
|
||||||
public static ICryptFactory Static = LazyStaticCryptFactory.Value;
|
public static CryptFactory Instance => LazyStaticCryptFactory.Value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,4 +1,5 @@
|
|||||||
using Microsoft.Extensions.DependencyInjection;
|
using DigitalData.Core.Abstractions.Security;
|
||||||
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Microsoft.Extensions.DependencyInjection.Extensions;
|
using Microsoft.Extensions.DependencyInjection.Extensions;
|
||||||
|
|
||||||
namespace DigitalData.Core.Security
|
namespace DigitalData.Core.Security
|
||||||
@ -7,7 +8,7 @@ namespace DigitalData.Core.Security
|
|||||||
{
|
{
|
||||||
public static IServiceCollection AddSecurity(this IServiceCollection services)
|
public static IServiceCollection AddSecurity(this IServiceCollection services)
|
||||||
{
|
{
|
||||||
services.TryAddScoped(_ => CryptFactory.Static);
|
services.TryAddScoped<ICryptFactory>(_ => CryptFactory.Instance);
|
||||||
|
|
||||||
return services;
|
return services;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user