feat(EntityConfigurationOptions): Erstellt, um Entitäten wie Mapper konfigurieren zu können

This commit is contained in:
Developer 02
2025-04-22 16:21:57 +02:00
parent 65e834784a
commit 3955dede16
5 changed files with 45 additions and 40 deletions

View File

@@ -0,0 +1,20 @@
using DigitalData.Core.Abstractions.Infrastructure;
using Microsoft.Extensions.DependencyInjection;
namespace DigitalData.Core.Infrastructure;
public class EntityConfigurationOptions<TEntity>
{
private readonly IServiceCollection _services;
public EntityConfigurationOptions(IServiceCollection services)
{
_services = services;
}
public EntityConfigurationOptions<TEntity> AddCustomMapper(Func<IServiceProvider, IEntityMapper<TEntity>> factory)
{
_services.AddSingleton(factory);
return this;
}
}