Exemplo n.º 1
0
        public Section(string title, Course course)
        {
            ThrowIfTitleInvalid(title);

            Title = title;
            Course = course;
        }
Exemplo n.º 2
0
        public CourseModel CreateCourse(Dictionary<string, string> spec)
        {
            if (!spec.ContainsKey("title") && !spec.ContainsKey("description"))
                throw new ArgumentNullException();

            var course = new Course(spec["title"], spec["description"]);

            _courseRepository.Insert(course);

            return _mapper.Map<CourseModel>(course);
        }