public getCourseById_Result GetCourseById(int?id) { try { getCourseById_Result objcourse = new getCourseById_Result(); using (aspccEntities db = new aspccEntities()) { objcourse = db.getCourseById(id).FirstOrDefault(); return(objcourse); } } catch (Exception ex) { return(null); } }