I have the following classes.
class Zero
{
One One { get; set; }
int OneId { get; set; }
}
class One
{
Zero Zero { get; set}
}
modelBuilder.Entity<Zero>()
.HasRequired(e => e.One)
.WithOptional(a=>a.Zero)
.HasForeignKey(e => e.OneId);//<--error
there is no HasForeignKey
after WithOptional
, only after WithMany
What can I do to get the same results ?