add property resolver for include properties#2003
add property resolver for include properties#2003JeremySkinner merged 3 commits intoFluentValidation:mainfrom
Conversation
|
@JeremySkinner Have a look, please |
|
Hi @sergeivalko thanks for the suggestion. Does this cause issues with including full chains inside the expression? Eg if you do |
|
Ah, no, ignore my previous comment. I was misremembering how PropertyNameResolver worked. I think this should be fine - I'll try and do a bit more testing on it later this week and will then try and do a release, probably on Friday. |
|
@JeremySkinner yes everything is working fine I've just checked so looking forward to feedback, thanks. |
|
@JeremySkinner any updates? |
|
No, I haven't had time to look at this any further. I only work on FluentValidation in my spare time, and real-life takes priority. Please be patient and I'll try and get to it as quickly as I can. |
|
thank you |
JeremySkinner
left a comment
There was a problem hiding this comment.
Thanks for doing this.
The MemberFromExpression can be simplified as the chain variable is no longer needed. If you could make that change then I'll get this merged. Thanks!
|
I've pushed out 11.2.2 with this change |
Fix
This pull request fixes how the resolver works with
IncludeProperties.For example we have property resolver camelCase and when we are using
validator.Validate(new Person(), strategy => strategy.IncludeProperties(x=>x.Surname))then validator will not validate our surname property cause our resolver resolve it as "surname"
IncludeProperties= "Surname" but resolver (RuleFor(x=>x.Surname)) = "surname" and it can't find the right property for validate