feat: DI-Erweiterung zur Registrierung von CryptFactory hinzugefügt
This commit is contained in:
parent
4c379c2d4d
commit
6ce4a08c53
@ -1,12 +1,6 @@
|
|||||||
using System;
|
namespace DigitalData.Core.Abstractions.Security
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace DigitalData.Core.Abstractions.Security
|
|
||||||
{
|
{
|
||||||
public interface ICryptFactory
|
public interface ICryptFactory
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -6,6 +6,6 @@ namespace DigitalData.Core.Security
|
|||||||
{
|
{
|
||||||
private static readonly Lazy<ICryptFactory> LazyStaticCryptFactory = new (() => new CryptFactory());
|
private static readonly Lazy<ICryptFactory> LazyStaticCryptFactory = new (() => new CryptFactory());
|
||||||
|
|
||||||
public ICryptFactory Static = LazyStaticCryptFactory.Value;
|
public static ICryptFactory Static = LazyStaticCryptFactory.Value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
15
DigitalData.Core.Security/DIExtensions.cs
Normal file
15
DigitalData.Core.Security/DIExtensions.cs
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
using Microsoft.Extensions.DependencyInjection.Extensions;
|
||||||
|
|
||||||
|
namespace DigitalData.Core.Security
|
||||||
|
{
|
||||||
|
public static class DIExtensions
|
||||||
|
{
|
||||||
|
public static IServiceCollection AddSecurity(this IServiceCollection services)
|
||||||
|
{
|
||||||
|
services.TryAddScoped(_ => CryptFactory.Static);
|
||||||
|
|
||||||
|
return services;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user