用MVC+EF做简单查询时,返回json格式数据出现问题
原代码:public ActionResult JSon({NorthwindEntities db = new NorthwindEntities();Employees per = db.Employees.Where(u => u.EmployeeID == 1).FirstOrDefault();return Json(per, JsonRequestBehavior.AllowGet); }
报错:
原代码:public ActionResult JSon({NorthwindEntities db = new NorthwindEntities();Employees per = db.Employees.Where(u => u.EmployeeID == 1).FirstOrDefault();return Json(per, JsonRequestBehavior.AllowGet); }