// // GET: /Student/Details/5 public ActionResult Details(int id) { Business.StudentBusiness _students = new StudentBusiness(); Students entity = _students.GetById(id); return(View(entity)); }
public JsonResult GetStudentById(long id = 0) { if (id == 0) { throw new MyException("参数id不合法", StatusCodes.Status400BadRequest); } return(Json(_studentBusiness.GetById(id))); }
public IHttpActionResult GetById(int id) { try { Student student = _studentBusiness.GetById(id); return(Ok(student)); } catch (Exception ex) { return(InternalServerError(ex)); } }