I read all the Google and SO pages about people who establish a one-to-one relationship in EF, but it just doesn't work for me.
Here is my model:
accounts:
public int Id {get; set;}
public virtual AccountConfig AccountConfig {get; set;}
Account Card:
HasKey(t => t.Id);
HasRequired(t => t.AccountConfig)
.WithOptional();
Account Configuration:
public int Id {get; set;}
public int AccountId {get; set;}
public virtual Account Account {get; set;}
Account Configuration:
HasKey(t => t.Id);
HasRequired(t => t.Account)
.WithOptional(t => t.AccountConfig);
When the property AccountConfigon Accountthe same NULL, and the property is Accounton AccountConfiga wrong entry (coincidentally obtained Account.Idcoincides with AccountConfig.Id, but I do not know what that means).
In the database, the table Accountdoes not have a record reference AccountConfig, but the table AccountConfighas a record reference Accountusing a column AccountId.
AccountConfig from Account ( ), Account AccountConfig.