public JsonResult CreateLecture([DataSourceRequest]  DataSourceRequest request, CreateLectureModel lecture, int courseId)
        {
            if (lecture == null || !ModelState.IsValid)
            {
                return Json(new[] { lecture }.ToDataSourceResult(request, ModelState), JsonRequestBehavior.AllowGet);
            }

            var createdLecture = this.lecturesServices.CreateLecture(lecture, courseId);

            return Json(new[] { createdLecture }.ToDataSourceResult(request, ModelState), JsonRequestBehavior.AllowGet);
        }
        public LectureViewModel CreateLecture(CreateLectureModel lecture, int courseId)
        {
            var course = this.Data.Courses
                .GetById(courseId);

            var newLecture = new Lecture()
            {
                Title = lecture.Title,
                Description = lecture.Description,
                VideoUrl = lecture.VideoUrl,
                DemoUrl = lecture.DemoUrl,
                PresentationUrl = lecture.PresentationUrl
            };

            course.Lectures.Add(newLecture);
            this.Data.SaveChanges();

            var createdLecture = this.GetLectureById(newLecture.Id);
            return createdLecture;
        }