public void InsertOrUpdate(CurriculumEntry curriculumEntry) { if (curriculumEntry.CurriculumEntryId == 0) { dbContext.CurriculumEntries.Add(curriculumEntry); } else { dbContext.Entry(curriculumEntry).State = EntityState.Modified; } Save(); }
public void InsertOrUpdate(Curriculum curriculum) { CurriculumEntry curriculumEntry = new CurriculumEntry(); if (curriculum.CurriculumId == 0) { dbContext.Curricula.Add(curriculum); } else { dbContext.Entry(curriculum).State = EntityState.Modified; } Save(); }