public void SaveEvents(ReferalEventDetail model, int siteId, int studyId) { var repo = new AllRepository <ReferalEventDetail>(); if (model.Id == 0) { repo.InsertModel(model); } else { repo.UpdateModel(model); } repo.Save(); var value = dbContext.StudySiteReferalMappings.AsNoTracking().Where(row => row.RefrelId == model.ReferalId && row.SiteId == siteId && row.StudyId == studyId).FirstOrDefault(); if (value != null) { value.ReferalStatusId = model.ReferalStatusId; dbContext.Entry(value).State = System.Data.Entity.EntityState.Modified; dbContext.SaveChanges(); } }
public void Save() { _context.SaveChanges(); }