Event in Global.asax file that fires only for once
- by fiberOptics
In MVC Global.asax file, we can see the Application_Start where this event fires only for once. But the session is not yet active/available here. So my question is, is there any event in Global.asax file that fired only for once and session is available also?
The reason I ask this is because, I use ExpandoObject
e.g.:
public static dynamic Data
{
get
{
#region FAILSAFE
if (HttpContext.Current.Session[datakey] == null)
{
HttpContext.Current.Session[datakey] = new ExpandoObject();
}
#endregion
return (ExpandoObject)HttpContext.Current.Session[datakey];
}
}
I want to initialize all of my ExpandoObject at once with the value of null:
MyExpando.Data.UserInformation = null;
MyExpando.Data.FolderInformation = null;
That's why I'm looking for an event that only fired once.