示例#1
0
        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();
        }
示例#2
0
        public void EditContentSection(CustomLessonSongContent targetContentForEdit)
        {
            CustomLessonSongContent editContent = _context.CustomLessonSongContents.Find(targetContentForEdit.Id);

            editContent = targetContentForEdit;

            _context.Entry(editContent).State = EntityState.Modified;
            _context.SaveChanges();
        }