copy of nested properties works now

This commit is contained in:
2021-11-17 13:33:12 +01:00
parent 936782935a
commit 8d9d52a08a
3 changed files with 76 additions and 31 deletions
+3 -1
View File
@@ -15,6 +15,8 @@ namespace zero.Core.Blueprints
{
public List<BlueprintField<T>> UnlockedFields { get; private set; } = new();
protected static string[] DefaultFields { get; set; } = new[] { "name", "alias", "key", "sort", "isActive", "hash", "languageId", "createdById", "createdDate", "lastModifiedById", "lastModifiedDate", "blueprint" };
public Blueprint() : base(typeof(T))
{
@@ -40,8 +42,8 @@ namespace zero.Core.Blueprints
}
// copy all properties which are synced from the blueprint to the model
ObjectTraverser.CopyProperties(blueprint, model, model.Blueprint.Desync);
ApplyDefaults(blueprint, model);
ObjectCloner.CopyProperties(blueprint, model, DefaultFields.Union(model.Blueprint.Desync).ToArray());
return model;
}