Beispiel #1
0
 public void DropTableIfExists(string name)
 {
     using (var c = ConnectionHelper.Open())
     {
         c.DropTableIfExists(name);
     }
 }
Beispiel #2
0
 public void DropTableIfExists <T>() where T : class
 {
     lock (m_existingTablesLock)
     {
         using (var c = ConnectionHelper.Open <T>())
         {
             c.DropTableIfExists <T>();
             m_existingTables.Remove(typeof(T));
         }
     }
 }
Beispiel #3
0
        public void EnsureTableExists <T>() where T : class
        {
            if (m_existingTables.Contains(typeof(T)))
            {
                return;
            }

            lock (m_existingTablesLock)
            {
                if (m_existingTables.Contains(typeof(T)))
                {
                    return;
                }

                using (var c = ConnectionHelper.Open <T>())
                {
                    c.CreateTableIfNotExists <T>();
                    m_existingTables.Add(typeof(T));
                }
            }
        }
Beispiel #4
0
        protected virtual DbConnection OpenConnection()
        {
            var c = ConnectionHelper.Open <T>();

            return(c);
        }