21 lines
556 B
C#
21 lines
556 B
C#
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;
|
|
}
|
|
}
|