Changed section data model
- Made parents nullable - Added a data key for the tree - Added depth for quicker layer-wise loading
This commit is contained in:
9 files changed
+716
-6
No files matched your search
@@ -35,6 +35,8 @@ public sealed class DataContext : DbContext
|
||||
|
||||
modelBuilder.Entity<Section>().HasIndex(n => n.Id);
|
||||
modelBuilder.Entity<Section>().HasIndex(n => n.Name);
|
||||
modelBuilder.Entity<Section>().HasIndex(n => n.Depth);
|
||||
modelBuilder.Entity<Section>().HasIndex(n => n.DataKey);
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -9,7 +9,11 @@ public sealed class Section
|
||||
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
public Section Parent { get; set; }
|
||||
public string DataKey { get; set; } = string.Empty;
|
||||
|
||||
public List<TextElement> TextElements { get; set; }
|
||||
public int Depth { get; set; } = 0;
|
||||
|
||||
public Section? Parent { get; set; }
|
||||
|
||||
public List<TextElement> TextElements { get; set; } = new();
|
||||
}
|
||||
Reference in new issue
Block a user