pr1/presence/presence_api/ServiceExtencions/ServiceExtencions.cs
2024-12-19 20:36:57 +03:00

47 lines
1.5 KiB
C#

using Demo.Data.RemoteData.RemoteDataBase;
using Demo.Data.Repository;
using Demo.Domain.UseCase;
using domain.Service;
using domain.UseCase;
using presence_api.Controllers;
namespace presence_api.ServiceExtencions
{
public static class ServiceExtensions
{
public static void ConfigureGroup(this IServiceCollection services)
{
services
.AddScoped<IGroupRepository, SQLGroupRepositoryImpl>()
.AddScoped<GroupUseCase>();
}
public static void ConfigureUser(this IServiceCollection services)
{
services
.AddScoped<IUserRepository, SQLUserRepositoryImpl>()
.AddScoped<UserUseCase>();
}
public static void ConfigurePresence(this IServiceCollection services)
{
services
.AddScoped<IPresenceRepository, SQLPresenceRepositoryImpl>()
.AddScoped<PresenceUseCase>();
}
public static void ConfigureAdmin(this IServiceCollection services)
{
services
.AddScoped<IUserRepository, SQLUserRepositoryImpl>()
.AddScoped<IGroupRepository, SQLGroupRepositoryImpl>()
.AddScoped<IPresenceRepository, SQLPresenceRepositoryImpl>()
.AddScoped<IAdminRepository, AdminRepositoryImp>()
.AddScoped<UserUseCase>()
.AddScoped<GroupUseCase>()
.AddScoped<PresenceUseCase>()
.AddScoped<AdminUseCase>();
}
}
}