// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { var repository = new RezervareRepository(); services.AddSingleton <IRezervareRepository>(repository); services.AddControllersWithViews(); }
private DiContainer() { Connection = Utils.CreateConnection(); AgentieRepo = new AgentieRepository(Connection); ExcursieRepo = new ExcursieRepository(Connection); RezervareRepo = new RezervareRepository(Connection, AgentieRepo, ExcursieRepo); LoginService = new LoginService(AgentieRepo); ExcursiiManagementService = new ExcursiiManagementService(ExcursieRepo); RezervareService = new RezervareService(ExcursiiManagementService, RezervareRepo); }