I'm almost there. The closer I got is a 1 to 0..1 relationship.
My physical schema is:
User:
- Id : int primary Key identity
- Name : varchar(50)
UserDetail:
- Id : int primary Key | foreign key to User.Id
- DisplayName : varchar(200)
When I import this schama in the Entity Data Model Designer, Visual Studio 2010 suggests a 1 to 0..1 relationship. If I enforce 1..1 it accepts but the result doesn't look like a 1..1 relationship.
What do I expect from a 1..1 relationship?
I expect it to either:
- Automatically create a User when I create a UserDetail and vice-versa (preferable)
- Throw an exception when I try to save a User without a UserDetail and vice-versa
How can I accomplish that?