コード例 #1
0
        public IActionResult AddVideos(List <LectureVideo> videos)
        {
            if (videos == null || videos.Count == 0)
            {
                return(BadRequest());
            }

            foreach (var video in videos)
            {
                video.UniqueCode = Guid.NewGuid().ToString();
            }
            var lecture = _lectureService.GetLecture(videos[0].LectureId);

            _lectureService.RemoveAllVideos(lecture.Id);
            _lectureService.AddVideos(videos);


            return(PartialView("../Course/CoursePartial/_LectureVideo", videos));
        }