I\'m trying to do a one-to-one relationship, with the navigation property just on one side (MVC4, EF5, code first).
public class User {
public int UserId { ge
OK, so i have copied your code and tried it and my answer has multiple parts:
An advice, try to see what's wrong with the configuration and with every change you make use SQL Server Management Studio or any other tool you have to check out the generated database schema to be sure it is what you wish it to be, plus if you don't need the configuration just don't use it.
1:1 code first in EF requires the dependent table to have the SAME primary key. Otherwise what you want to do will work.
EDIT Similar SO post Code First and Fluent API one to one relationship
Here is the MS EF site sample. http://msdn.microsoft.com/en-us/data/jj591620#RequiredToRequired