presence/Presence.Desktop/DI/ServiceCollectionExtensions.cs
2024-11-24 21:05:17 +03:00

22 lines
634 B
C#

using Microsoft.Extensions.DependencyInjection;
using data;
using data.Repository;
using data.RemoteData.RemoteDataBase;
using Presence.Desktop.ViewModels;
using domain.UseCase;
namespace Presence.Desktop.DI
{
public static class ServiceCollectionExtensions
{
public static void AddCommonService(this IServiceCollection collection)
{
collection
.AddSingleton<IGroupRepository, SQLGroupRepositoryImpl>()
.AddDbContext<RemoteDatabaseContext>()
.AddTransient<GroupUseCase>()
.AddTransient<MainWindowViewModel>();
}
}
}