标签:好用 mil 最简 png turn wget idt 返回 cti
原代码: public ActionResult JSon({ NorthwindEntities db = new NorthwindEntities(); Employees per = db.Employees.Where(u => u.EmployeeID == 1).FirstOrDefault(); return Json(per, JsonRequestBehavior.AllowGet); }
1 public ActionResult JSon(){ 2 NorthwindEntities db = new NorthwindEntities(); 3 db.Configuration.ProxyCreationEnabled = false; 4 Employees per = db.Employees.Where(u => u.EmployeeID == 1).FirstOrDefault(); 5 return Json(per, JsonRequestBehavior.AllowGet); 6 }
百度后发现方法挺多,个人认为这个比较好用
MVC+EF 序列化类型为“System.Data.Entity.DynamicProxies.__的对象时检测到循环引用
标签:好用 mil 最简 png turn wget idt 返回 cti
原文地址:https://www.cnblogs.com/AardWolf/p/10673304.html