ValueInjecter: how to ignore some properties while performing .InjectFrom<UnflatLoopValueInjection>(data)?
.net, c#, valueinjecter
Solution
With the latest version of Omu.ValueInjecter (v3.1.1 as of this writing), this feature is built-in:
instanceA.InjectFrom(new LoopInjection(new[] { "Prop1", "Prop2" }), instanceB);
`Prop1` and `Prop2` will be ignored.
This feature may have existed in previous versions, but isn't in v2.3 for example.
Problem
I'm using ValueInjecter instead of AutoMapper. I'm trying to perform unflattening operation using ``` .InjectFrom<UnflatLoopValueInjection>(model) ``` It works, but I would also like to specity some properties to ignore during the unflattening operation, for example writing something like: ``` .InjectFrom<UnflatLoopValueInjection>(new IgnoreProperties("Prop1", "Prop2"), model) ``` or ``` .InjectFrom<UnflatLoopValueInjection>(model).IgnoreProperties("Prop1", "Prop2") ``` Any ideas?