I have the following classes:
class Parent
{
public int ID;
public Child Child1;
public Child Child2;
}
class Child
{
public int ID;
public string Data;
}
Using DbModelBuilder I have the following Fluent API code:
EntityTypeConfiguration<Parent> adrInEgrul
= modelBuilder.Entity<Parent>();
adrInEgrul.HasKey(x => x.ID);
adrInEgrul.HasOptional(x => x.Child1)
.WithOptionalPrincipal();
adrInEgrul.HasOptional(x => x.Child2)
.WithOptionalPrincipal();
All this gives me the following tables:
But I do need the following ones:
I'll be happy to get what I want just fixing Fluent API part, but have no Idea how to do it (if it's possible at all).
Will appreciate any help.