presence_new/presence_api/ServiceExtensions/ServiceExtensions.cs

48 lines
1.5 KiB
C#
Raw Permalink Normal View History

2024-11-16 12:02:17 +00:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
2024-11-19 12:41:31 +00:00
using data.Repository;
using domain.UseCase;
2024-11-16 12:02:17 +00:00
using presence.data.Repository;
using presence.domain.UseCase;
namespace presence_api.ServiceExtensions
{
public static class ServiceExtensions
{
public static void ConfigureGroup(this IServiceCollection services)
{
services
.AddScoped<IGroupRepository, SQLGroupRepositoryImpl>()
.AddScoped<GroupUseCase>();
}
2024-11-16 14:13:06 +00:00
public static void ConfigureUser(this IServiceCollection services)
{
services
.AddScoped<IUserRepository, SQLUserRepositoryImpl>()
.AddScoped<UserUseCase>();
}
2024-11-18 15:54:36 +00:00
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>()
2024-11-19 12:41:31 +00:00
.AddScoped<IAdminRepository, AdminRepositoryImp>()
2024-11-18 15:54:36 +00:00
.AddScoped<UserUseCase>()
.AddScoped<GroupUseCase>()
2024-11-19 12:41:31 +00:00
.AddScoped<PresenceUseCase>()
.AddScoped<AdminUseCase>();
2024-11-18 15:54:36 +00:00
}
2024-11-16 12:02:17 +00:00
}
}