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
{{ message }}
This repository was archived by the owner on Dec 14, 2018. It is now read-only.
Given the following where MyEnum is an optional value, where the default is null:
publicasyncTask<IEnumerable<object>>DoSomethingAsync(MyEnum?myE){// do something// e.g. if(myE == null) {} else {}}publicenumMyEnum{MyValOne=0,MyValTwo=1}
And providing the query string with an invalid value (e.g. ?myE=asd) the request will fail via the ModelBindingMessageProvider and AttemptedValueIsInvalidAccessor; where the message is The value '{0}' is not valid for {1}..
However, with a nullable type, the {1} results in the message:
`The value 'asd' is not valid for Nullable`1.
I see a work around using localisation on the message, but should the message not attempt to find the underlying Type rather than the nullable?