Пример #1
0
        static void Main(string[] args)
        {
            FakeDataBase.InitData();
            var serviceCollection = new ServiceCollection();

            serviceCollection.AddScoped <IPetRepository, PetRepository>();
            serviceCollection.AddScoped <IPetService, PetService>();
            serviceCollection.AddScoped <IConsoleMenu, ConsoleMenu>();

            var serviceProvider = serviceCollection.BuildServiceProvider();
            var menu            = serviceProvider.GetRequiredService <IConsoleMenu>();

            menu.Run();
        }
Пример #2
0
 public PetRepository()
 {
     FakeDataBase.InitData();
 }