When I use a simple Master - Detail relationship
public class Master
{
public long ID { get; set; }
public virtual Detail Detail { get; set; }
}
public class Detail
{
public long ID { get; set; }
}
Code First creates the data model I would expect: The outer master table references the inner detail. When I change it in a way, that the Master references itself
public class Master
{
public long ID { get; set; }
public virtual Master Inner { get; set; }
}
Code First creates a data model where the inner master references the outer master. Why behaves Entity Framework different in that case? Can I correct this with data annotations (avoiding fluent api)?