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

New Post: AppendArgument with PredicateValidator (Must)

$
0
0

Hi J

Yes, I trying to use WithMessage("Value must be between {min} and {max}")

 

How do I provide the min and max argument? The predicate looks like:

private static bool Calc(RegistrerSalgInput input, decimal beløb)       

{           

decimal maxTax = (input.Beløb*RegistrerSalgInput.TAX)/99; // This value should be present in arguments as max

decimal minTax = (input.Beløb*RegistrerSalgInput.TAX)/101; // This value should be present in arguments as min

return beløb >= minTax && beløb <= maxTax;       

}

 

Ken


Viewing all articles
Browse latest Browse all 1917

Trending Articles



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