New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DisplayName should be consistent between RuleFor.ForEach
and RuleForEach
#1231
Comments
Please can you provide the following information which was asked for in the issue template:
Thanks. |
@JeremySkinner code updated. |
Thanks for the updated example. This is technically the correct behaviour as the display name is the always the name of the property being validated. In this case, you're not validating a property, so it will correctly be an empty string and you're expected to provide a name using However I agree that this isn't particularly intuitive or useful so will look at the implications of changing this for a future version. |
😉 |
@JeremySkinner Hi Jeremy, this does seem to be the correct behavior. Do you have any idea how to prevent this kind of issue? |
Implemented in 40dbb78 and will be part of 10.2. |
RuleFor.ForEach
and RuleForEach
System Details
Issue Description
https://github.com/JeremySkinner/FluentValidation/blob/2eb493886b3f2f630f6c82ae7fc1baf6f34ec496/src/FluentValidation/Validators/PropertyValidatorContext.cs#L31
maybe because https://github.com/JeremySkinner/FluentValidation/blob/2eb493886b3f2f630f6c82ae7fc1baf6f34ec496/src/FluentValidation/DefaultValidatorExtensions.cs#L1091 using a
InlineValidator<IEnumerable<TElement>>()
withx=>x
lambda, so theMemberInfo
will be resolved as null.The text was updated successfully, but these errors were encountered: