presence/Presence.Desktop/DI/ServiceCollectionExtension.cs

22 lines
621 B
C#
Raw Permalink Normal View History

2024-12-10 05:26:38 +00:00
using data;
using data.Repository;
using domain.UseCase;
using domain.Service;
using Microsoft.Extensions.DependencyInjection;
using Presence.Desktop.ViewModels;
namespace Presence.Desktop.DI
{
public static class ServiceCollectionExtension
{
public static void AddComonoServices(this IServiceCollection collection)
{
collection
.AddDbContext<DatabaseContext>()
.AddSingleton<IGroupRepository, SQLGroupRepository>()
.AddTransient<IGroupUseCase, GroupService>()
.AddTransient<MainWindowViewModel>();
}
}
}