Skip to content
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

FluentValidation 验证Dto后,错误提示不显示 WithMessage中自定义的信息 #37

Closed
ZerekZhang opened this issue May 27, 2022 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@ZerekZhang
Copy link
Collaborator

LZOOVJI241NCGB4C W)E23K
FluentValidation 验证Dto后,返回的错误信息不是WithMessage中自定义的信息。
XKW{7X92D2CU`X0)$% RCKT

@AlphaYu AlphaYu added the help wanted Extra attention is needed label May 27, 2022
@ZerekZhang
Copy link
Collaborator Author

已发现问题
解决方案:
FluentValidation 得用法是
RuleFor().NotEmpty().WithMessage().NotNull().WithMessage()....;
一个验证规则跟一个自定义验证错误提示信息
不能
RuleFor().NotEmpty().NotNull().....WithMessage();这么搞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants