Error 4 Error 3003: Problem in mapping fragments starting at line 814:All the key properties (Users.UserNumber) of the EntitySet Users must be mapped to all the key properties (UsersGroupsLK.GroupNumber, UsersGroupsLK.UserNumber) of table UsersGroupsLK.
C:\Projects\NPP\NPP\NPP\EFModels\CMS\CMSEFModel\CMSModel.edmx 815 15 CMSEFModel
I have a parent entity Users whose primary key is UserNumber.
The child entity is UserGroupsLK whose composite primary key is UserNumber & GroupNumber.
In order to flatten data and display in a View, I need the GroupNumber from the child entity on the Parent entity, so I copied the GroupNumber in the designer from the child entity and pasted it to the parent entity and added a mapping to the UsersGroupsLK
entity via the designer
Now, when trying to compile, I get the error.
Here is the XML in the designer where the error is (starting at:
wsyeager36
Member
385 Points
458 Posts
EntityFramework mapping issue
Feb 18, 2013 01:57 PM|LINK
I desperately need some help here...
Error 4 Error 3003: Problem in mapping fragments starting at line 814:All the key properties (Users.UserNumber) of the EntitySet Users must be mapped to all the key properties (UsersGroupsLK.GroupNumber, UsersGroupsLK.UserNumber) of table UsersGroupsLK. C:\Projects\NPP\NPP\NPP\EFModels\CMS\CMSEFModel\CMSModel.edmx 815 15 CMSEFModel
I have a parent entity Users whose primary key is UserNumber.
The child entity is UserGroupsLK whose composite primary key is UserNumber & GroupNumber.
In order to flatten data and display in a View, I need the GroupNumber from the child entity on the Parent entity, so I copied the GroupNumber in the designer from the child entity and pasted it to the parent entity and added a mapping to the UsersGroupsLK entity via the designer
Now, when trying to compile, I get the error.
Here is the XML in the designer where the error is (starting at:
<EntityTypeMapping TypeName="IsTypeOf(wmswebModel.User)">
Bill Yeager
MCP.Net, BCIP
Mark - MSFT
Contributor
7071 Points
435 Posts
Microsoft
Re: EntityFramework mapping issue
Feb 26, 2013 01:17 AM|LINK
Hi wsyeager,
Seems your same thread has right direction:
http://social.msdn.microsoft.com/Forums/en-US/adodotnetentityframework/thread/c1ce8946-9e44-466d-ae47-e3ba16c7a188
Best Regards
If you have any feedback about my replies, please contact msdnmg@microsoft.com
Microsoft One Code Framework