
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
TreeSharp is a C# class library that simplifies working with tree structures in your code. With TreeSharp, you can easily build a list of items as a tree, and retrieve all children, parents, and leaves of a specific item within that tree.
TreeSharp is a C# class library that simplifies working with tree structures in your code. With TreeSharp, you can easily build a list of items as a tree, and retrieve all children, parents, and leaves of a specific item within that tree.
Kindly to check all change history in Github repository commits
GetTree
: builds a tree from a list of itemsGetChildren
: retrieves all children of a specific item in the treeGetParents
: retrieves all parents of a specific item in the treeGetLeaves
: retrieves all leaves (nodes with no children) of the treeInstall-Package TreeSharp.ex
Import the TreeSharp namespace in your C# project:
using TreeSharp.ex;
To build a tree from a list of items, use the GetTree
extension method:
var tree = items.GetTree(selector: item => item.Id, parent_selector: item => item.ParentId);
To retrieve all children of a specific item, use the GetChildren
extension method:
var children = item.GetChildren(selector: node => node.Id, parent_selector: node => node.ParentId);
To retrieve all parents of a specific item, use the GetParents
extension method:
var parents = item.GetParents(selector: node => node.Id, parent_selector: node => node.ParentId);
To retrieve all leaves of the tree, use the GetLeaves
extension method:
var leaves = tree.GetLeaves(selector: node => node.Id, parent_selector: node => node.ParentId);
Required Parameters:
selector
: represents the unique identifier of the node.parent_selector
: represents the identifier of the parent node.Optional Parameters:
start
: Represents the root node (could be null) or a node to start from.include_start_node
: Flag to determine whether to include the start value with the result or not.depth
: The depth level of building the tree or retrieving parents/children.Contributions are always welcome! If you find a bug or have a feature request, please open an issue. Pull requests are also accepted.
TreeSharp is Free Forever
FAQs
TreeSharp is a C# class library that simplifies working with tree structures in your code. With TreeSharp, you can easily build a list of items as a tree, and retrieve all children, parents, and leaves of a specific item within that tree.
We found that treesharp.ex demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.