AuthenticationExample.Web.MvcApplication.Application_Start C# (CSharp) Method

Application_Start() protected method

protected Application_Start ( ) : void
return void
		protected void Application_Start()
		{
			ControllerBuilder.Current.SetControllerFactory(new StructureMapControllerFactory());

			ObjectFactory.Initialize(x =>
			{
				x.For<IRepository>()
					.Use(new InMemoryRepository());
				x.For<HttpContextBase>()
					.Use(() => new HttpContextWrapper(HttpContext.Current));
				x.For<ICookieAuthenticationConfiguration>()
					.Use<ConfigFileAuthenticationConfiguration>();
				x.For<IAuthenticator>()
					.Use<CookieAuthenticator>();
				x.For<IEmailer<RegistrationConfirmation>>()
					.Use<RegistrationEmailer>();
			});

			AreaRegistration.RegisterAllAreas();

			RegisterRoutes(RouteTable.Routes);
		}
	}