2024-12-16 04:10:04 +00:00
|
|
|
|
using data.RemoteData.RemoteDataBase;
|
2024-11-24 18:05:17 +00:00
|
|
|
|
using data.Repository;
|
|
|
|
|
using domain.UseCase;
|
2024-12-16 04:10:04 +00:00
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
using Presence.Desktop.ViewModels;
|
2024-11-24 18:05:17 +00:00
|
|
|
|
|
|
|
|
|
namespace Presence.Desktop.DI
|
|
|
|
|
{
|
|
|
|
|
public static class ServiceCollectionExtensions
|
|
|
|
|
{
|
|
|
|
|
public static void AddCommonService(this IServiceCollection collection)
|
|
|
|
|
{
|
|
|
|
|
collection
|
|
|
|
|
.AddDbContext<RemoteDatabaseContext>()
|
2024-12-16 04:10:04 +00:00
|
|
|
|
.AddSingleton<IGroupRepository, SQLGroupRepositoryImpl>()
|
|
|
|
|
.AddSingleton<IUserRepository, SQLUserRepositoryImpl>()
|
|
|
|
|
.AddSingleton<IPresenceRepository, SQLPresenceRepositoryImpl>()
|
|
|
|
|
.AddSingleton<UseCaseGeneratePresence>()
|
|
|
|
|
.AddSingleton<UserUseCase>()
|
2024-12-18 08:42:44 +00:00
|
|
|
|
.AddTransient<GroupUseCase>(); }
|
2024-11-24 18:05:17 +00:00
|
|
|
|
}
|
2024-12-16 04:10:04 +00:00
|
|
|
|
}
|