I am using the ADO .NET Entity Framework to import my model from a database. A table in my db has a bunch of foreign keys, all with abstract names e.g. FKDevice132610
.
When I import the table into my model, it brings in navigation properties for each foreign key, however they are imported with names based on the table name they link to. If there is more than one foreign key to a certain table, a number is appended on the end.
In this case Devices1 is ParentDevices and Devices2 is ChildDevices. Is there a way I can enter this information into my foreign key (say using the description or the name) so that the Entity Framework will import meaningful names for my navigation properties?
As I know there is currently no way to do that. This is how current designer works. What is even worse when you rename these properties to correct names updating model from database will sometimes overwrite your changes.
Improvement of navigation property naming is tracked by this work item - http://entityframework.codeplex.com/workitem/125
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With