I think you did not make optional relation ship in mapping.
you should make Hasoptional
example
1 -Correct
HasOptional(t => t.Y)
.WithMany(t => t.X)
.Map(a => a.MapKey("YId"));
2-Incorrect
HasRequired(t => t.Y)
.WithMany(t => t.X)
.Map(a => a.MapKey("YId"));
you should make Hasoptional
example
1 -Correct
HasOptional(t => t.Y)
.WithMany(t => t.X)
.Map(a => a.MapKey("YId"));
2-Incorrect
HasRequired(t => t.Y)
.WithMany(t => t.X)
.Map(a => a.MapKey("YId"));