You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Actually, if you try to add two validations to the same property, eg Password, in the ValidationContext you would do it like this:
[…]this.ValidationRule(vm => vm.Password,password =>!string.IsNullOrEmpty(password),"Password is required.");this.ValidationRule(vm => vm.Password,password => password.Length >5,"Password minimum length is 5.");[…]
And from the View you would bind to the Password property like this:
The problem by doing this is that from the ValidationBindings, used by the ViewForExtensions, it looks up only for the first or default validation rule (see ResolveFor methods in ValidationContextExtensions).
Describe the solution you'd like
Add support for multiple validations in the same property since it's supported in the ValidationContext side.
Describe suggestions on how to achieve the feature
Basically, if more than one property matches the query in the ResolveFor method then unless the Formatter has been provided, it should throw a custom exception like MultipleValidationNotSupportedException.
On the other side, we should provide Mixins to give support for multiple validation scenarios.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
Actually, if you try to add two validations to the same property, eg
Password
, in the ValidationContext you would do it like this:And from the View you would bind to the
Password
property like this:The problem by doing this is that from the
ValidationBindings
, used by theViewForExtensions
, it looks up only for the first or default validation rule (seeResolveFor
methods inValidationContextExtensions
).Describe the solution you'd like
Add support for multiple validations in the same property since it's supported in the ValidationContext side.
Describe suggestions on how to achieve the feature
Basically, if more than one property matches the query in the
ResolveFor
method then unless the Formatter has been provided, it should throw a custom exception likeMultipleValidationNotSupportedException
.On the other side, we should provide Mixins to give support for multiple validation scenarios.
The text was updated successfully, but these errors were encountered: