This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
I've added the tables aspnetUsers, aspnetRoles and aspnet_UsersInRoles into the designer and attempted to save the designer but was met with this error. Error 5 Column RoleId is mapped multiple times in entity AspnetUsersInRole D:\Projects\TFS2010\SalesNet\Release 17\Main\Source\SalesNet2009\Source\LightSpeedORM\SalesNetLightSpeedModel.lsmodel 0 1 LightSpeedORM Please advise if there is a way to circumvent this exception and still map the build in table into LS entities. |
|
|
It sounds like RoleId is trying to be used as a FK for more than one table? If so this is not supported. Your workaround for this is to disconnect one or all of the associations and manage loading the association from AspnetUsersInRole manually. e.g.
If you can send through a copy of your model I can make some more specific suggestions about this.
|
|
|
Unfortunately these are the built in aspnet_membership roles that are related to AspnetUsersInRole. Thus deleting the FK constraints will stop the many built in aspnet functionalities from working properly. |
|
|
Sorry for any mis-understanding, I am not suggesting that you delete the FK's in the database but rather remove one or more of the associations within your model to work around the issue you are seeing where more than one has been defined against RoleId.
|
|
|
I never add these tables to the model. Consider using the .NET abstractions for managing users and roles instead. |
|