presence_new/Presence.Desktop/DI/ServiceCollictionExtensions.cs

33 lines
1.0 KiB
C#
Raw Normal View History

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;
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>()
.AddSingleton<IGroupRepository, SQLGroupRepositoryImpl>()
2024-12-21 11:14:33 +00:00
.AddSingleton<IUserRepository, SQLUserRepositoryImpl>()
.AddTransient<GroupUseCase>()
2024-12-13 07:21:14 +00:00
.AddTransient<IGroupUseCase, GroupService>()
.AddTransient<GroupViewModel>()
.AddTransient<PresenceViewModel>();
2024-12-13 07:21:14 +00:00
}
}
}