PresenceApp/Presence.Desktop/DI/ServiceCollectionExtensions.cs

29 lines
806 B
C#
Raw Permalink Normal View History

2024-12-04 23:32:04 +00:00
using data;
2024-12-01 16:16:14 +00:00
using data.RemoteData.RemoteDataBase;
using data.Repository;
2024-12-04 23:32:04 +00:00
using domain.Service;
using domain.UseCase;
2024-12-01 16:16:14 +00:00
using Microsoft.Extensions.DependencyInjection;
using Presence.Desktop.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
namespace Presence.Desktop.DI
{
2024-12-04 23:32:04 +00:00
public static class ServiceColletionExtensions
2024-12-01 16:16:14 +00:00
{
public static void AddCommonService(this IServiceCollection collection)
{
collection
2024-12-04 23:32:04 +00:00
.AddDbContext<RemoteDatabaseContext>()
.AddSingleton<IGroupRepository, SQLGroupRepositoryImpl>()
.AddTransient<IGroupUseCase, GroupService>()
.AddTransient<GroupViewModel>();
2024-12-01 16:16:14 +00:00
}
}
}