EntityFramework-Reverse-POCO-Code-First-Generator icon indicating copy to clipboard operation
EntityFramework-Reverse-POCO-Code-First-Generator copied to clipboard

One-to-one relationships and nullable reference types

Open mtanneryd opened this issue 2 years ago • 2 comments

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.

mtanneryd avatar Jan 19 '23 18:01 mtanneryd

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

sjh37 avatar Jan 21 '23 10:01 sjh37

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!

mtanneryd avatar Feb 17 '23 21:02 mtanneryd