public static XmlVaultDto FromRootBranch(IVault vault) { var root = XmlBranchDto.FromBranch(vault.Root ?? new Branch((VaultBase)vault, null, null)); return(new XmlVaultDto { Root = root }); }
public static XmlBranchDto FromBranch(IBranch branch) { return(new XmlBranchDto { Name = branch.Name, Metadata = ((Branch)branch).Metadata.Raw, Values = ((Branch)branch).GetValues(ValueKind.RegularAndInternal).Select(v => XmlValueDto.FromValue(v)).ToArray(), Branches = branch.GetBranches().Select(b => XmlBranchDto.FromBranch(b)).ToArray(), }); }