24 lines
803 B
C#
24 lines
803 B
C#
|
|
using Data.RemoteData.RemoteDataBase.DAO;
|
|
using Demo.Data.Repository;
|
|
using Demo.Domain.UseCase;
|
|
using Demo.UI;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
IServiceCollection services = new ServiceCollection();
|
|
|
|
services
|
|
.AddDbContext<RemoteDatabaseContext>()
|
|
.AddSingleton<IGroupRepository, SQLGroupRepositoryImpl>()
|
|
.AddSingleton<IUserRepository, SQLUserRepositoryImpl>()
|
|
.AddSingleton<IPresenceRepository, SQLPresenceRepositoryImpl>()
|
|
.AddSingleton<IGroupUseCase, GroupUseCase>()
|
|
.AddSingleton<IUserUseCase, UserUseCase>()
|
|
.AddSingleton<IPresenceUseCase, PresenceUseCase>()
|
|
.AddSingleton<UserConsoleUI>()
|
|
.AddSingleton<MainMenuUI>();
|
|
|
|
var serviceProvider = services.BuildServiceProvider();
|
|
|
|
MainMenuUI? mainMenuUI = serviceProvider.GetService<MainMenuUI>();
|