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: 677

Filed under:
|

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

Related posts about linq-to-sql

Related posts about one-to-one