public void register_with_Func() { var factory = new BasicControllerFactory(); var controller = new MissingController(); factory.RegisterController("Foo", () => controller); Check.That(() => object.ReferenceEquals(factory.CreateController(EmptyContext(), "Foo"), controller)); }
protected void Application_Start() { var controllerFactory = new BasicControllerFactory(); controllerFactory.Register(typeof(DemoController).Assembly.GetTypes()); ControllerBuilder.Current.SetControllerFactory(controllerFactory); ViewEngines.Engines.Clear(); SparkEngineStarter.RegisterViewEngine(ViewEngines.Engines); RegisterRoutes(RouteTable.Routes); }
public void EstablishContext() { Factory = new BasicControllerFactory(); }