-3

我使用带有 Web API Asp.Net 的 Code First 实体模型
我总共需要 3 个表
第一个表(Table1)包含一些具有唯一 ID 的信息让我们说它就像

string id 
string model

第二个表(Table2)包含有关用户的一些信息。可以说是

string Id
string name
string company

现在我需要第三张桌子。它只能用作连接表,并且包含

Table1 ModelInfo
Table2 UserInfo

但它向我显示了一个错误,即无法在没有unique id. 但由于我的架构是我不需要unique id
我该怎么办?还是我需要改变我的架构?

4

1 回答 1

1

您的问题是一般的 EF CodeFirst 多对多关系。建议阅读:

于 2012-07-23T22:10:22.840 回答