private void OnBeginRequest(object sender, EventArgs e)
{
if (!AR.IsInitialized) return;
var app = sender as HttpApplication;
if (app == null || !(AR.Holder.ThreadScopeInfo is IWebThreadScopeInfo))
throw new ActiveRecordException(Misconfigerrmessage);
app.Context.Items.Add(SessionKey, new SessionScope());
}