Entity Framework - Chaning the column names of an association table - by MikeVenkata

Status : 


Sign in
to vote
ID 542106 Comments
Status Active Workarounds
Type Bug Repros 0
Opened 3/15/2010 2:39:36 PM
Access Restriction Public


I have added aspnet_Users, aspnet_Roles, aspnet_UsersInRoles to the EDM designer using the option 'Generate model from database' and it created the aspnet_Users and aspnet_Roles as entities but created the aspnet_UsersInRoles as an association which is fine as it consists both of its columns as foreign keys to the aspnet_Users and aspnet_roles. 

But if you update the database using this model then it changes the aspnet_usersInRoles columns to aspnet_Roles_RoleId and aspnet_Users_UserId and the UserRegistration Service will throw an error while adding the users to the roles and says Invalid UserId and RoleId columns. 
Sign in to post a comment.
Posted by Microsoft on 6/1/2011 at 3:57 PM
Thank you for filing this issue. We have currently resolved this item as Won’t Fix. We are open to revisiting decisions in the future if the community has a large amount of votes on the issue. Thanks for your feedback!

Sarah McDevitt
Posted by Microsoft on 3/16/2010 at 1:24 PM
An additional note: If you reverse engineer the database with foreign keys exposed, then you should get a working experience when you forward engineer the database, since we'll pick up the foreign key names rather than making up new ones.
Posted by Microsoft on 3/16/2010 at 11:19 AM
Thank you very much for this feedback. This is a very reasonable scenario that we do not currently support, and one which we will evaluate for a future release. (In essence, it is a request for certain objects to be excluded from the database generation process.)
We are also, as per your point, working on generating database migration scripts. This feature is already released out of band and is available here:
Posted by MikeVenkata on 3/16/2010 at 8:17 AM
I forgot to add one more item that if you make a change to one entity and update the database with the model then it is dropping all entities and rebuilding the database with the new model, there should be a way to update only the changes to the tables in the database and not lose the data in the other tables if exists.

Posted by MikeVenkata on 3/16/2010 at 7:44 AM

Can you provide me a list of user scenarios that you have used to design the EDM so I would know what is the scope of this frame work? I am surprised that it is missing some obvious features of the data modeling as compare to the existing DM tools. It is a great concept but I would like to know why you guys have focused on more complex features then the basic features of the data modeling. For example sorting the entity columns and foriegn key mess. Any I would still give a thumbs up for the concept. :)

Posted by Microsoft on 3/16/2010 at 12:27 AM
Thanks for your feedback.

We are rerouting this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.

Thank you