vkhorikov / SpecificationPattern

Implementation of the Specification Pattern in C#
304 stars 73 forks source link

Fixed parameter replacer for expressions containing references to children #5

Closed AleksanderKijowskiLOOT closed 4 months ago

AleksanderKijowskiLOOT commented 5 months ago

Parameter replacer was not working when working with expressions on root and it's children.

i.e if our expression contained some expression like that: return root.Children.Any(child => child.Property == "123"), current implementation of parameter replacer would replace the child paramer with root parameter leading to exception mentioned by other user in issue 4. Please have in mind this error occurs only when the expression is combined using And/Or/Not specifications.