Files
SIG-CM/src/SIGCM.Infrastructure/DependencyInjection.cs

28 lines
955 B
C#
Raw Normal View History

using Microsoft.Extensions.DependencyInjection;
using SIGCM.Domain.Interfaces;
using SIGCM.Application.Interfaces;
using SIGCM.Infrastructure.Data;
using SIGCM.Infrastructure.Repositories;
namespace SIGCM.Infrastructure;
public static class DependencyInjection
{
public static IServiceCollection AddInfrastructure(this IServiceCollection services)
{
services.AddSingleton<IDbConnectionFactory, DbConnectionFactory>();
services.AddSingleton<DbInitializer>();
services.AddScoped<ICategoryRepository, CategoryRepository>();
services.AddScoped<IOperationRepository, OperationRepository>();
services.AddScoped<IUserRepository, UserRepository>();
services.AddScoped<ITokenService, Services.TokenService>();
services.AddScoped<IAuthService, Services.AuthService>();
services.AddScoped<IAttributeDefinitionRepository, AttributeDefinitionRepository>();
return services;
}
}