I have the following class
public class ValidProjectHeader : AbstractValidator
{
public ValidProjectHeader()
{
Instead you could do this:
using FluentValidation;
...
FluentValidation.Results.ValidationResult resultCommon =
validator.Validate(parameter, ruleSet: "default, Insert");
The using
directive is required to bring the Validate()
extension method from DefaultValidatorExtensions
into scope, which has the ruleSet
property. Otherwise you will only have the Validate()
method available from inheriting AbstractValidator
, which doesn't have a ruleSet
argument.