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(); }
public PetRepository() { FakeDataBase.InitData(); }