Created Issue: Issues in ShouldHaveValidationErrorFor and...
We cannot use ShouldHaveValidationErrorFor and ShouldNotHaveValidationErrorFor methods for nested properties. For example, for tested class has a property of another class. For example, we cannot...
View ArticleEdited Issue: Issues in ShouldHaveValidationErrorFor and...
We cannot use ShouldHaveValidationErrorFor and ShouldNotHaveValidationErrorFor methods for nested properties. For example, for tested class has a property of another class. For example, we cannot...
View ArticleCommented Issue: Issues in ShouldHaveValidationErrorFor and...
We cannot use ShouldHaveValidationErrorFor and ShouldNotHaveValidationErrorFor methods for nested properties. For example, for tested class has a property of another class. For example, we cannot...
View ArticleCommented Issue: Issues in ShouldHaveValidationErrorFor and...
We cannot use ShouldHaveValidationErrorFor and ShouldNotHaveValidationErrorFor methods for nested properties. For example, for tested class has a property of another class. For example, we cannot...
View ArticleNew Post: Checking for NULL in rules for nested properties
If you are using MVC integration you can implement IValidatorInterceptor. In BeforeMvcValidation you can check validationContext.InstanceToValidate as YourModel).Header If it is null you can create...
View ArticleNew Post: AppendArgument with PredicateValidator (Must)
Hello Is it possible to append arguments when using Must rule (PredicateValidator)? Ken
View ArticleNew Post: AppendArgument with PredicateValidator (Must)
Hi Ken I'm not entirely sure I understand what you mean. Could you provide more detail about what you're trying to achieve? If you're referring to using custom message arguments when using a Must rule,...
View ArticleNew Post: AppendArgument with PredicateValidator (Must)
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,...
View ArticleNew Post: AppendArgument with PredicateValidator (Must)
Named parameters are defined explicitly by individual validators that know how to format them (for example, the Length validator knows what {min} and {max} mean - yhere's a list of which validators...
View ArticleNew Post: AppendArgument with PredicateValidator (Must)
Hi Well, thats not good enough for me. :-) I created my own PredicateValidator class (which takes the MessageFormatter in Predicate delegate), and created a Must extension method. Thanks Ken
View ArticleNew Post: AppendArgument with PredicateValidator (Must)
Hi Ken Please feel free to submit a pull request via github and I'll try and take a look at it over the next week. Thinking about it further, it may make more sense to modify this to receive the entire...
View ArticleNew Post: RuleSets with two abstract validators.
Hi! First of all thanks for a great library. I have an abstract validator which uses Rule sets. On of the rules looks like this: Inside myValidator: public class MyValidator :...
View ArticleNew Post: RuleSets with two abstract validators.
Hi Rulesets are designed to cascade through to child validators - there isn't a way to change this behaviour out of the box. However, you could write your own IValidatorSelector implementation that...
View ArticleNew Post: Rule sets on .ValidateAndThrow
I cant find a way to set a specific rule set on ValidateAndThrow as you can with: .Validate(businessAllocationDTO, ruleSet: "CustomValidation" ); is it possible?
View ArticleNew Post: Rule sets on .ValidateAndThrow
There isn't a built in method for this, but it'd be trivial to add an extension: public static class MyExtensions { public static void ValidateAndThrow(this IValidator validator, T instance, string...
View ArticleSource code checked in, #4277168d99c0
Merge pull request #5 from ziaxdk/master Added PropertyValidatorContext to Must
View Article