Demo/Program.cs

24 lines
807 B
C#
Raw Permalink Normal View History

2024-10-28 03:24:11 +00:00
using Demo.Data.RemoteData.RemoteDataBase;
using Demo.Data.Repository;
using Demo.Domain.UseCase;
using Demo.UI;
2024-10-21 10:38:39 +00:00
using Microsoft.Extensions.DependencyInjection;
2024-10-21 10:38:39 +00:00
IServiceCollection services = new ServiceCollection();
2024-10-28 03:24:11 +00:00
services
2024-10-24 20:41:31 +00:00
.AddDbContext<RemoteDatabaseContext>()
.AddSingleton<IGroupRepository, SQLGroupRepositoryImpl>()
.AddSingleton<IUserRepository, SQLUserRepositoryImpl>()
.AddSingleton<IPresenceRepository, SQLPresenceRepositoryImpl>()
2024-10-21 10:38:39 +00:00
.AddSingleton<IGroupUseCase, GroupUseCase>()
.AddSingleton<IUserUseCase, UserUseCase>()
2024-10-23 19:46:46 +00:00
.AddSingleton<IPresenceUseCase, PresenceUseCase>()
2024-10-21 10:38:39 +00:00
.AddSingleton<UserConsoleUI>()
.AddSingleton<MainMenuUI>();
2024-10-28 03:24:11 +00:00
var serviceProvider = services.BuildServiceProvider();
2024-10-21 10:38:39 +00:00
2024-10-28 03:24:11 +00:00
MainMenuUI? mainMenuUI = serviceProvider.GetService<MainMenuUI>();