Quantcast
Channel: Fluent Validation for .NET
Viewing all articles
Browse latest Browse all 1917

New Post: Pass lambda into rulefor

$
0
0

Hi

This isn't something that will work. You're assigning the expression do a dynamic, which the Length method won't work against as it's an extension method (the C# compiler doesn't support passing extension methods on dynamics). You'd need to know the type of TProperty.

To be honest, I really wouldn't recommend this approach. The entire point of FluentValidation is for explicitly defining rules for properties.

Jeremy


Viewing all articles
Browse latest Browse all 1917

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>