VOOZH about

URL: https://www.nuget.org/packages/ObjectTreeWalker/

⇱ NuGet Gallery | ObjectTreeWalker 0.12.3




ObjectTreeWalker 0.12.3

dotnet add package ObjectTreeWalker --version 0.12.3
 
 
NuGet\Install-Package ObjectTreeWalker -Version 0.12.3
 
 
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ObjectTreeWalker" Version="0.12.3" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ObjectTreeWalker" Version="0.12.3" />
 
Directory.Packages.props
<PackageReference Include="ObjectTreeWalker" />
 
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ObjectTreeWalker --version 0.12.3
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: ObjectTreeWalker, 0.12.3"
 
 
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ObjectTreeWalker@0.12.3
 
 
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ObjectTreeWalker&version=0.12.3
 
Install as a Cake Addin
#tool nuget:?package=ObjectTreeWalker&version=0.12.3
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

👁 Build & Test

ObjectGraphWalker

ObjectGraphWalker is a powerful utility library that enables seamless traversal over C# object properties and fields, Node.js style. Designed with performance and flexibility in mind, it leverages dynamic code generation and caching to provide efficient traversal capabilities.

Features

  • Fast Traversal: Utilizes dynamic code generation to create accessors that speed up traversal.
  • Flexible Filtering: Allows custom predicates to include or exclude specific members during traversal.
  • Support for Various Types: Works with both value and reference types, including generics and embedded structs.
  • Deep Cloning: Includes a high-performance deep clone extension method for complex object graphs.
  • Well-Tested: Includes comprehensive tests to ensure reliability and correctness.

Installation

Simply install the NuGet Package

Usage Examples

Simple Example

A basic example that demonstrates how to traverse an object and access its properties:

var someObject = new SomeObject();
var iterator = new ObjectMemberIterator();
iterator.Traverse(someObject, (in MemberAccessor accessor) =>
{
 var propertyValue = accessor.GetValue();
 prop.SetValue(/* some other value */);
});

Advanced Example

An advanced example that shows how to use predicates to filter members and control the traversal behavior:

var someObject = new SomeObject();
var iterator = new ObjectMemberIterator();
iterator.Traverse(someObject, (in MemberAccessor accessor) =>
{
 var propertyValue = accessor.GetValue();
 prop.SetValue(/* some other value */);

 //filtering for selective iteration is a simple lambda
}, (in MemberAccessor accessor) => accessor.Name != "Foo1" && accessor.MemberType != MemberType.Property);

Deep Cloning

You can easily create deep clones of any object using the provided extension method:

var someObject = new SomeObject();
var clone = someObject.DeepClone();

Notes

  • The iterator will read public and private properties and fields but will ignore any static members of the object.
  • The iterator will ignore backing fields for "auto properties" and any compiler-generated fields such as closures (unless specified in the constructor).
  • While the iterator is well-tested, there may be some bugs. If you encounter any issues, please open an issue with a description.

Contributing

Any contributions are welcome 😃

License

Product Versions Compatible and additional computed target framework versions.
.NET net5.0 net5.0 was computed.  net5.0-windows net5.0-windows was computed.  net6.0 net6.0 was computed.  net6.0-android net6.0-android was computed.  net6.0-ios net6.0-ios was computed.  net6.0-maccatalyst net6.0-maccatalyst was computed.  net6.0-macos net6.0-macos was computed.  net6.0-tvos net6.0-tvos was computed.  net6.0-windows net6.0-windows was computed.  net7.0 net7.0 was computed.  net7.0-android net7.0-android was computed.  net7.0-ios net7.0-ios was computed.  net7.0-maccatalyst net7.0-maccatalyst was computed.  net7.0-macos net7.0-macos was computed.  net7.0-tvos net7.0-tvos was computed.  net7.0-windows net7.0-windows was computed.  net8.0 net8.0 was computed.  net8.0-android net8.0-android was computed.  net8.0-browser net8.0-browser was computed.  net8.0-ios net8.0-ios was computed.  net8.0-maccatalyst net8.0-maccatalyst was computed.  net8.0-macos net8.0-macos was computed.  net8.0-tvos net8.0-tvos was computed.  net8.0-windows net8.0-windows was computed.  net9.0 net9.0 was computed.  net9.0-android net9.0-android was computed.  net9.0-browser net9.0-browser was computed.  net9.0-ios net9.0-ios was computed.  net9.0-maccatalyst net9.0-maccatalyst was computed.  net9.0-macos net9.0-macos was computed.  net9.0-tvos net9.0-tvos was computed.  net9.0-windows net9.0-windows was computed.  net10.0 net10.0 is compatible.  net10.0-android net10.0-android was computed.  net10.0-browser net10.0-browser was computed.  net10.0-ios net10.0-ios was computed.  net10.0-maccatalyst net10.0-maccatalyst was computed.  net10.0-macos net10.0-macos was computed.  net10.0-tvos net10.0-tvos was computed.  net10.0-windows net10.0-windows was computed. 
.NET Core netcoreapp3.0 netcoreapp3.0 was computed.  netcoreapp3.1 netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 netstandard2.1 is compatible. 
MonoAndroid monoandroid monoandroid was computed. 
MonoMac monomac monomac was computed. 
MonoTouch monotouch monotouch was computed. 
Tizen tizen60 tizen60 was computed. 
Xamarin.iOS xamarinios xamarinios was computed. 
Xamarin.Mac xamarinmac xamarinmac was computed. 
Xamarin.TVOS xamarintvos xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on ObjectTreeWalker:

Package Downloads
RoguelikeToolkit.Entities

Package Description

DeepCloneBenchmark

Package Description

IteratorBenchmark

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.12.3 163 3/16/2026
0.12.2 140 3/16/2026
0.11.1 541 4/25/2024
0.11.0 284 4/25/2024
0.10.18 852 8/21/2023
0.10.14 289 7/6/2023
0.10.13 358 5/27/2023
0.10.11 389 4/4/2023
0.10.8 602 1/14/2023
0.10.7 467 1/14/2023
0.10.5 473 12/25/2022
0.10.4 462 12/24/2022
0.10.3 2,218 12/3/2022
0.10.2 509 12/3/2022
0.9.4 489 11/29/2022
0.9.3 467 11/29/2022
0.9.2 660 11/7/2022
0.9.1 627 10/20/2022
0.9.0 593 10/19/2022
0.8.3 581 10/19/2022
Loading failed

:bug: Bug Fixes:
- [`bbfc4ca`](https://github.com/myarichuk/Library.Template/commit/bbfc4ca34650fca71e86bbaa3c177ca892bccf85) - ensure release is created (add missing parameter) *(commit by [@myarichuk](https://github.com/myarichuk))*