Very similar to this question
I've got a class:
public class RateOfExchange
{
public int RateOfExchangeID { get; set; }
public int CurrencyID { get; set; }
public int BaseCurrencyID { get; set; }
public virtual Currency Currency { get; set; }
public virtual Currency BaseCurrency { get; set; }
}
Using EF 6 Code First, I have no errors creating the model and seeding this table but both the Currency and BaseCurrency navigation properties are null when the application is run. The advice in the above question is to remove the delete on cascade configuration from each relationship which results in an exception being thrown on seeding - I don't think I'm setting up my relationship properly.
(as I'm writing this I've just figured out the syntax for this particular relationship, I'll post as an answer)