Пример #1
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();

            RegisterGlobalFilters(GlobalFilters.Filters);
            RegisterRoutes(RouteTable.Routes);

            var diControllerFactory = new DupeDiControllerFactory();
            ControllerBuilder.Current.SetControllerFactory(diControllerFactory);
            //
            // Fill InMemoryRepository
            //
            var rep = diControllerFactory.GetInstance<IRepository>();
            rep.Insert(new Teacher(12563, "Pedro Félix"));
            rep.Insert(new Teacher(13125, "Duarte Nunes"));
            rep.Insert(new Teacher(76152, "Luís Falcão"));
            rep.Insert(new Teacher(10702, "FM"));
        }
Пример #2
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();

            RegisterGlobalFilters(GlobalFilters.Filters);
            RegisterRoutes(RouteTable.Routes);

            var diControllerFactory = new DupeDiControllerFactory();

            ControllerBuilder.Current.SetControllerFactory(diControllerFactory);
            //
            // Fill InMemoryRepository
            //
            var rep = diControllerFactory.GetInstance <IRepository>();

            rep.Insert(new Teacher(12563, "Pedro Félix"));
            rep.Insert(new Teacher(13125, "Duarte Nunes"));
            rep.Insert(new Teacher(76152, "Luís Falcão"));
            rep.Insert(new Teacher(10702, "FM"));
        }