How to implement 1:1 relations without link in one entity?
public class Foo
{
public int Id { get; set; }
...
}
public class Bar
{
public int Id { get; set; }
public int FooId { get; set; }
public virtual Foo Foo { get; set; }
...
}
Fluent API:
Entity<Bar>.HasKey(bar => bar.FooId)
.HasRequired(bar=> bar.Foo)
.WithMany()
.HasForeignKey(p => p.FooId)
.WillCascadeOnDelete(false);
And its create one to many in db