Skip to content

null value ignored when using RuleFor and SetValidator #582

@huysentruitw

Description

@huysentruitw

Could be related to #486 but I'm not getting any exception.

I've created an abstract validator that contains this rule:

RuleFor(x => x.Value).SetValidator(x => new BinaryFieldValueValidator((BinaryDataTypeInput) x.DataType)).When(x => x.DataType is BinaryDataTypeInput);

where x.Value is of type object. However, when x.Value is null, I'm not getting in the BinaryFieldValueValidator constructor, so the SetValidator lambda is not executed.

Any reason for that?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions