Beispiel #1
0
 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);
     }
 }
Beispiel #2
0
        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;
            }
        }