FluentValidation icon indicating copy to clipboard operation
FluentValidation copied to clipboard

ValidateField doesn't use RuleSet

Open sven5 opened this issue 4 years ago • 4 comments

Is your feature request related to a problem? Please describe. The ValidateField method doesn't consider RuleSets. It generates errors for all RuleSets. Instead, I only like to have errors for one particalur RuleSet.

Describe the solution you'd like I think you could combine functionality of RulesetValidatorSelector and MemberNameValidatorSelector to achieve this. Currently, there is only MemberNameValidatorSelector when creating the context: var context = new ValidationContext<object>(fieldIdentifier.Model, new PropertyChain(), new MemberNameValidatorSelector(properties));

sven5 avatar Apr 13 '21 14:04 sven5

It would be a great Idea if we could pass the RuleSet to the component <FluentValidationValidator/> We can specify the validator, but it makes more sense if we could specify the RuleSet

danielscatigno-ncpc avatar Apr 27 '22 19:04 danielscatigno-ncpc

@danielscatigno-ncpc This has been raised in #58 and has now been added.

chrissainty avatar Jun 01 '22 22:06 chrissainty

@danielscatigno-ncpc This has been raised in #58 and has now been added.

That's awesome news!

danielscatigno-ncpc avatar Jun 02 '22 13:06 danielscatigno-ncpc

@chrissainty Should not #58 Closes this one ?

Sharaf-Mansour avatar Jun 08 '22 21:06 Sharaf-Mansour

Yes, I think you're right.

chrissainty avatar Nov 15 '22 16:11 chrissainty