Esempio n. 1
0
 protected override void DiposeCore()
 {
     if (dbContext != null)
     {
         dbContext.Dispose();
     }
 }
 protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         db.Dispose();
     }
     base.Dispose(disposing);
 }
Esempio n. 3
0
 protected virtual void Dispose(bool disposing)
 {
     if (!this.disposed)
     {
         if (disposing)
         {
             _ctx.Dispose();
         }
     }
     this.disposed = true;
 }
Esempio n. 4
0
        protected override void Seed(HanaSolution.Services.EntitiesDbContext context)
        {
            using (var db = new EntitiesDbContext())
            {
                if (db.Staffs.Where(x => x.Account == "admin").Count() == 0)
                {
                    db.Staffs.Add(new Data.Models.Staff {
                        Account = "admin", Password = "******", Address = "Main", Gender = 1, Mail = "Main", Name = "Quản trị viên", Phone = "Main", Status = true
                    });;
                    db.Commit();
                }

                db.Dispose();
            }
        }