pr1/presence/Presence.Desktop/DI/ServiceCollectionExtensions.cs

33 lines
1.0 KiB
C#
Raw Normal View History

2024-12-23 09:12:26 +00:00
using data;
using data.Repository;
2024-12-19 17:36:57 +00:00
using domain.Service;
using domain.UseCase;
using Microsoft.Extensions.DependencyInjection;
2024-12-23 09:12:26 +00:00
using presence.data.RemoteData.RemoteDataBase;
using presence.data.Repository;
using presence.domain.UseCase;
2024-12-19 17:36:57 +00:00
using Presence.Desktop.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
2024-12-23 09:12:26 +00:00
using System.Runtime.CompilerServices;
2024-12-19 17:36:57 +00:00
using System.Text;
using System.Threading.Tasks;
namespace Presence.Desktop.DI
{
public static class ServiceColletionExtensions
{
public static void AddCommonService(this IServiceCollection collection)
{
collection
2024-12-23 09:12:26 +00:00
.AddDbContext<RemoteDatabaseContext>()
.AddSingleton<IGroupRepository, SQLGroupRepositoryImpl>()
.AddSingleton<IUserRepository, SQLUserRepositoryImpl>()
.AddSingleton<IPresenceRepository, SQLPresenceRepositoryImpl>()
.AddSingleton<PresenceUseCase>()
.AddSingleton<UserUseCase>()
.AddTransient<GroupUseCase>();
2024-12-19 17:36:57 +00:00
}
}
2024-12-23 09:12:26 +00:00
}