我有一个从具有表"table1“的数据库生成的.edmx文件。
table1具有以下属性。
ID: Int (Primary Key)
Name: String
Tag: String
Description: String在我的edmx文件中,我想将主键从ID更改为(Name,Tag)。我该怎么做呢?
发布于 2017-11-12 10:32:04
在.edmx文件的CSDL部分中,查找要更改的元素的标记:
<edmx:ConceptualModels>
<Schema Namespace="DatabaseFirst.BloggingModel" ... >
<EntityType Name="Blog">
<Key>
<PropertyRef Name="BlogId" />
</Key>
<Property Name="BlogId" Type="InT32" ... />将PropertyRef和Property标记中的name属性更改为新的所需主键名称。
https://stackoverflow.com/questions/23072439
复制相似问题