This repository was archived by the owner on Dec 14, 2018. It is now read-only.
This repository was archived by the owner on Dec 14, 2018. It is now read-only.
ModelBinderAttribute should not throw from BinderType property setter #2326
Closed
Description
The BinderType
setter throws when the type is not an IModelBinder
. This is problematic since reflecting over the type decorated with the attribute would produce an exception. We already throw from the code consuming the attribute, which should suffice.
Example:
[ModelBinder(BinderType = typeof(string)]
public class MyModel {}
typeof(MyModel).GetCustomAttributes() <-- will throw