msawczyn / EFDesigner2022

Entity Framework visual design surface and code-first code generation for EF6, Core and beyond
MIT License
123 stars 21 forks source link

Migration generates wrong Foreign Key column from correct model #52

Closed alprinias closed 1 year ago

alprinias commented 1 year ago

Hi, I have a bidirectional relation between the HabitatDistrict (principal) and HabitatDistrictEdges (dependent) classes, as shown in the picture: RelationDesigner In the relation properties I have defined the ForeignKey column name to be HabitatDistrict_Id, as shown in the picture: RelationProperties If I go to the generated xml, it looks correct. However, when I create the migration, in the code I see a second column generated, HabitatDistrictId, and that one defined as the Foreign Key: RelationMgration

All the above with VS2022, version 4.1.2 (not using the 4.2.x because I cannot see the designer at all), .net core 6.

Is this some kind of new feature of .net core 6? I older projects with VS2019, .net 3.14 and designer 3.7 it all worked as expected.

I can send the model if required.

All the best, Alex

alprinias commented 1 year ago

This is fixed in 4.2.3 nightly build (installed on 14 Nov 2022). Alex