EntityFramework-Reverse-POCO-Code-First-Generator
EntityFramework-Reverse-POCO-Code-First-Generator copied to clipboard
GetWithMethod on OneToOne Relationship asserts table name as entity name
Hi, in my use-case I am using the "Entity" suffix for entity names (EFCore 3, v3.1.3). When generating foreign keys with a one-to-one relationship, the .HasForeignKey<T>() method is written out with the unaltered table name as T, which obviously won't compile in my case.
builder.HasOne(a => a.AppTransaction)
.WithOne(b => b.Issue)
.HasForeignKey<Issue>(c => c.AppTransactionId)...
vs
builder.HasOne(a => a.AppTransaction)
.WithOne(b => b.Issue)
.HasForeignKey<IssueEntity>(c => c.AppTransactionId)...
This can be seen in line 278 of GeneratorEfCore.cs, where the fkTableNameHumanCase parameter of GetWithMethod() is used for the entity type name.
Thanks so much for your attention to this issue.