protected override void DiposeCore() { if (dbContext != null) { dbContext.Dispose(); } }
protected override void Dispose(bool disposing) { if (disposing) { db.Dispose(); } base.Dispose(disposing); }
protected virtual void Dispose(bool disposing) { if (!this.disposed) { if (disposing) { _ctx.Dispose(); } } this.disposed = true; }
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(); } }