demp_with_asp/ui/Program.cs
2024-11-06 00:48:42 +03:00

19 lines
492 B
C#

using data.RemoteData;
using Data.Repository;
using domain;
using Microsoft.Extensions.DependencyInjection;
using ui;
IServiceCollection services = new ServiceCollection();
services
.AddDbContext<RemoteDataBaseContext>()
.AddSingleton<IGroupRepository, SQLGroupRepositoryImpl>()
.AddSingleton<GroupUseCase>()
.AddSingleton<GroupUI>();
var serviceProvider = services.BuildServiceProvider();
GroupUI groupUI = serviceProvider.GetService<GroupUI>();
groupUI.AddGroup();