2024-12-13 07:21:14 +00:00
|
|
|
using data;
|
|
|
|
using data.Repository;
|
|
|
|
using domain.Service;
|
|
|
|
using domain.UseCase;
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
using presence.data.RemoteData.RemoteDataBase;
|
|
|
|
using presence.data.Repository;
|
|
|
|
using presence.domain.UseCase;
|
|
|
|
using Presence.Desktop.ViewModels;
|
2024-12-22 12:37:22 +00:00
|
|
|
using ReactiveUI;
|
2024-12-13 07:21:14 +00:00
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Linq;
|
|
|
|
using System.Runtime.CompilerServices;
|
|
|
|
using System.Text;
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
namespace Presence.Desktop.DI
|
|
|
|
{
|
|
|
|
public static class ServiceColletionExtensions
|
|
|
|
{
|
|
|
|
public static void AddCommonService(this IServiceCollection collection) {
|
|
|
|
collection
|
|
|
|
.AddDbContext<RemoteDataBaseContext>()
|
2024-12-23 11:56:27 +00:00
|
|
|
|
|
|
|
.AddSingleton<IGroupRepository, SQLGroupRepositoryImpl>()
|
|
|
|
.AddSingleton<IUserRepository, SQLUserRepositoryImpl>()
|
|
|
|
.AddSingleton<IPresenceRepository, SQLPresenceRepositoryImpl>()
|
|
|
|
.AddSingleton<PresenceUseCase>()
|
|
|
|
.AddSingleton<UserUseCase>()
|
|
|
|
.AddTransient<GroupUseCase>()
|
2024-12-13 07:21:14 +00:00
|
|
|
.AddTransient<IGroupUseCase, GroupService>()
|
2024-12-22 12:37:22 +00:00
|
|
|
.AddTransient<GroupViewModel>()
|
|
|
|
.AddTransient<PresenceViewModel>();
|
2024-12-23 11:56:27 +00:00
|
|
|
;
|
2024-12-13 07:21:14 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|