protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         db.Dispose();
     }
     base.Dispose(disposing);
 }
Esempio n. 2
0
        public void insertNew()
        {
            MyEntities en    = new MyEntities();
            var        query = (from b in en.ENTITYTABLEs
                                select b.ID).Max();

            en.INSERT_ENTITYTABLE(query + 1, "siguiente: " + (query + 1));
            en.Dispose();
        }
        protected override void DisposeCore()
        {
            log.Debug("Disposing DbContext");

            if (dataContext != null)
            {
                dataContext.Dispose();
            }
        }
Esempio n. 4
0
        public void delete(int id)
        {
            MyEntities  en  = new MyEntities();
            ENTITYTABLE ent = (from b in en.ENTITYTABLEs
                               where b.ID == id
                               select b).FirstOrDefault();

            en.ENTITYTABLEs.Remove(ent);
            en.SaveChanges();
            en.Dispose();
        }
 public void Dispose()
 {
     sqlConnection.Close();
     sqlConnection.Dispose();
     entities.Dispose();
 }
Esempio n. 6
0
 public void Dispose()
 {
     db.Dispose();
 }
Esempio n. 7
0
 public void Dispose()
 {
     Db.Dispose();
 }
Esempio n. 8
0
 public void Dispose()
 {
     ent.Dispose();
 }
 public void Dispose()     // implementation of IDisposable
 {
     ent.Dispose();
 }