Linq 2 SQL One to Zero or One relationship possible?
Posted
by Mr. Flibble
on Stack Overflow
See other posts from Stack Overflow
or by Mr. Flibble
Published on 2009-12-17T13:28:40Z
Indexed on
2010/05/29
14:02 UTC
Read the original article
Hit count: 716
linq-to-sql
|one-to-one
Is it possible to create a one to zero or one relationship in Linq2SQL?
My understanding is that to create a one to one relationship you create a FK relationship on the PK of each table.
But you cannot make the PK nullable, so I don't see how to make a one to zero or one relationship work?
I'm using the designer to automatically create the model - so I would like to know how to set up the SQL tables to induce the relationship - not some custom ORM code.
© Stack Overflow or respective owner