Hi I'm getting a Null problem when I try to run the following code:
Code:
private static ISessionFactory SessionFactory
{
get
{
ISessionFactory sessionFactory = null;
sessionFactory = HttpContext.Current.Application["sessionFactory"] as ISessionFactory;
if (sessionFactory == null)
{
Configuration configuration = new Configuration().Configure();
sessionFactory = configuration.BuildSessionFactory();
HttpContext.Current.Application.Add("sessionFactory", sessionFactory);
}
return sessionFactory;
}
}
On the line sessionFactory = HttpContex....... the Current is set to null and therefore this throws an error of NullReferenceException. Can somebody help me? :(