1.CodeFirst中有导航属性,WCF会提示序列化失败?
解决:EF会给每个实体代理类,WCF序列化时就无法识别出实体类,在DbContext继承类里关闭代理类
public UiContext() : base("UiContext") { this.Configuration.ProxyCreationEnabled = false; }