Hi,
We are using Entity Developer to generate our Entity Framework model. We have a database with numerous tables, all of which have common fields Created_By and Modified_By that are foreign keys to a table named User_Info. When we generate the model, we end up with class properties for these as UserInfo and UserInfo1. Unfortunately it is very difficult to tell which one is the CreatedBy and which one is the Modified by. It is not consistent from table to table, and seems it had to do with the order in which the Foreign Keys were defined. It therefore makes it extremely difficult to implement any common logic around these fields.
1). Is there a way to have the code generated not use names such as UserInfo and UserInfo1 and use something like CreatedByUserInfo and ModifiedByUserInfo? Can this be done in a fashion that is not manual? We have so many tables and constantly changes that it is much easier for us to regenerate our model from scratch and not have to worry about manual changes.
2). If we can't change the names easily, is there anyway for it to not base on the order of the foreign keys? most people setting up tables should not be worrying about the order of the FK's (this typically would never matter)
Pam Crissman
Entity Developer and generated Foreign Key Names
Is there any update on this? We really use this tool on any database that will go into production when the foreign keys have names like ID1, ID2. Escpecially if there are multiple foreign keys.
This seems like something not hard to change. Just take the name of the parent Table, and add ID, or something of the like.
I can likely fix this be changing all my Primary Keys to instead of having 'ID' as their key to be 'ID' for a name... but a pain.
This seems like something not hard to change. Just take the name of the parent Table, and add ID, or something of the like.
I can likely fix this be changing all my Primary Keys to instead of having 'ID' as their key to be 'ID' for a name... but a pain.