2026-02-02 04:48:10 -06:00
|
|
|
namespace FiscalOS.Infra.DependencyInjection;
|
|
|
|
|
|
|
|
|
|
public static class ServiceCollectionExtensions
|
|
|
|
|
{
|
|
|
|
|
public static IServiceCollection AddInfrastructure(this IServiceCollection services)
|
|
|
|
|
{
|
2026-02-02 13:18:15 -06:00
|
|
|
services.AddSingleton(TimeProvider.System);
|
|
|
|
|
services.AddSingleton<ITokenGenerator, TokenGenerator>(TokenGenerator.From);
|
|
|
|
|
services.AddSingleton<IPasswordHasher, PasswordHasher>(PasswordHasher.From);
|
2026-02-02 04:48:10 -06:00
|
|
|
services.ConfigureOptions<AppDbContextOptionsSetup>();
|
|
|
|
|
services.AddDbContext<AppDbContext>();
|
|
|
|
|
services.AddHostedService<MigrationService>();
|
|
|
|
|
return services;
|
|
|
|
|
}
|
|
|
|
|
}
|