public void Dispose() { if (null != _emrContext) { _emrContext.SaveChanges(); _emrContext.Dispose(); } }
public void SetUp() { _context = new EMRContext(_options); _configRepository = new ConfigRepository(_context); _testUser = new User("MauntestMaun"); _testGroup = new Group("MaungroupMaun"); _testGroupNew = new Group("MaungroupMaunNEW"); _featureIds = _context.Features.Where(x => x.DeleteFlag == 0).Take(2).Select(x => x.FeatureID).ToList(); _userIds = _context.Users.Where(x => x.DeleteFlag == 0).Select(x => x.UserId).ToList(); _context.Add(_testUser); _context.Add(_testGroup); _context.SaveChanges(); }
public void Create(CrmPerson item) { db.CrmPersons.Add(item); db.SaveChanges(); }