【发布时间】:2013-03-26 11:22:41
【问题描述】:
我有这两个模型:
//Primary AND Foreign key 1
public int UserID {get; set;}
//Primary AND Foreign key 2
public int ProductID {get; set;}
我不知道如何将这两列同时设置为主键和外键! 你能帮帮我吗?
【问题讨论】:
-
哪个表/实体的外键?
-
这是多对多的关系吗?看这篇博文,可能对你有帮助:weblogs.asp.net/manavi/archive/2011/05/17/…
标签: c# entity-framework ef-code-first foreign-keys primary-key