public Course Parse(CourseModel model) { return(new Course() { Name = model.Name, Description = model.Description, Duration = model.Duration, CourseTutor = _repo.GetTutor(model.Tutor.Id), CourseSubject = _repo.GetSubject(model.Subject.Id) }); }
public Course Parse(CourseModel model) { try { var course = new Course() { Name = model.Name, Description = model.Description, Duration = model.Duration, CourseSubject = _repo.GetSubject(model.Subject.Id), CourseTutor = _repo.GetTutor(model.Tutor.Id) }; return(course); } catch (Exception) { return(null); } }
public Course ParseFromCourseModel(CourseModel courseModel) { try { var course = new Course { Name = courseModel.Name, Duration = courseModel.Duration, Description = courseModel.Description, CourseSubject = repository.GetSubject(courseModel.Subject.Id), CourseTutor = repository.GetTutor(courseModel.Tutor.Id) }; return(course); } catch (Exception) { return(null); } }