Example #1
0
        public static List <GridLessonView> CastFromLessonModel(List <Lesson> lessons, string courseId)
        {
            var lessonViews = new List <GridLessonView>();

            foreach (var lesson in lessons)
            {
                var lessonView = new GridLessonView();
                lessonView.Description          = lesson.Description;
                lessonView.Name                 = lesson.Name;
                lessonView.CourseIdentification = courseId;
                lessonViews.Add(lessonView);
            }

            return(lessonViews);
        }
Example #2
0
        public static CourseView CastFromCourseModel(NekoUchi.Model.Course course)
        {
            var courseView = new CourseView();

            courseView.Author         = course.Author;
            courseView.CourseName     = course.Name;
            courseView.Description    = course.Description;
            courseView.Identification = course.Identification;

            courseView.Lessons    = GridLessonView.CastFromLessonModel(course.Lessons, course.Identification);
            courseView.Subscribed = SubscribersView.CastFromSubscribers(course.Subscribed);
            courseView.Statistics = CourseStatisticsView.CastStats(course.Statistics);

            return(courseView);
        }