ObjectTreeWalker 0.3.3
See the version list below for details.
dotnet add package ObjectTreeWalker --version 0.3.3
NuGet\Install-Package ObjectTreeWalker -Version 0.3.3
<PackageReference Include="ObjectTreeWalker" Version="0.3.3" />
paket add ObjectTreeWalker --version 0.3.3
#r "nuget: ObjectTreeWalker, 0.3.3"
// Install ObjectTreeWalker as a Cake Addin #addin nuget:?package=ObjectTreeWalker&version=0.3.3 // Install ObjectTreeWalker as a Cake Tool #tool nuget:?package=ObjectTreeWalker&version=0.3.3
ObjectGraphWalker
ObjectGraphWalker is a simple utility library that allows traversing over C# object properties, Node.js style. Under the hood, the class generates accessors that would speed up the traversal.
How to use
Simply instantiate the class and use the ObjectMemberIterator::Traverse()
method.
var someObject = new SomeObject();
var iterator = new ObjectMemberIterator();
iterator.Traverse(someObject, prop =>
{
var propertyValue = prop.GetValue();
prop.SetValue(/* some other value */);
});
Notes
- The iterator will read public and private properties and fields but will ignore any static members of the object.
- The iterator will work on both value and reference types
- The iterator will ignore backing fields for "auto properties" and it will ignore any compiler generated fields such as closures
- The iterator is still WIP and should be more thoroughly tested
- Additional configuration for iterator behavior is planned. See Issues tab for more information.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net6.0
- Microsoft.Extensions.ObjectPool (>= 6.0.9)
- Sigil (>= 5.0.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on ObjectTreeWalker:
Package | Downloads |
---|---|
RoguelikeToolkit.Entities
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
0.11.1 | 159 | 4/25/2024 |
0.11.0 | 86 | 4/25/2024 |
0.10.18 | 473 | 8/21/2023 |
0.10.14 | 134 | 7/6/2023 |
0.10.13 | 126 | 5/27/2023 |
0.10.11 | 170 | 4/4/2023 |
0.10.8 | 382 | 1/14/2023 |
0.10.7 | 249 | 1/14/2023 |
0.10.5 | 265 | 12/25/2022 |
0.10.4 | 258 | 12/24/2022 |
0.10.3 | 1,940 | 12/3/2022 |
0.10.2 | 288 | 12/3/2022 |
0.9.4 | 294 | 11/29/2022 |
0.9.3 | 272 | 11/29/2022 |
0.9.2 | 457 | 11/7/2022 |
0.9.1 | 406 | 10/20/2022 |
0.9.0 | 393 | 10/19/2022 |
0.8.3 | 370 | 10/19/2022 |
0.8.2 | 430 | 9/26/2022 |
0.8.1 | 401 | 9/26/2022 |
0.8.0 | 373 | 9/26/2022 |
0.7.1 | 397 | 9/24/2022 |
0.7.0 | 523 | 9/24/2022 |
0.6.0 | 418 | 9/24/2022 |
0.5.3 | 394 | 9/24/2022 |
0.5.2 | 379 | 9/24/2022 |
0.4.1 | 439 | 9/17/2022 |
0.3.3 | 419 | 9/17/2022 |
0.3.1 | 424 | 9/17/2022 |
Changes since version v0.2.1.0
:sparkles: New Features:
- [`0f6e7dd`](https://github.com/myarichuk/ObjectTreeWalker/commit/0f6e7dd1f735231cfab83b16a57e64770e238747) - inner implementation - object enumerator to compute and cache property/field graph per type *(commit by [@myarichuk](https://github.com/myarichuk))*
- [`219854d`](https://github.com/myarichuk/ObjectTreeWalker/commit/219854d6524da067f975171381b22fe9d690826f) - implement basic object member iterator functionality, probably will need more testing *(commit by [@myarichuk](https://github.com/myarichuk))*
:bug: Bug Fixes:
- [`48f9c6c`](https://github.com/myarichuk/ObjectTreeWalker/commit/48f9c6c7a91d9ac02b619a37125ddfbe15f5ca66) - ensure returning false when getter/setter is missing from property and trying to get/set value *(commit by [@myarichuk](https://github.com/myarichuk))*
- [`ced48d3`](https://github.com/myarichuk/ObjectTreeWalker/commit/ced48d3263d135598068039a179dfa65ed200096) - add object graph cache to ObjectEnumerator *(commit by [@myarichuk](https://github.com/myarichuk))*
- [`ee10271`](https://github.com/myarichuk/ObjectTreeWalker/commit/ee102713bc5624c1ce0c5d327c36be8599c81a88) - ensure backing properties will not get iterated on and also no trying to "parse" children of primitive fields/properties *(commit by [@myarichuk](https://github.com/myarichuk))*
:white_check_mark: Tests:
- [`5db4961`](https://github.com/myarichuk/ObjectTreeWalker/commit/5db4961700afbacbf51a6c77b50b866059408293) - basic tests for ObjectMemberIterator *(commit by [@myarichuk](https://github.com/myarichuk))*
:wrench: Chores:
- [`b5a918c`](https://github.com/myarichuk/ObjectTreeWalker/commit/b5a918c05681ec587fce8d86f089ee6eb4d856f4) - ensure perf test won't be packaged with "dotnet pack" *(commit by [@myarichuk](https://github.com/myarichuk))*