using console_ui.UI; using data; using data.Repository; using domain.Service; using domain.UseCase; using Microsoft.Extensions.DependencyInjection; namespace console_ui { class Program { static void Main(string[] args) { IServiceCollection services = new ServiceCollection(); services .AddDbContext() .AddSingleton() .AddSingleton() .AddSingleton(); var serviceProvider = services.BuildServiceProvider(); var groupUI = serviceProvider.GetService(); var repo = serviceProvider.GetService(); printAllGroups(repo!); } static void printAllGroups(IGroupRepository groupRepository) { foreach (var item in groupRepository.GetAllGroups()) { Console.WriteLine($"{item.Id} \t {item.Name}"); } } } }