Esempio n. 1
0
 public static RendezvousDataClassesDataContext GetContext()
 {
     if (HttpContext.Current != null)
     {
         if (HttpContext.Current.Items[dbHashKey] == null)
             HttpContext.Current.Items[dbHashKey] =
                 new RendezvousDataClassesDataContext(ConfigurationManager.ConnectionStrings[ConnStringName].ConnectionString);
         return (RendezvousDataClassesDataContext)HttpContext.Current.Items[dbHashKey];
     }
     else
     {
         return m_db ??
                      (m_db = new RendezvousDataClassesDataContext(ConfigurationManager.ConnectionStrings[ConnStringName].ConnectionString));
     }
 }
Esempio n. 2
0
 public static void ResetContext()
 {
     m_db = null;
     if (HttpContext.Current != null)
         HttpContext.Current.Items[dbHashKey] = null;
 }