1

Resolved

Culprits

description

Would be nice to have a Culprit(x => y, y => z) addition to the fluent interface. Culprit would explicitly identify the culprit when a rule fails (and when the expression is a complex one).
 
E.g.
In the following example we want to setup the rule for Addresses[1].
 
For<Person>().Setup(m => m.Addresses[1].PostCode).MustEqual(123)
 
Currently, the validation report would have a Object=Person, and expression=m=>Addresses[1].Postcode.
 
With the change you could express Culprit as:
 
For<Person>().Setup(m => m.Addresses[1].PostCode)
.Culprit(m => m.Addresses[1], a => a.PostCode)
MustEqual(123)
 
In which case when the rule fails, the ValidationReport would have Object=Address, and Expression=m=>m.PostCode.
 
Polymod.NET would be grateful for this!

comments