xxxproject/Demo/Program.cs
Class_Student 6b9b5a424f init
2024-10-30 12:11:19 +03:00

30 lines
1.1 KiB
C#

using Demo.Data.RemoteData.RemoteDataBase;
using Demo.Data.Repository;
using Demo.Domain.UseCase;
using Demo.UI;
using Microsoft.Extensions.DependencyInjection;
class Program
{
static void Main(string[] args)
{
IServiceCollection services = new ServiceCollection();
services.AddDbContext<RemoteDatabaseContex>()
.AddSingleton<IGroupRepository, SQLGroupRepositoryLmpl>()
.AddSingleton<IUserRepository, SQLUserRepositoryImpl>()
.AddSingleton<IPresenceRepository, SQLPresenceRepositoryImpl>()
.AddSingleton<GroupUseCase>()
.AddSingleton<UseCaseGeneratePresence>()
.AddSingleton<UserUseCase>()
.AddSingleton<UseCasePresence>()
.AddSingleton<UserConsoleUI>()
.AddSingleton<PresenceConsoleUI>()
.AddSingleton<GroupConsoleUI>()
.AddSingleton<MainMenuUI>();
var serviceProvaider = services.BuildServiceProvider();
MainMenuUI mainMenuUI= serviceProvaider.GetService<MainMenuUI>();
mainMenuUI.DisplayMenu();
}
}