Code First CTP5中的错误 [英] Bug in Code First CTP5
本文介绍了Code First CTP5中的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
奇怪的行为:
推荐答案
嗨Steve,
Hi Steve,
问题是Second有一个外键也是First的集合。如果Second有一个外键,那么导航属性应该只是一个引用而不是一个集合。 Code First会将此检测为多对多关系,而不是
将firstid配置为外键。
The problem is that Second has a foreign key but also a collection of First. If Second has a foreign key then the navigation property should just be a reference rather than a collection. Code First is going to detect this as a many to many relationship and isn't going to configure firstid as a foreign key.
您可以使用dc创建代理。 Seconds.Create()
You can create proxies by using dc.Seconds.Create()
~Rowan
这篇关于Code First CTP5中的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文