public void AddSong(CustomLessonSongContent newSongExample) { var specificLessonContainer = _context.CustomLessonContainers.FirstOrDefault(x => x.Id == newSongExample.CustomLessonContainerId); //_context.CustomLessonSongContents.Add(newSongExample); specificLessonContainer.LessonContentItems.Add(newSongExample); _context.SaveChanges(); }
public void EditContentSection(CustomLessonSongContent targetContentForEdit) { CustomLessonSongContent editContent = _context.CustomLessonSongContents.Find(targetContentForEdit.Id); editContent = targetContentForEdit; _context.Entry(editContent).State = EntityState.Modified; _context.SaveChanges(); }