Castle.MicroKernel.Lifestyle.PerWebRequestLifestyleModule.Init C# (CSharp) Méthode

Init() public méthode

public Init ( System.Web.HttpApplication context ) : void
context System.Web.HttpApplication
Résultat void
		public void Init(HttpApplication context)
		{
			initialized = true;
			context.EndRequest += Application_EndRequest;
		}

Usage Example

Exemple #1
0
		public void TestFixtureSetup()
		{
			//Hackery in order to get the PerWebRequest lifecycle working in a test environment
			//Surely there must be a better way to do this?
			HttpContext.Current = new HttpContext(new HttpRequest("foo", "http://localhost", ""), new HttpResponse(new StringWriter()));
			HttpContext.Current.ApplicationInstance = new HttpApplication();
			var module = new PerWebRequestLifestyleModule();
			module.Init(HttpContext.Current.ApplicationInstance);

			container = ContainerBuilder.Build("Windsor.config");
		}
All Usage Examples Of Castle.MicroKernel.Lifestyle.PerWebRequestLifestyleModule::Init