J
Juan Dent
Hi,
I am trying to follow the How to: Define a model with single entity mapped
to two tables, but I am getting the following error as I validate the model:
EntitySets 'Store' and 'Customer' are both mapped to table 'Customer'. Their
primary keys may collide.
the mapping xml for the Store EntitySet is like so:
<EntitySetMapping Name="Store">
<EntityTypeMapping TypeName="IsTypeOf(AdventureWorksModel.Store)">
<MappingFragment StoreEntitySet="Customer">
<ScalarProperty Name="TerritoryID" ColumnName="TerritoryID" />
<ScalarProperty Name="CustomerID" ColumnName="CustomerID" />
<ScalarProperty Name="AccountNumber"
ColumnName="AccountNumber" />
<ScalarProperty Name="CustomerType"
ColumnName="CustomerType" />
<ScalarProperty Name="Cust_rowguid" ColumnName="rowguid" />
<ScalarProperty Name="Cust_ModifiedDate"
ColumnName="ModifiedDate" />
</MappingFragment>
<MappingFragment StoreEntitySet="Store">
<ScalarProperty Name="CustomerID" ColumnName="CustomerID" />
<ScalarProperty Name="Name" ColumnName="Name" />
<ScalarProperty Name="Demographics"
ColumnName="Demographics" />
<ScalarProperty Name="rowguid" ColumnName="rowguid" />
<ScalarProperty Name="ModifiedDate"
ColumnName="ModifiedDate" />
</MappingFragment>
</EntityTypeMapping>
</EntitySetMapping>
I am trying to follow the How to: Define a model with single entity mapped
to two tables, but I am getting the following error as I validate the model:
EntitySets 'Store' and 'Customer' are both mapped to table 'Customer'. Their
primary keys may collide.
the mapping xml for the Store EntitySet is like so:
<EntitySetMapping Name="Store">
<EntityTypeMapping TypeName="IsTypeOf(AdventureWorksModel.Store)">
<MappingFragment StoreEntitySet="Customer">
<ScalarProperty Name="TerritoryID" ColumnName="TerritoryID" />
<ScalarProperty Name="CustomerID" ColumnName="CustomerID" />
<ScalarProperty Name="AccountNumber"
ColumnName="AccountNumber" />
<ScalarProperty Name="CustomerType"
ColumnName="CustomerType" />
<ScalarProperty Name="Cust_rowguid" ColumnName="rowguid" />
<ScalarProperty Name="Cust_ModifiedDate"
ColumnName="ModifiedDate" />
</MappingFragment>
<MappingFragment StoreEntitySet="Store">
<ScalarProperty Name="CustomerID" ColumnName="CustomerID" />
<ScalarProperty Name="Name" ColumnName="Name" />
<ScalarProperty Name="Demographics"
ColumnName="Demographics" />
<ScalarProperty Name="rowguid" ColumnName="rowguid" />
<ScalarProperty Name="ModifiedDate"
ColumnName="ModifiedDate" />
</MappingFragment>
</EntityTypeMapping>
</EntitySetMapping>