Property Navigation Gets Incorrect Suffix (Dao) in 1:1 Relationship After Reverse Engineering #2909
Closed
2 of 3 tasks
Labels
question
Further information is requested
Uh oh!
There was an error while loading. Please reload this page.
Bug description / exact reproduction steps
Problem
When using EF Core Power Tools to reverse engineer the AreaSessions and AreaSessionAvailabilities tables, which are related in a 1:1 relationship via AreaSessionAvailabilities.AreaSessionId, the properties are being generated with the suffix Dao, which is incorrect. Specifically, the property in the generated AreaSessionDao class for the navigation to AreaSessionAvailabilityDao is generated as:
public virtual AreaSessionAvailabilityDao? AreaSessionAvailabilityDao { get; set; }
This should be generated as:
public virtual AreaSessionAvailabilityDao? AreaSessionAvailability { get; set; }
Steps to Reproduce
Configure reverse engineering in EF Core Power Tools for the AreaSessions and AreaSessionAvailabilities tables.
Set the following renaming for the tables:
AreaSessions -> AreaSessionDao
AreaSessionAvailabilities -> AreaSessionAvailabilityDao
Run the reverse engineering process.
The generated AreaSessionDao class includes a navigation property AreaSessionAvailabilityDao with the wrong suffix.
Expected Behavior
The property should be named AreaSessionAvailability (without the Dao suffix) in the generated AreaSessionDao class.
Additional Information
It would be helpful to allow customization or a configuration option to remove the automatic suffix added to navigation properties, especially in the case of 1:1 relationships.
There you have an example. To reproduce it, I use a SQL Server database to apply the reverse engineering
ISA.Assignments.Service.zip
Your code
Stack traces
EF Core Power Tools version
2.6.911
EF Core Power Tools CLI version
No response
Database provider
SQL Server
Target framework
.NET 8
IDE
No response
Additional features in use
The text was updated successfully, but these errors were encountered: