2024-12-05 09:30:01 +00:00
|
|
|
|
using Demo.Data.RemoteData.RemoteDataBase;
|
|
|
|
|
using Demo.Data.Repository;
|
|
|
|
|
using Demo.Domain.UseCase;
|
2024-12-19 17:36:57 +00:00
|
|
|
|
using domain.Service;
|
|
|
|
|
using domain.UseCase;
|
|
|
|
|
using presence_api.Controllers;
|
2024-12-05 09:30:01 +00:00
|
|
|
|
|
|
|
|
|
namespace presence_api.ServiceExtencions
|
|
|
|
|
{
|
2024-12-19 17:36:57 +00:00
|
|
|
|
public static class ServiceExtensions
|
2024-12-05 09:30:01 +00:00
|
|
|
|
{
|
2024-12-19 17:36:57 +00:00
|
|
|
|
public static void ConfigureGroup(this IServiceCollection services)
|
2024-12-05 09:30:01 +00:00
|
|
|
|
{
|
2024-12-19 17:36:57 +00:00
|
|
|
|
services
|
|
|
|
|
.AddScoped<IGroupRepository, SQLGroupRepositoryImpl>()
|
|
|
|
|
.AddScoped<GroupUseCase>();
|
|
|
|
|
}
|
2024-12-05 09:30:01 +00:00
|
|
|
|
|
2024-12-19 17:36:57 +00:00
|
|
|
|
public static void ConfigureUser(this IServiceCollection services)
|
|
|
|
|
{
|
2024-12-05 09:30:01 +00:00
|
|
|
|
services
|
2024-12-19 17:36:57 +00:00
|
|
|
|
.AddScoped<IUserRepository, SQLUserRepositoryImpl>()
|
|
|
|
|
.AddScoped<UserUseCase>();
|
|
|
|
|
}
|
2024-12-05 09:30:01 +00:00
|
|
|
|
|
2024-12-19 17:36:57 +00:00
|
|
|
|
public static void ConfigurePresence(this IServiceCollection services)
|
|
|
|
|
{
|
|
|
|
|
services
|
|
|
|
|
.AddScoped<IPresenceRepository, SQLPresenceRepositoryImpl>()
|
|
|
|
|
.AddScoped<PresenceUseCase>();
|
|
|
|
|
}
|
2024-12-05 09:30:01 +00:00
|
|
|
|
|
2024-12-19 17:36:57 +00:00
|
|
|
|
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>();
|
2024-12-05 09:30:01 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|