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

New Post: WithLocalizedMessage overload with instance of type being validated?

$
0
0

Hi,

I have cases where I need to build the errormessage based on values inside the type being validated.

eg. 

RuleFor(f=>f.FirstName)
    .NotEmpty()
    .WithLocalizedMessage((x) => 
        PersonStrings.ValidatieFrequentieTpVerplicht, x.SomePropertyOfPerson
    );

Is this already possible and am I overlooking something or should I create my own extension?


Viewing all articles
Browse latest Browse all 1917

Trending Articles



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