26 lines
861 B
C#
26 lines
861 B
C#
|
|
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>();
|
||
|
|
return services;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
|