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 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; } }