public override object Resolve(CreationContext context) {
var httpContext = ContextProvider();
if (httpContext == null)
throw new InvalidOperationException("HttpContext.Current is null. PerWebSessionLifestyle can only be used in ASP.Net");
var session = httpContext.Session;
if (session == null)
throw new InvalidOperationException("ASP.NET session not found");
if (session[objectID] == null) {
var instance = base.Resolve(context);
session[objectID] = instance;
return instance;
}
return session[objectID];
}