Auto included must navigation properties in data model
This commit is contained in:
parent
6b49b3f3e7
commit
2b5de0aa1e
@ -37,6 +37,8 @@ public sealed class DataContext : DbContext
|
||||
modelBuilder.Entity<Section>().HasIndex(n => n.Name);
|
||||
modelBuilder.Entity<Section>().HasIndex(n => n.Depth);
|
||||
modelBuilder.Entity<Section>().HasIndex(n => n.DataKey);
|
||||
// modelBuilder.Entity<Section>().Navigation(n => n.Parent).AutoInclude(); // Cyclic reference, does not work, though.
|
||||
modelBuilder.Entity<Section>().Navigation(n => n.TextElements).AutoInclude();
|
||||
|
||||
#endregion
|
||||
|
||||
@ -45,6 +47,7 @@ public sealed class DataContext : DbContext
|
||||
modelBuilder.Entity<TextElement>().HasIndex(n => n.Id);
|
||||
modelBuilder.Entity<TextElement>().HasIndex(n => n.Code);
|
||||
modelBuilder.Entity<TextElement>().HasIndex(n => n.Name);
|
||||
modelBuilder.Entity<TextElement>().Navigation(n => n.Section).AutoInclude();
|
||||
|
||||
#endregion
|
||||
|
||||
@ -53,6 +56,7 @@ public sealed class DataContext : DbContext
|
||||
modelBuilder.Entity<Translation>().HasIndex(n => n.Id);
|
||||
modelBuilder.Entity<Translation>().HasIndex(n => n.Culture);
|
||||
modelBuilder.Entity<Translation>().HasIndex(n => n.Text);
|
||||
modelBuilder.Entity<Translation>().Navigation(n => n.TextElement).AutoInclude();
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user