Skip to content
This repository was archived by the owner on May 26, 2025. It is now read-only.
This repository was archived by the owner on May 26, 2025. It is now read-only.

Validated value in the error message  #6

@bartoszlenar

Description

@bartoszlenar

Feature description

  • To have an option to include the validated value in the error message.

Feature in action

m => m.EqualTo(666).WithMessage("The value {_model} is not equal to 666");
validator.Validate(555).ToString();
// The value 555 is not equal to 666

Feature details

  • That would be certainly another layer of creating the messages, {_model} placeholder would be in the cache and replaced with the actual value just during the validition.
  • ValidationContext would perform the operation during the validation.

Questions

That's technically, possible, but why implement this?
Is this really needed?

The fact that it's possible doesn't mean it's easy. And would certainly affect the perfromance.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestwontfixThis will not be worked on

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions