sjh37 / EntityFramework-Reverse-POCO-Code-First-Generator

EntityFramework Reverse POCO Code First Generator - Beautifully generated code that is fully customisable. This generator creates code as if you reverse engineered a database and lovingly created the code by hand. It is free to academics (you need a .edu or a .ac email address), not free for commercial use. Obtain your licence from
https://www.reversepoco.co.uk/
Other
706 stars 230 forks source link

One-to-one relationships and nullable reference types #788

Open mtanneryd opened 1 year ago

mtanneryd commented 1 year ago

Hi!

I have a table, CompanyCredit, with a primary key that is also a foreign key to the primary key of another table, Company. So, I have a one-to-one mapping between CompanyCredit and Company. There are only entries in CompanyCredit for some of the companies so the nav prop CompanyCredit in Company needs to be nullable. But, currently I cannot get this to work in a project where nullable ref types are enabled.

sjh37 commented 1 year ago

Hi. Could you provide the SQL so I can create those tables to test with.

mtanneryd commented 1 year ago

I decided to disable the nullable ref types after having consulted chatGPT... :-) But, I'll come back to this as soon as I get some free time. Thanks for a wonderful product!