Presence_Desktop/Presence.Desktop/DI/ServiceCollectionExtensions.cs

22 lines
804 B
C#
Raw Permalink Normal View History

2024-12-23 11:26:41 +00:00
using data.RemoteData;
using data.Repository;
using domain.UseCase;
using Microsoft.Extensions.DependencyInjection;
using Presence.Desktop.ViewModels;
namespace Presence.Desktop.DI
{
public static class ServiceCollectionExtensions
{
public static void AddCommonService(this IServiceCollection collection)
{
collection
.AddDbContext<RemoteDatabaseContext>()
.AddSingleton<IGroupRepository, SQLGroupRepositoryImpl>()
.AddSingleton<IUserRepository, SQLUserRepositoryImpl>()
.AddSingleton<IPresenceRepository, SQLPresenceRepositoryImpl>()
.AddSingleton<UseCaseGeneratePresence>()
.AddSingleton<UserUseCase>()
.AddTransient<GroupUseCase>(); }
}
}