Exemple #1
0
        // GET: api/Courses/5
        public CourseCustom Get(int id)
        {
            var          crsEntity = unitOfWork.CourseManager.GetByID(id);
            CourseCustom course    = new CourseCustom();

            course.code      = crsEntity.code;
            course.crs_AName = crsEntity.crs_AName;
            course.crs_Name  = crsEntity.crs_Name;
            return(course);
        }
 // GET: api/Courses/5
 public CourseCustom Get(int id)
 {
     try
     {
         var          crsEntity = unitOfWork.CourseManager.GetByID(id);
         CourseCustom course    = new CourseCustom();
         course.code      = crsEntity.code;
         course.crs_AName = crsEntity.crs_AName;
         course.crs_Name  = crsEntity.crs_Name;
         course.staffId   = crsEntity.staffId;
         return(course);
     }
     catch
     {
         return(null);
     }
 }