About .NET, ASP.NET, MVC, C#, WPF, WCF and everything related to .NET and more.

Mugen Injection [WebContextScopeLifecycle]

WebContextScopeLifecycle - instances activated via the binding should be re-used within the same request, for scope used HttpContext, or HttpSessionState, or OperationContext. The ASP.NET and WCF integrations use this mechanism to support scope semantics.
Example of usage:

// Create your MugenInjector.
_injector = new MugenInjector();
//Indicates that instances activated via the binding should be re-used within the same HTTP session, 
//for scope used HttpSessionState.
_injector.Bind<Alpha>().ToSelf().InSessionScope();
//Indicates that instances activated via the binding should be re-used within the same OperationContext request, 
//for scope used OperationContext.
_injector.Bind<Alpha>().ToSelf().InOperationRequestScope();
// Indicates that instances activated via the binding should be re-used within the same HTTP request, 
//for scope used HttpContext.
_injector.Bind<Alpha>().ToSelf().InHttpRequestScope();

Comments
Leave a Reply
*bold*
_italics_
+underline+
* Bullet List
** Bullet List 2
# Number List
## Number List 2
{"Do not apply formatting"}
{code:language} code here {code:language}.
Supports: aspx c#, c#, c++, html, sql, xml
[url:http://www.example.com]