Build hierarchy instead of using Automapper

Add entities before removing them
This commit is contained in:
Geoffroy BONNEVILLE
2020-04-01 12:48:36 +02:00
parent 90c592d7ee
commit 57be6bb917
22 changed files with 84 additions and 77 deletions

View File

@@ -340,11 +340,11 @@ namespace ModernKeePass.Infrastructure.KeePass
private GroupEntity BuildHierarchy(GroupEntity parentGroup, PwGroup pwGroup)
{
var group = _mapper.Map<GroupEntity>(pwGroup);
group.Parent = parentGroup;
group.ParentGroup = parentGroup;
group.Entries = pwGroup.Entries.Select(e =>
{
var entry = _mapper.Map<EntryEntity>(e);
entry.Parent = group;
entry.ParentGroup = group;
return entry;
}).ToList();
group.SubGroups = pwGroup.Groups.Select(g => BuildHierarchy(group, g)).ToList();