Продолжение

This commit is contained in:
2025-04-21 18:02:45 +04:00
parent beb61b7449
commit 35b571eb57
17 changed files with 388 additions and 227 deletions
+16 -1
View File
@@ -175,7 +175,8 @@ public partial class MainViewForm : Form
Converters = [
new EntityConverter(),
new StringEnumConverter { NamingStrategy = new CamelCaseNamingStrategy() },
]
],
ReferenceLoopHandling = ReferenceLoopHandling.Ignore,
};
string result = JsonConvert.SerializeObject(entity, settings);
@@ -195,6 +196,14 @@ public partial class MainViewForm : Form
.Include(a => a.AncestryBoosts)
.FirstOrDefault(e => e.Id == entity.Id);
case EntityType.Archetype:
return Context.Archetypes
.Include(a => a.DedicationFeat)
.ThenInclude(f => f.Entity)
.Include(a => a.Feats)
.ThenInclude(f => f.Entity)
.FirstOrDefault(a => a.Id == entity.Id);
case EntityType.Background:
return Context.Backgrounds
.Include(b => b.BackgroundBoosts)
@@ -211,6 +220,12 @@ public partial class MainViewForm : Form
.Include(c => c.ClassProgressions)
.FirstOrDefault(c => c.Id == entity.Id);
case EntityType.Feat:
return Context.Feats
.Include(f => f.Archetypes)
.ThenInclude(a => a.Entity)
.FirstOrDefault(f => f.Id == entity.Id);
default:
Type type = EntityOfTypeAttribute.Resolve(entity);
return (IEntity?) Context.Find(type, entity.Id);