这是因为EF外键引起的序列化问题. 解决方案: context.Configuration.ProxyCreationEnabled = false; 这里我用的是一个基类控制器用于被继承 返回EF实例前加上这段代码就可以了 //用于被继承 public class BaseController : Controller { public CucuCarEntity db { get { //从当前线程中获取该对象 CucuCarEntity db = CallContext.GetData("
原文链接:http://www.cnblogs.com/hanxi/archive/2012/07/25/2608068.html 前几天很不爽,因为C++中两个类中互相包含对方对象的指针编译时提示某一个类未定义...所以我就想啊想,这样也对,我的头文件都有#ifndef的,包含了一次就不能再包含了,以为就实现不了这样的功能,于是就改了设计方案: class A { public: A(B* pB):m_pB(pB) { } private: B* m_pB; }; class B { publ
首先导入springboot 的 web 包 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> restTemplateBuilder的方式被废弃,就推荐使用. @Configuration public class AppConfig { @Be