36 lines
1.3 KiB
C#
36 lines
1.3 KiB
C#
using Microsoft.Extensions.DependencyInjection;
|
|
using SIGCM.Domain.Interfaces;
|
|
using SIGCM.Application.Interfaces;
|
|
using SIGCM.Infrastructure.Data;
|
|
using SIGCM.Infrastructure.Repositories;
|
|
using SIGCM.Infrastructure.Services;
|
|
|
|
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, TokenService>();
|
|
services.AddScoped<IAuthService, AuthService>();
|
|
services.AddScoped<IAttributeDefinitionRepository, AttributeDefinitionRepository>();
|
|
services.AddScoped<IListingRepository, ListingRepository>();
|
|
services.AddScoped<IImageRepository, ImageRepository>();
|
|
services.AddScoped<PricingRepository>();
|
|
services.AddScoped<PricingService>();
|
|
services.AddScoped<ClientRepository>();
|
|
services.AddScoped<AuditRepository>();
|
|
return services;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|