Skip to content

Add a new parameter to WithMessage #35

@blahetal

Description

@blahetal

Hello,
would you consider tweaking the function WithMessage a bit. I would like to provide a custom error message with a computed value derived from the object (view mode) being validated. Current version allows to provide a static text

RuleFor(vm => ...).LessThan(vm =>...).WithMessage("Error");

I would like to do something like this

RuleFor(vm => ...).LessThan(vm =>...).WithMessage(vm =>$"Error{vm....}");

Thanks,
Libor

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions