AO.FolderStructure
1.1.0
dotnet add package AO.FolderStructure --version 1.1.0
NuGet\Install-Package AO.FolderStructure -Version 1.1.0
<PackageReference Include="AO.FolderStructure" Version="1.1.0" />
<PackageVersion Include="AO.FolderStructure" Version="1.1.0" />
<PackageReference Include="AO.FolderStructure" />
paket add AO.FolderStructure --version 1.1.0
#r "nuget: AO.FolderStructure, 1.1.0"
#:package AO.FolderStructure@1.1.0
#addin nuget:?package=AO.FolderStructure&version=1.1.0
#tool nuget:?package=AO.FolderStructure&version=1.1.0
This is reboot of my FolderBuilder project to modernize and simplify some things.
The point of this is to take any IEnumerable<T>
and convert it into a recursive folder structure based on some kind of path expression and separator character. I'm using it as part of KnowledgeBase.RCL to present a list of routes as a tree view, grouped by folder.
Install via NuGet package from my personal NuGet feed: AO.FolderStructure
There's a single public object: Folder. You initialize it from any IEnumerable<T>
like this, taken from the test. For example, here I have an array of NavEntry objects, and I'm converting it to a folder structure by Route
:
var routes = new NavEntry[]
{
new NavEntry() { Route = "Welcome", Href = "/help/kb/welcome.html" },
new NavEntry() { Route = "Setup/This", Href = "/help/kb/setup/this.html" },
new NavEntry() { Route = "Setup/That", Href = "/help/kb/setup/that.html" },
new NavEntry() { Route = "Setup/Other", Href = "/help/kb/setup/other.html" },
new NavEntry() { Route = "Ops/Thing1", Href = "/help/kb/ops/thing1.html" },
new NavEntry() { Route = "Ops/Thing2", Href = "/help/kb/ops/thing2.html" },
};
var folder = Folder<NavEntry>.From(routes, r => r.Route);
When serialized as json, it looks like this. The json is a bit verbose, so I decided not to show it here.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net9.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
1.1.0 | 151 | 6/22/2025 |