NuGet Gallery Feed for ExpressWalkerExpressWalker provides a generic way to examine and change any object graph in fashion similar to "Visitor Pattern". You can build generic hierarchy composition (visitor) that can visit and change any object's property, basing on configuration. Relies on expression trees while visiting objects (uses reflection only once while building a visitor). That's why IT IS WAY FASTER than custom solutions built with reflection.
It is protected from circular references so you can avoid exceptions. Provides fluent API which increases code readability in terms of guessing the hierarchy being built from the code. Some of functionalities: visiting properties by matching owner type, property name and type (or only property type), visiting collecitons and dictionary items, specifying depth, custom expression for changing property value, cloning etc.
//example 1 - IVisitor that visits properties by ownner type and property names and/or types (start from TypeWalker class):
var typeVisitor = TypeWalker<Parent>.Create()
.ForProperty<Parent, string>(p => p.TestString1, (old, met) => old + met)
.ForProperty<Child, DateTime>(p => p.TestDate1, (old, met) => old.AddYears(10))
.ForProperty<CommonType>((old, met) => new CommonType { CommonString = "..." })
.Build(depth:10, guard:new PropertyGuard(), supportsCloning: true);
//guard is protection against type-wise circular references. supportsCloning = false improves build time.
var parentClone = new Parent();
var propertyValues = new HashSet<PropertyValue>()
typeVisitor.Visit(parentObject, parentClone, depth:10, guard:new InstanceGuard(), values:propertyValues);
//guard is protection against instance-wise circular references. values will hold flat list of new/old values.
//example 2 - IVisitor that visits properties by explicit configuration (start from ManualWalker class):
var manualVisitor = ManualWalker.Create<A1>()
.Property<A1, DateTime>(a1 => a1.A1Date, (va1, met) => va1.AddYears(10))
.Element<A1, B1>(a1 => a1.B1, b1 =>
b1.Property<B1, string>(x => x.B1Name, (vb1, met) => vb1 + "Test2"))
.Collection<A1, B2>(a1 => a1.B2List, b2 => b2
.Property<B2, DateTime>(x => x.B2Date, (vb2, met) => vb2.AddYears(10)))
.Build();
manualVisitor.Visit(parentObject, blueprint:null, depth:10, guard:new InstanceGuard(), values:null);
//Paremeter 'met' in expressions above is optional metadata object set in design-time.
//It can be set by [VisitorMetadata] property attribute in visited class.
//e.g. in example above, there is [VisitorMetadata("AnyString")] on property Parent.TestString1.
//example 3 - IVisitor built and cached using the IVisitorsFactory:
//scenario for visitors of same settings built for different types:
var factory = new VisitorsFactory().WithSettings("name1", depth:5, usePropertyGuard:false, supportsCloning:false)
.ForProperty<int>((val, met) => 2)
.WithSettings("name6")
.ForProperty<Parent, string>( x => x.Name, (val, met) => "t");
var visitor1 = factory.GetVisitor("name1", typeof(Class1));
var visitor1a = factory.GetVisitor("name1", typeof(Class1));
var visitor2 = factory.GetVisitor("name1", typeof(Class2));
var visitor6 = factory.GetVisitor("name6", typeof(Class6));
//visitor1 == visitor1a --true
//visitor1 == visitor2 --false
Many thanks to Francisco José Rey Gozalo for contributing with ideas and solutions.
Read more on https://github.com/kopalite/ExpressWalkerhttps://www.nuget.org/packages/ExpressWalker/2018-12-08T01:09:31Zhttps://www.nuget.org/packages/ExpressWalker/2.1.0.1ExpressWalker 2.1.0.12018-04-01T14:14:20Z2018-12-08T01:08:28Zkopalitehttps://www.nuget.org/profiles/kopaliteExpressWalker provides a generic way to examine and change any object graph in fashion similar to "Visitor Pattern". You can build generic hierarchy composition (visitor) that can visit and change any object's property, basing on configuration. Relies on expression trees while visiting objects (uses reflection only once while building a visitor). That's why IT IS WAY FASTER than custom solutions built with reflection.
It is protected from circular references so you can avoid exceptions. Provides fluent API which increases code readability in terms of guessing the hierarchy being built from the code. Some of functionalities: visiting properties by matching owner type, property name and type (or only property type), visiting collecitons and dictionary items, specifying depth, custom expression for changing property value, cloning etc.
//example 1 - IVisitor that visits properties by ownner type and property names and/or types (start from TypeWalker class):
var typeVisitor = TypeWalker<Parent>.Create()
.ForProperty<Parent, string>(p => p.TestString1, (old, met) => old + met)
.ForProperty<Child, DateTime>(p => p.TestDate1, (old, met) => old.AddYears(10))
.ForProperty<CommonType>((old, met) => new CommonType { CommonString = "..." })
.Build(depth:10, guard:new PropertyGuard(), supportsCloning: true);
//guard is protection against type-wise circular references. supportsCloning = false improves build time.
var parentClone = new Parent();
var propertyValues = new HashSet<PropertyValue>()
typeVisitor.Visit(parentObject, parentClone, depth:10, guard:new InstanceGuard(), values:propertyValues);
//guard is protection against instance-wise circular references. values will hold flat list of new/old values.
//example 2 - IVisitor that visits properties by explicit configuration (start from ManualWalker class):
var manualVisitor = ManualWalker.Create<A1>()
.Property<A1, DateTime>(a1 => a1.A1Date, (va1, met) => va1.AddYears(10))
.Element<A1, B1>(a1 => a1.B1, b1 =>
b1.Property<B1, string>(x => x.B1Name, (vb1, met) => vb1 + "Test2"))
.Collection<A1, B2>(a1 => a1.B2List, b2 => b2
.Property<B2, DateTime>(x => x.B2Date, (vb2, met) => vb2.AddYears(10)))
.Build();
manualVisitor.Visit(parentObject, blueprint:null, depth:10, guard:new InstanceGuard(), values:null);
//Paremeter 'met' in expressions above is optional metadata object set in design-time.
//It can be set by [VisitorMetadata] property attribute in visited class.
//e.g. in example above, there is [VisitorMetadata("AnyString")] on property Parent.TestString1.
//example 3 - IVisitor built and cached using the IVisitorsFactory:
//scenario for visitors of same settings built for different types:
var factory = new VisitorsFactory().WithSettings("name1", depth:5, usePropertyGuard:false, supportsCloning:false)
.ForProperty<int>((val, met) => 2)
.WithSettings("name6")
.ForProperty<Parent, string>( x => x.Name, (val, met) => "t");
var visitor1 = factory.GetVisitor("name1", typeof(Class1));
var visitor1a = factory.GetVisitor("name1", typeof(Class1));
var visitor2 = factory.GetVisitor("name1", typeof(Class2));
var visitor6 = factory.GetVisitor("name6", typeof(Class6));
//visitor1 == visitor1a --true
//visitor1 == visitor2 --false
Many thanks to Francisco José Rey Gozalo for contributing with ideas and solutions.
Read more on https://github.com/kopalite/ExpressWalkerhttps://www.nuget.org/packages/ExpressWalker/1.4.0.2ExpressWalker 1.4.0.22016-09-10T07:10:17Z2018-12-08T01:08:32Zkopalitehttps://www.nuget.org/profiles/kopaliteExpressWalker provides a generic way to examine and change any object graph in fashion similar to "Visitor Pattern". You can build generic hierarchy composition (visitor) capable to "visit" and change any object's property, basing on configuration. Relies purely on expression trees while visiting objects (uses reflection only once while building a visitor). That's why IT IS WAY FASTER than custom solutions usually built with reflection.
It is optionally protected from circular references so you can avoid StackOverflowException easily. Provides fluent API while building a visitor which increases code readability in terms of recognizing the hierarchy being built right away from the code. Some of functionalities: are visiting properties by matching owner type and name (or only type), visiting through items in collecitons, specifying depth, custom expression for changing property value, cloning etc.
//example 1 - IVisitor that visits properties by property names and/or types (start from TypeWalker class):
var typeVisitor = TypeWalker<Parent>.Create()
.ForProperty<Parent, string>(p => p.TestString1, (old, met) => old + met)
.ForProperty<Child, DateTime>(p => p.TestDate1, (old, met) => old.AddYears(10))
.ForProperty<CommonType>((old, met) => new CommonType { CommonString = "..." })
.Build(depth:10, guard:new PropertyGuard(), supportsCloning: true);
//guard is protection against type-wise circular references. supportsCloning = false improves build time.
var parentClone = new Parent();
var propertyValues = new HashSet<PropertyValue>()
typeVisitor.Visit(parentObject, parentClone, depth:10, guard:new InstanceGuard(), values:propertyValues);
//guard is protection against instance-wise circular references. values will hold flat list of new/old values.
//example 2 - IVisitor that visits properties by explicit configuration (start from ManualWalker class):
var manualVisitor = ManualWalker.Create<A1>()
.Property<A1, DateTime>(a1 => a1.A1Date, (va1, met) => va1.AddYears(10))
.Element<A1, B1>(a1 => a1.B1, b1 =>
b1.Property<B1, string>(x => x.B1Name, (vb1, met) => vb1 + "Test2"))
.Collection<A1, B2>(a1 => a1.B2List, b2 => b2
.Property<B2, DateTime>(x => x.B2Date, (vb2, met) => vb2.AddYears(10)))
.Build();
var parentClone = new A1();
var propertyValues = new HashSet<PropertyValue>()
manualVisitor.Visit(parentObject, parentClone, depth:10, guard:new InstanceGuard(), values:propertyValues);
//Paremeter 'met' in expressions above is optional metadata object set in design-time.
//It can be set by [VisitorMetadata] property attribute in visited class.
//e.g. in example above, there is [VisitorMetadata("AnyString")] on property Parent.TestString1.
Many thanks to Francisco José Rey Gozalo for contributing with ideas and solutions.
Read more on https://github.com/kopalite/ExpressWalkerhttps://www.nuget.org/packages/ExpressWalker/1.4.0.1ExpressWalker 1.4.0.12016-09-08T13:02:32Z2018-12-08T01:08:32Zkopalitehttps://www.nuget.org/profiles/kopaliteExpressWalker provides a generic way to examine and change any object graph in fashion similar to "Visitor Pattern". You can build generic hierarchy composition (visitor) capable to "visit" and change any object's property, basing on configuration. Uses reflection only while building a visitor and relies purely on expression trees while visiting objects. That's why IT IS WAY FASTER than custom solutions usually built with reflection.
It is optionally protected from circular references so you can avoid StackOverflowException easily. Provides fluent API while building a visitor which increases code readability in terms of recognizing the hierarchy being built right away from the code. Some of functionalities: are visiting properties by matching owner type and name (or only type), visiting through items in collecitons, specifying depth, custom expression for changing property value, cloning etc.
//example 1 - IVisitor that visits properties by property names and/or types (start from TypeWalker class):
var typeVisitor = TypeWalker<Parent>.Create()
.ForProperty<Parent, string>(p => p.TestString1, (old, met) => old + met)
.ForProperty<Child, DateTime>(p => p.TestDate1, (old, met) => old.AddYears(10))
.ForProperty<CommonType>((old, met) => new CommonType { CommonString = "..." })
.Build();
var parentClone = new Parent();
var propertyValues = new HashSet<PropertyValue>()
typeVisitor.Visit(parentObject, parentClone, 10, new InstanceGuard(), propertyValues);
//example 2 - IVisitor that visits properties by explicit configuration (start from ManualWalker class):
var manualVisitor = ManualWalker.Create<A1>()
.Property<A1, DateTime>(a1 => a1.A1Date, (va1, met) => va1.AddYears(10))
.Element<A1, B1>(a1 => a1.B1, b1 =>
b1.Property<B1, string>(x => x.B1Name, (vb1, met) => vb1 + "Test2"))
.Collection<A1, B2>(a1 => a1.B2List, b2 => b2
.Property<B2, DateTime>(x => x.B2Date, (vb2, met) => vb2.AddYears(10)))
.Build();
var parentClone = new A1();
var propertyValues = new HashSet<PropertyValue>()
manualVisitor.Visit(parentObject, parentClone, 10, new InstanceGuard(), propertyValues);
//Paremeter 'met' in expressions above is optional metadata object set in design-time.
//It can be set by [VisitorMetadata] property attribute in visited class.
//e.g. in example above, there is [VisitorMetadata("AnyString")] on property Parent.TestString1.
Many thanks to Francisco José Rey Gozalo for contributing with ideas and solutions.
Read more on https://github.com/kopalite/ExpressWalkerhttps://www.nuget.org/packages/ExpressWalker/1.3.1.3ExpressWalker 1.3.1.32016-09-07T18:14:11Z2018-12-08T01:09:31Zkopalitehttps://www.nuget.org/profiles/kopaliteExpressWalker provides a generic way to examine and change any object graph in fashion similar to "Visitor Pattern". You can build generic hierarchy composition (visitor) capable to "visit" and change any object's property, basing on configuration. Uses reflection only while building a visitor and relies purely on expression trees while visiting objects. That's why IT IS WAY FASTER than custom solutions usually built with reflection.
It is optionally protected from circular references so you can avoid StackOverflowException easily. Provides fluent API while building a visitor which increases code readability in terms of recognizing the hierarchy being built right away from the code. Some of functionalities: are visiting properties by matching owner type and name (or only type), visiting through items in collecitons, specifying depth, custom expression for changing property value, cloning etc.
//example 1 - IVisitor that visits properties by property names and/or types (start from TypeWalker class):
var typeVisitor = TypeWalker<Parent>.Create()
.ForProperty<Parent, string>(p => p.TestString1, (old, met) => old + met)
.ForProperty<Child, DateTime>(p => p.TestDate1, (old, met) => old.AddYears(10))
.ForProperty<CommonType>((old, met) => new CommonType { CommonString = "..." })
.Build();
var parentClone = new Parent();
var propertyValues = new HashSet<PropertyValue>()
typeVisitor.Visit(parentObject, parentClone, 10, new InstanceGuard(), propertyValues);
//example 2 - IVisitor that visits properties by explicit configuration (start from ManualWalker class):
var manualVisitor = ManualWalker.Create<A1>()
.Property<A1, DateTime>(a1 => a1.A1Date, (va1, met) => va1.AddYears(10))
.Element<A1, B1>(a1 => a1.B1, b1 =>
b1.Property<B1, string>(x => x.B1Name, (vb1, met) => vb1 + "Test2"))
.Collection<A1, B2>(a1 => a1.B2List, b2 => b2
.Property<B2, DateTime>(x => x.B2Date, (vb2, met) => vb2.AddYears(10)))
.Build();
var parentClone = new A1();
var propertyValues = new HashSet<PropertyValue>()
manualVisitor.Visit(parentObject, parentClone, 10, new InstanceGuard(), propertyValues);
//Paremeter 'met' in expressions above is optional metadata object set in design-time.
//It can be set by [VisitorMetadata] property attribute in visited class.
//e.g. in example above, there is [VisitorMetadata("AnyString")] on property Parent.TestString1.
Many thanks to Francisco José Rey Gozalo for contributing with ideas and solutions.
Read more on https://github.com/kopalite/ExpressWalkerhttps://www.nuget.org/packages/ExpressWalker/1.3.1.2ExpressWalker 1.3.1.22016-09-07T03:54:39Z2018-12-08T01:08:31Zkopalitehttps://www.nuget.org/profiles/kopaliteExpressWalker provides a generic way to examine and change any object graph in fashion similar to "Visitor Pattern". You can build generic hierarchy composition (visitor) capable to "visit" and change any object's property, basing on configuration. Uses reflection only while building a visitor and relies purely on expression trees while visiting objects. That's why IT IS WAY FASTER than custom solutions usually built with reflection.
It is optionally protected from circular references so you can avoid StackOverflowException easily. Provides fluent API while building a visitor which increases code readability in terms of recognizing the hierarchy being built right away from the code. Some of functionalities: are visiting properties by matching owner type and name (or only type), visiting through items in collecitons, specifying depth, custom expression for changing property value, cloning etc.
//example 1 - IVisitor that visits properties by property names and/or types (start from TypeWalker class):
var typeVisitor = TypeWalker<Parent>.Create()
.ForProperty<Parent, string>(p => p.TestString1, (old, met) => old + met)
.ForProperty<Child, DateTime>(p => p.TestDate1, (old, met) => old.AddYears(10))
.ForProperty<CommonType>((old, met) => new CommonType { CommonString = "..." })
.Build();
var parentClone = new Parent();
var propertyValues = new HashSet<PropertyValue>()
typeVisitor.Visit(parentObject, parentClone, 10, new InstanceGuard(), propertyValues);
//example 2 - IVisitor that visits properties by explicit configuration (start from ManualWalker class):
var manualVisitor = ManualWalker.Create<A1>()
.Property<A1, DateTime>(a1 => a1.A1Date, (va1, met) => va1.AddYears(10))
.Element<A1, B1>(a1 => a1.B1, b1 =>
b1.Property<B1, string>(x => x.B1Name, (vb1, met) => vb1 + "Test2"))
.Collection<A1, B2>(a1 => a1.B2List, b2 => b2
.Property<B2, DateTime>(x => x.B2Date, (vb2, met) => vb2.AddYears(10)))
.Build();
var parentClone = new A1();
var propertyValues = new HashSet<PropertyValue>()
manualVisitor.Visit(parentObject, parentClone, 10, new InstanceGuard(), propertyValues);
//Paremeter 'met' in expressions above is optional metadata object set in design-time.
//It can be set by [VisitorMetadata] property attribute in visited class.
//e.g. in example above, there is [VisitorMetadata("AnyString")] on property Parent.TestString1.
Many thanks to Francisco José Rey Gozalo for contributing with ideas and solutions.
Read more on https://github.com/kopalite/ExpressWalkerhttps://www.nuget.org/packages/ExpressWalker/1.3.0.3ExpressWalker 1.3.0.32016-08-17T09:47:52Z2018-12-08T01:08:29Zkopalitehttps://www.nuget.org/profiles/kopaliteExpressWalker provides a generic way to examine and change any object graph in fashion similar to "Visitor Pattern". You can build generic hierarchy composition (visitor) capable to "visit" and change any object's property, basing on configuration. Uses reflection only while building a visitor and relies purely on expression trees while visiting objects. That's why IT IS WAY FASTER than custom solutions usually built with reflection.
It is optionally protected from circular references so you can avoid StackOverflowException easily. Provides fluent API while building a visitor which increases code readability in terms of recognizing the hierarchy being built right away from the code. Some of functionalities: are visiting properties by matching owner type and name (or only type), visiting through items in collecitons, specifying depth, custom expression for changing property value, cloning etc.
//example 1 - IVisitor that visits properties by property names and/or types (start from TypeWalker class):
var typeVisitor = TypeWalker<Parent>.Create()
.ForProperty<Parent, string>(p => p.TestString1, (old, met) => old + met)
.ForProperty<Child, DateTime>(p => p.TestDate1, (old, met) => old.AddYears(10))
.ForProperty<CommonType>((old, met) => new CommonType { CommonString = "..." })
.Build();
var parentClone = new Parent();
var propertyValues = new HashSet<PropertyValue>()
typeVisitor.Visit(parentObject, parentClone, 10, new InstanceGuard(), propertyValues);
//example 2 - IVisitor that visits properties by explicit configuration (start from ManualWalker class):
var manualVisitor = ManualWalker.Create<A1>()
.Property<A1, DateTime>(a1 => a1.A1Date, (va1, met) => va1.AddYears(10))
.Element<A1, B1>(a1 => a1.B1, b1 =>
b1.Property<B1, string>(x => x.B1Name, (vb1, met) => vb1 + "Test2"))
.Collection<A1, B2>(a1 => a1.B2List, b2 => b2
.Property<B2, DateTime>(x => x.B2Date, (vb2, met) => vb2.AddYears(10)))
.Build();
var parentClone = new A1();
var propertyValues = new HashSet<PropertyValue>()
manualVisitor.Visit(parentObject, parentClone, 10, new InstanceGuard(), propertyValues);
//Paremeter 'met' in expressions above is optional metadata object set in design-time.
//It can be set by [VisitorMetadata] property attribute in visited class.
//e.g. in example above, there is [VisitorMetadata("AnyString")] on property Parent.TestString1.
Many thanks to Francisco José Rey Gozalo for contributing with ideas and solutions.
Read more on https://github.com/kopalite/ExpressWalkerhttps://www.nuget.org/packages/ExpressWalker/1.3.0.2ExpressWalker 1.3.0.22016-08-17T05:26:28Z2018-12-08T01:08:28Zkopalitehttps://www.nuget.org/profiles/kopaliteExpressWalker provides a generic way to examine and change any object graph in fashion similar to "Visitor Pattern". You can build generic hierarchy composition (visitor) capable to "visit" and change any object's property, basing on configuration. Uses reflection only while building a visitor and relies purely on expression trees while visiting objects. That's why IT IS WAY FASTER than custom solutions usually built with reflection.
It is optionally protected from circular references so you can avoid StackOverflowException easily. Provides fluent API while building a visitor which increases code readability in terms of recognizing the hierarchy being built right away from the code. Some of functionalities: are visiting properties by matching owner type and name (or only type), visiting through items in collecitons, specifying depth, custom expression for changing property value, cloning etc.
//example 1 - IVisitor that visits properties by property names and/or types (start from TypeWalker class):
var typeVisitor = TypeWalker<Parent>.Create()
.ForProperty<Parent, string>(p => p.TestString1, (old, met) => old + met)
.ForProperty<Child, DateTime>(p => p.TestDate1, (old, met) => old.AddYears(10))
.ForProperty<CommonType>((old, met) => new CommonType { CommonString = "..." })
.Build();
var parentClone = new Parent();
var propertyValues = new HashSet<PropertyValue>()
typeVisitor.Visit(parentObject, parentClone, 10, new InstanceGuard(), propertyValues);
//example 2 - IVisitor that visits properties by explicit configuration (start from ManualWalker class):
var manualVisitor = ManualWalker.Create<A1>()
.Property<A1, DateTime>(a1 => a1.A1Date, (va1, met) => va1.AddYears(10))
.Element<A1, B1>(a1 => a1.B1, b1 =>
b1.Property<B1, string>(x => x.B1Name, (vb1, met) => vb1 + "Test2"))
.Collection<A1, B2>(a1 => a1.B2List, b2 => b2
.Property<B2, DateTime>(x => x.B2Date, (vb2, met) => vb2.AddYears(10)))
.Build();
var parentClone = new A1();
var propertyValues = new HashSet<PropertyValue>()
manualVisitor.Visit(parentObject, parentClone, 10, new InstanceGuard(), propertyValues);
//Paremeter 'met' in expressions above is optional metadata object set in design-time.
//It can be set by [VisitorMetadata] property attribute in visited class.
//e.g. in example above, there is [VisitorMetadata("AnyString")] on property Parent.TestString1.
Many thanks to Francisco José Rey Gozalo for contributing with ideas and solutions.
Read more on https://github.com/kopalite/ExpressWalkerhttps://www.nuget.org/packages/ExpressWalker/1.3.0.1ExpressWalker 1.3.0.12016-08-16T17:07:09Z2018-12-08T01:08:28Zkopalitehttps://www.nuget.org/profiles/kopaliteExpressWalker provides a generic way to examine and change any object graph in fashion similar to "Visitor Pattern". You can build generic hierarchy composition (visitor) capable to "visit" and change any object's property, basing on configuration. Uses reflection only while building a visitor and relies purely on expression trees while visiting objects. That's why IT IS WAY FASTER than custom solutions usually built with reflection.
It is optionally protected from circular references so you can avoid StackOverflowException easily. Provides fluent API while building a visitor which increases code readability in terms of recognizing the hierarchy being built right away from the code. Some of functionalities: are visiting properties by matching owner type and name (or only type), visiting through items in collecitons, specifying depth, custom expression for changing property value, cloning etc.
//example 1 - IVisitor that visits properties by property names and/or types (start from TypeWalker class):
var typeVisitor = TypeWalker<Parent>.Create()
.ForProperty<Parent, string>(p => p.TestString1, (old, met) => old + met)
.ForProperty<Child, DateTime>(p => p.TestDate1, (old, met) => old.AddYears(10))
.ForProperty<CommonType>((old, met) => new CommonType { CommonString = "..." })
.Build();
var parentClone = new Parent();
var propertyValues = new HashSet<PropertyValue>()
typeVisitor.Visit(parentObject, parentClone, 10, new InstanceGuard(), propertyValues);
//example 2 - IVisitor that visits properties by explicit configuration (start from ManualWalker class):
var manualVisitor = ManualWalker.Create<A1>()
.Property<A1, DateTime>(a1 => a1.A1Date, (va1, met) => va1.AddYears(10))
.Element<A1, B1>(a1 => a1.B1, b1 =>
b1.Property<B1, string>(x => x.B1Name, (vb1, met) => vb1 + "Test2"))
.Collection<A1, B2>(a1 => a1.B2List, b2 => b2
.Property<B2, DateTime>(x => x.B2Date, (vb2, met) => vb2.AddYears(10)))
.Build();
var parentClone = new A1();
var propertyValues = new HashSet<PropertyValue>()
manualVisitor.Visit(parentObject, parentClone, 10, new InstanceGuard(), propertyValues);
//Paremeter 'met' in expressions above is optional metadata object set in design-time.
//It can be set by [VisitorMetadata] property attribute in visited class.
//e.g. in example above, there is [VisitorMetadata("AnyString")] on property Parent.TestString1.
Many thanks to Francisco José Rey Gozalo for contributing with ideas and solutions.
Read more on https://github.com/kopalite/ExpressWalkerhttps://www.nuget.org/packages/ExpressWalker/1.2.0.2ExpressWalker 1.2.0.22016-08-16T05:43:00Z2018-12-08T01:08:29Zkopalitehttps://www.nuget.org/profiles/kopaliteExpressWalker provides a generic way to examine and change any object graph in fashion similar to "Visitor Pattern". You can build generic hierarchy composition (visitor) capable to "visit" and change any object's property, basing on configuration. Uses reflection only while building a visitor and relies purely on expression trees while visiting objects. That's why IT IS WAY FASTER than custom solutions usually built with reflection.
It is optionally protected from circular references so you can avoid StackOverflowException easily. Provides fluent API while building a visitor which increases code readability in terms of recognizing the hierarchy being built right away from the code. Some of functionalities: are visiting properties by matching owner type and name (or only type), visiting through items in collecitons, specifying depth, custom expression for changing property value, cloning etc.
//example 1 - IVisitor that visits properties by property names and/or types (start from TypeWalker class):
var typeVisitor = TypeWalker<Parent>.Create()
.ForProperty<Parent, string>(p => p.TestString1, (old, met) => old + met)
.ForProperty<Child, DateTime>(p => p.TestDate1, (old, met) => old.AddYears(10))
.ForProperty<CommonType>((old, met) => new CommonType { CommonString = "..." })
.Build();
var parentClone = new Parent();
var propertyValues = new HashSet<PropertyValue>()
typeVisitor.Visit(parentObject, parentClone, 10, new InstanceGuard(), propertyValues);
//example 2 - IVisitor that visits properties by explicit configuration (start from ManualWalker class):
var manualVisitor = ManualWalker.Create<A1>()
.Property<A1, DateTime>(a1 => a1.A1Date, (va1, met) => va1.AddYears(10))
.Element<A1, B1>(a1 => a1.B1, b1 =>
b1.Property<B1, string>(x => x.B1Name, (vb1, met) => vb1 + "Test2"))
.Collection<A1, B2>(a1 => a1.B2List, b2 => b2
.Property<B2, DateTime>(x => x.B2Date, (vb2, met) => vb2.AddYears(10)))
.Build();
var parentClone = new A1();
var propertyValues = new HashSet<PropertyValue>()
manualVisitor.Visit(parentObject, parentClone, 10, new InstanceGuard(), propertyValues);
//Paremeter 'met' in expressions above is optional metadata object set in design-time.
//It can be set by [VisitorMetadata] property attribute in visited class.
//e.g. in example above, there is [VisitorMetadata("AnyString")] on property Parent.TestString1.
Many thanks to Francisco José Rey Gozalo for contributing with ideas and solutions.
Read more on https://github.com/kopalite/ExpressWalkerhttps://www.nuget.org/packages/ExpressWalker/1.2.0.1ExpressWalker 1.2.0.12016-08-09T20:48:53Z2018-12-08T01:08:28Zkopalitehttps://www.nuget.org/profiles/kopaliteExpressWalker provides a generic way to examine and change any object graph in fashion similar to "Visitor Pattern". You can build generic hierarchy composition (visitor) capable to "visit" and change any object's property, basing on configuration. Uses reflection only while building a visitor and relies purely on expression trees while visiting objects. That's why IT IS WAY FASTER than custom solutions usually built with reflection.
It is optionally protected from circular references so you can avoid StackOverflowException easily. Provides fluent API while building a visitor which increases code readability in terms of recognizing the hierarchy being built right away from the code. Some of functionalities: are visiting properties by matching owner type and name (or only type), visiting through items in collecitons, specifying depth, custom expression for changing property value, cloning etc.
//example 1 - IVisitor that visits properties by property names and/or types (start from TypeWalker class):
var typeVisitor = TypeWalker<Parent>.Create()
.ForProperty<Parent, string>(p => p.TestString1, (old, met) => old + met)
.ForProperty<Child, DateTime>(p => p.TestDate1, (old, met) => old.AddYears(10))
.ForProperty<CommonType>((old, met) => new CommonType { CommonString = "..." })
.Build();
var parentClone = new Parent();
var propertyValues = new HashSet<PropertyValue>()
typeVisitor.Visit(parentObject, parentClone, 10, new InstanceGuard(), propertyValues);
//example 2 - IVisitor that visits properties by explicit configuration (start from ManualWalker class):
var manualVisitor = ManualWalker.Create<A1>()
.Property<A1, DateTime>(a1 => a1.A1Date, (va1, met) => va1.AddYears(10))
.Element<A1, B1>(a1 => a1.B1, b1 =>
b1.Property<B1, string>(x => x.B1Name, (vb1, met) => vb1 + "Test2"))
.Collection<A1, B2>(a1 => a1.B2List, b2 => b2
.Property<B2, DateTime>(x => x.B2Date, (vb2, met) => vb2.AddYears(10)))
.Build();
var parentClone = new A1();
var propertyValues = new HashSet<PropertyValue>()
manualVisitor.Visit(parentObject, parentClone, 10, new InstanceGuard(), propertyValues);
//Paremeter 'met' in expressions above is optional metadata object set in design-time.
//It can be set by [VisitorMetadata] property attribute in visited class.
//e.g. in example above, there is [VisitorMetadata("AnyString")] on property Parent.TestString1.
Many thanks to Francisco José Rey Gozalo for contributing with ideas and solutions.
Read more on https://github.com/kopalite/ExpressWalkerhttps://www.nuget.org/packages/ExpressWalker/1.1.0.5ExpressWalker 1.1.0.52016-08-07T13:28:56Z2018-12-08T01:08:28Zkopalitehttps://www.nuget.org/profiles/kopaliteExpressWalker provides a generic way to examine and change any object graph in fashion similar to "Visitor Pattern". You can build generic hierarchy composition (visitor) capable to "visit" and change any object's property, basing on configuration. Uses reflection only while building a visitor and relies purely on expression trees while visiting objects. That's why IT IS WAY FASTER than custom solutions usually built with reflection.
It is optionally protected from circular references so you can avoid StackOverflowException easily. Provides fluent API while building a visitor which increases code readability in terms of recognizing the hierarchy being built right away from the code. Some of functionalities available are visiting properties by matching owner type and name (or only type), specifying depth of visit, custom expression for changing property value, clonging etc.
//example 1 - IVisitor that visits properties by property names and/or types (start from TypeWalker class):
var typeVisitor = TypeWalker<Parent>.Create()
.ForProperty<Parent, string>(p => p.TestString1, (old, met) => old + met)
.ForProperty<Child, DateTime>(p => p.TestDate1, (old, met) => old.AddYears(10))
.ForProperty<CommonType>((old, met) => new CommonType { CommonString = "..." })
.Build();
var parentClone = new Parent();
var propertyValues = new HashSet<PropertyValue>()
typeVisitor.Visit(parentObject, parentClone, 10, new InstanceGuard(), propertyValues);
//example 2 - IVisitor that visits properties by explicit configuration (start from ManualWalker class):
var manualVisitor = ManualWalker.Create<A1>()
.Property<A1, DateTime>(a1 => a1.A1Date, (va1, met) => va1.AddYears(10))
.Element<A1, B1>(a1 => a1.B1, b1 =>
b1.Property<B1, string>(x => x.B1Name, (vb1, met) => vb1 + "Test2"))
.Element<A1, B2>(a1 => a1.B2, b2 => b2
.Property<B2, DateTime>(x => x.B2Date, (vb2, met) => vb2.AddYears(10)))
.Build();
var parentClone = new A1();
var propertyValues = new HashSet<PropertyValue>()
manualVisitor.Visit(parentObject, parentClone, 10, new InstanceGuard(), propertyValues);
//Paremeter 'met' in expressions above is optional metadata object set in design-time.
//It can be set by [VisitorMetadata] property attribute in visited class.
//e.g. in example above, there is [VisitorMetadata("AnyString")] on property Parent.TestString1.
Many thanks to Francisco José Rey Gozalo for contributing with ideas and solutions.
Read more on https://github.com/kopalite/ExpressWalkerhttps://www.nuget.org/packages/ExpressWalker/1.1.0.4ExpressWalker 1.1.0.42016-08-07T11:24:16Z2018-12-08T01:08:28Zkopalitehttps://www.nuget.org/profiles/kopaliteExpressWalker provides a generic way to examine and change any object graph in fashion similar to "Visitor Pattern". You can build generic hierarchy composition (visitor) capable to "visit" and change any object's property, basing on configuration. Uses reflection only while building a visitor and relies purely on expression trees while visiting objects. That's why IT IS WAY FASTER than custom solutions usually built with reflection.
It is optionally protected from circular references so you can avoid StackOverflowException easily. Provides fluent API while building a visitor which increases code readability in terms of recognizing the hierarchy being built right away from the code. Some of functionalities available are visiting properties by matching owner type and name (or only type), specifying depth of visit, custom expression for changing property value, clonging etc.
//example 1 - IVisitor that visits properties by property names and/or types (start from TypeWalker class):
var typeVisitor = TypeWalker<Parent>.Create()
.ForProperty<Parent, string>(p => p.TestString1, (old, met) => old + met)
.ForProperty<Child, DateTime>(p => p.TestDate1, (old, met) => old.AddYears(10))
.ForProperty<CommonType>((old, met) => new CommonType { CommonString = "..." })
.Build();
var parentClone = new Parent();
var propertyValues = new HashSet<PropertyValue>()
typeVisitor.Visit(parentObject, parentClone, 10, new InstanceGuard(), propertyValues);
//example 2 - IVisitor that visits properties by explicit configuration (start from ManualWalker class):
var manualVisitor = ManualWalker.Create<A1>()
.Property<A1, DateTime>(a1 => a1.A1Date, (va1, met) => va1.AddYears(10))
.Element<A1, B1>(a1 => a1.B1, b1 =>
b1.Property<B1, string>(x => x.B1Name, (vb1, met) => vb1 + "Test2"))
.Element<A1, B2>(a1 => a1.B2, b2 => b2
.Property<B2, DateTime>(x => x.B2Date, (vb2, met) => vb2.AddYears(10)))
.Build();
var parentClone = new A1();
var propertyValues = new HashSet<PropertyValue>()
manualVisitor.Visit(parentObject, parentClone, 10, new InstanceGuard(), propertyValues);
//Paremeter 'met' in expressions above is optional metadata object set in design-time.
//It can be set by [VisitorMetadata] property attribute in visited class.
//e.g. in example above, there is [VisitorMetadata("AnyString")] on property Parent.TestString1.
Many thanks to Francisco José Rey Gozalo for contributing with ideas and solutions.
Read more on https://github.com/kopalite/ExpressWalkerhttps://www.nuget.org/packages/ExpressWalker/1.1.0.3ExpressWalker 1.1.0.32016-08-07T10:34:33Z2018-12-08T01:08:29Zkopalitehttps://www.nuget.org/profiles/kopaliteExpressWalker provides a generic way to examine and change any object graph in fashion similar to "Visitor Pattern". You can build generic hierarchy composition (visitor) capable to "visit" and change any object's property, basing on configuration. Uses reflection only while building a visitor and relies purely on expression trees while visiting objects. That's why IT IS WAY FASTER than custom solutions usually built with reflection.
It is optionally protected from circular references so you can avoid StackOverflowException easily. Provides fluent API while building a visitor which increases code readability in terms of recognizing the hierarchy being built right away from the code. Some of functionalities available are visiting properties by matching owner type and name (or only type), specifying depth of visit, custom expression for changing property value, clonging etc.
//example 1 - IVisitor that visits properties by property names and/or types (start from TypeWalker class):
var typeVisitor = TypeWalker<Parent>.Create()
.ForProperty<Parent, string>(p => p.TestString1, (old, met) => old + met)
.ForProperty<Child, DateTime>(p => p.TestDate1, (old, met) => old.AddYears(10))
.ForProperty<CommonType>((old, met) => new CommonType { CommonString = "..." })
.Build();
var parentClone = new Parent();
var propertyValues = new HashSet<PropertyValue>()
typeVisitor.Visit(parentObject, parentClone, 10, new InstanceGuard(), propertyValues);
//example 2 - IVisitor that visits properties by explicit configuration (start from ManualWalker class):
var manualVisitor = ManualWalker.Create<A1>()
.Property<A1, DateTime>(a1 => a1.A1Date, (va1, met) => va1.AddYears(10))
.Element<A1, B1>(a1 => a1.B1, b1 =>
b1.Property<B1, string>(x => x.B1Name, (vb1, met) => vb1 + "Test2"))
.Element<A1, B2>(a1 => a1.B2, b2 => b2
.Property<B2, DateTime>(x => x.B2Date, (vb2, met) => vb2.AddYears(10)))
.Build();
var parentClone = new A1();
var propertyValues = new HashSet<PropertyValue>()
manualVisitor.Visit(parentObject, parentClone, 10, new InstanceGuard(), propertyValues);
//Paremeter 'met' in expressions above is optional metadata object set in design-time.
//It can be set by [VisitorMetadata] property attribute in visited class.
//e.g. in example above, there is [VisitorMetadata("AnyString")] on property Parent.TestString1.
Many thanks to Francisco José Rey Gozalo for contributing with ideas and solutions.
Read more on https://github.com/kopalite/ExpressWalkerhttps://www.nuget.org/packages/ExpressWalker/1.1.0.2ExpressWalker 1.1.0.22016-08-07T10:30:09Z2018-12-08T01:08:29Zkopalitehttps://www.nuget.org/profiles/kopaliteExpressWalker provides a generic way to examine and change any object graph in fashion similar to "Visitor Pattern". You can build generic hierarchy composition (visitor) capable to "visit" and change any object's property, basing on configuration. Uses reflection only while building a visitor and relies purely on expression trees while visiting objects. That's why IT IS WAY FASTER than custom solutions usually built with reflection.
It is optionally protected from circular references so you can avoid StackOverflowException easily. Provides fluent API while building a visitor which increases code readability in terms of recognizing the hierarchy being built right away from the code. Some of functionalities available are visiting properties by matching owner type and name (or only type), specifying depth of visit, custom expression for changing property value, clonging etc.
//example 1 - IVisitor that visits properties by property names and/or types (start from TypeWalker class):
var typeVisitor = TypeWalker<Parent>.Create()
.ForProperty<Parent, string>(p => p.TestString1, null, (old, met) => old + met)
.ForProperty<Child, DateTime>(p => p.TestDate1, null, (old, met) => old.AddYears(10))
.ForProperty<CommonType>(null, (old, met) => new CommonType { CommonString = "..." })
.Build();
var parentClone = new Parent();
var propertyValues = new HashSet<PropertyValue>()
typeVisitor.Visit(parentObject, parentClone, 10, new InstanceGuard(), propertyValues);
//example 2 - IVisitor that visits properties by explicit configuration (start from ManualWalker class):
var manualVisitor = ManualWalker.Create<A1>()
.Property<A1, DateTime>(a1 => a1.A1Date, (va1, met) => va1.AddYears(10))
.Element<A1, B1>(a1 => a1.B1, b1 =>
b1.Property<B1, string>(x => x.B1Name, (vb1, met) => vb1 + "Test2"))
.Element<A1, B2>(a1 => a1.B2, b2 => b2
.Property<B2, DateTime>(x => x.B2Date, (vb2, met) => vb2.AddYears(10)))
.Build();
var parentClone = new A1();
var propertyValues = new HashSet<PropertyValue>()
manualVisitor.Visit(parentObject, parentClone, 10, new InstanceGuard(), propertyValues);
//Paremeter 'met' in expressions above is optional metadata object set in design-time.
//It can be set by [VisitorMetadata] property attribute in visited class.
//e.g. in example above, there is [VisitorMetadata("AnyString")] on property Parent.TestString1.
Many thanks to Francisco José Rey Gozalo for contributing with ideas and solutions.
Read more on https://github.com/kopalite/ExpressWalkerhttps://www.nuget.org/packages/ExpressWalker/1.0.0.12ExpressWalker 1.0.0.122016-08-04T12:52:53Z2018-12-08T01:08:30Zkopalitehttps://www.nuget.org/profiles/kopaliteExpressWalker provides a generic way to examine and change any object graph in fashion similar to "Visitor Pattern". You can build generic hierarchy composition (visitor) capable to "visit" and change any object's property, basing on configuration. Uses reflection only while building a visitor and relies purely on expression trees while visiting objects. That's why IT IS WAY FASTER than custom solutions usually built with reflection.
It is optionally protected from circular references so you can avoid StackOverflowException easily. Provides fluent API while building a visitor which increases code readability in terms of recognizing the hierarchy being built right away from the code. Some of functionalities available are visiting properties by matching owner type and name (or only type), specifying depth of visit, custom expression for changing property value, clonging etc.
//example of usage:
var visitor = TypeWalker<Parent>.Create()
.ForProperty<Parent, string>(p => p.TestString1, null, (old, met) => old + met)
.ForProperty<Child, DateTime>(p => p.TestDate1, null, (old, met) => old.AddYears(10))
.ForProperty<CommonType>(null, (old, met) => new CommonType { CommonString = "..." })
.Build();
var parentClone = new Parent();
visitor.Visit(parentObject, parentClone, 10, new InstanceGuard());
Many thanks to Francisco José Rey Gozalo for contributing with ideas and solutions.
Read more on https://github.com/kopalite/ExpressWalkerhttps://www.nuget.org/packages/ExpressWalker/1.0.0.10ExpressWalker 1.0.0.102016-08-03T13:13:16Z2018-12-08T01:08:31Zkopalitehttps://www.nuget.org/profiles/kopaliteExpressWalker provides a generic way to examine and change any object graph in fashion similar to "Visitor Pattern". You can build generic hierarchy composition (visitor) capable to "visit" and change any object's property, basing on configuration. Uses reflection only while building a visitor and relies purely on expression trees while visiting objects. That's why IT IS WAY FASTER than custom solutions usually built with reflection.
It is optionally protected from circular references so you can avoid StackOverflowException easily. Provides fluent API while building a visitor which increases code readability in terms of recognizing the hierarchy being built right away from the code. Some of functionalities available are visiting properties by matching owner type and name (or only type), specifying depth of visit, custom expression for changing property value, clonging etc.
//example of usage:
var visitor = TypeWalker<Parent>.Create()
.ForProperty<Parent, string>(p => p.TestString1, null, (old, met) => old + met)
.ForProperty<Child, DateTime>(p => p.TestDate1, null, (old, met) => old.AddYears(10))
.ForProperty<CommonType>(null, (old, met) => new CommonType { CommonString = "..." })
.Build();
var parentClone = new Parent();
visitor.Visit(parentObject, parentClone, 10, new InstanceGuard());
Many thanks to Francisco José Rey Gozalo for contributing with ideas and solutions.
Read more on https://github.com/kopalite/ExpressWalkerhttps://www.nuget.org/packages/ExpressWalker/1.0.0.9ExpressWalker 1.0.0.92016-08-03T12:11:08Z2018-12-08T01:08:31Zkopalitehttps://www.nuget.org/profiles/kopaliteExpressWalker provides a generic way to examine and change any object graph in fashion similar to "Visitor Pattern". You can build generic hierarchy composition (visitor) capable to "visit" and change any property, basing on configuration. Uses refleciton only while building a visitor and relies purely on expression trees while visiting objects. That's why IT IS WAY FASTER than custom solutions usually built with reflection.
It is optionally protected from circular references so you can avoid StackOverflowException easily. Provides fluent API while building a visitor which increases code readability in terms of recognizing the hierarchy being built right away from the code. Some of functionalities available are visiting properties by matching owner type and name (or only type), specifying depth of visit, custom expression for changing property value, clonging etc.
//example of usage:
var visitor = TypeWalker<Parent>.Create()
.ForProperty<Parent, string>(p => p.TestString1, null, (old, met) => old + met)
.ForProperty<Child, DateTime>(p => p.TestDate1, null, (old, met) => old.AddYears(10))
.ForProperty<CommonType>(null, (old, met) => new CommonType { CommonString = "..." })
.Build();
var parentClone = new Parent();
visitor.Visit(parentObject, parentClone, 10, new InstanceGuard());
Many thanks to Francisco José Rey Gozalo for contributing with ideas and solutions.
Read more on https://github.com/kopalite/ExpressWalkerhttps://www.nuget.org/packages/ExpressWalker/1.0.0.8ExpressWalker 1.0.0.82016-08-03T12:05:07Z2018-12-08T01:08:31Zkopalitehttps://www.nuget.org/profiles/kopaliteExpressWalker provides a generic way to examine and change any object graph in fashion similar to "Visitor Pattern". You can build generic hierarchy composition (visitor) capable to "visit" and change any property, basing on configuration. Uses refleciton only while building a visitor and relies purely on expression trees while visiting objects.
That's why IT IS WAY FASTER than custom solutions usually built with reflection.
It is optionally protected from circular references so you can avoid StackOverflowException easily. Provides fluent API while building a visitor which increases code readability in terms of recognizing the hierarchy being built right away from the code. The optional and configurable things available are:
- visiting properties by matching owner type and property name
- visiting properties by matching property type only
- specifying depth of visit in run-time (not during configuration)
- custom expression for changing property value
- cloning of visited object
- etc.
//building a visitor + visiting an object (with optional clone, visit depth and circular reference protection):
var visitor = TypeWalker<Parent>.Create()
.ForProperty<Parent, string>(p => p.TestString1, null, (old, met) => old + met)
.ForProperty<Child, DateTime>(p => p.TestDate1, null, (old, met) => old.AddYears(10))
.ForProperty<CommonType>(null, (old, met) => new CommonType { CommonString = "..." })
.Build();
var parentClone = new Parent();
visitor.Visit(parentObject, parentClone, 10, new InstanceGuard());
// The properties that are being visited and change here are:
// 1. 'TestString1' property of Parent objects, anywhere in Parent's hierarchy
// 2. 'TestDate1' property of Child objects, anywhere in Parent's hierarchy
// 3. Any property of type CommonType, anywhere in Parent's hierarchy
//Property setter: new value for property 'TestString1' is set by compiled expression '(old, met) => old + met'
//'old' is old value, 'met' is metadata obj. coming from [VisitorMetadata] attribute on 'TestString1' property.
There is also an option of ManualWaler for building more specific visitor that will visit only nodes in specific place in object graph (e.g. only a 'Child' element at level 3 and only it's 'TestString1' property).
Many thanks to Francisco José Rey Gozalo for contributing with ideas and solutions.https://www.nuget.org/packages/ExpressWalker/1.0.0.7ExpressWalker 1.0.0.72016-08-03T12:00:29Z2018-12-08T01:08:31Zkopalitehttps://www.nuget.org/profiles/kopaliteExpressWalker provides a generic way to examine and change any object graph in fashion similar to "Visitor Pattern". You can build generic hierarchy composition (visitor) capable to "visit" and change any property, basing on configuration. Uses refleciton only while building a visitor and relies purely on expression trees while visiting objects.
That's why IT IS WAY FASTER than custom solutions usually built with reflection.
It is optionally protected from circular references so you can avoid StackOverflowException easily. Provides fluent API while building a visitor which increases code readability in terms of recognizing the hierarchy being built right away from the code. The optional and configurable things available are:
visiting properties by matching owner type and property name
visiting properties by matching property type only
specifying depth of visit in run-time (not during configuration)
custom expression for changing property value
cloning of visited object
etc.
//building a visitor + visiting an object (with optional clone, visit depth and circular reference protection):
var visitor = TypeWalker<Parent>.Create()
.ForProperty<Parent, string>(p => p.TestString1, null, (old, met) => old + met)
.ForProperty<Child, DateTime>(p => p.TestDate1, null, (old, met) => old.AddYears(10))
.ForProperty<CommonType>(null, (old, met) => new CommonType { CommonString = "..." })
.Build();
var parentClone = new Parent();
visitor.Visit(parentObject, parentClone, 10, new InstanceGuard());
// The properties that are being visited and change here are:
// 1. 'TestString1' property of Parent objects, anywhere in Parent's hierarchy
// 2. 'TestDate1' property of Child objects, anywhere in Parent's hierarchy
// 3. Any property of type CommonType, anywhere in Parent's hierarchy
//Property setter: new value for property 'TestString1' is set by compiled expression '(old, met) => old + met'
//'old' is old value, 'met' is metadata obj. coming from [VisitorMetadata] attribute on 'TestString1' property.
There is also an option of ManualWaler for building more specific visitor that will visit only nodes in specific place in object graph (e.g. only a 'Child' element at level 3 and only it's 'TestString1' property).
Many thanks to Francisco José Rey Gozalo for contributing with ideas and solutions.