pr1/presence/presence_api/ServiceExtencions/ServiceExtencions.cs

48 lines
1.5 KiB
C#
Raw Normal View History

2024-12-23 09:12:26 +00:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using data.Repository;
2024-12-19 17:36:57 +00:00
using domain.UseCase;
2024-12-23 09:12:26 +00:00
using presence.data.Repository;
using presence.domain.UseCase;
2024-12-05 09:30:01 +00:00
2024-12-23 09:12:26 +00:00
namespace presence_api.ServiceExtensions
2024-12-05 09:30:01 +00:00
{
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
}
}
2024-12-23 09:12:26 +00:00
}