Custom model binder for a property

override BindProperty and if the
property is “PropertyB” bind the
property with my custom binder

That’s a good solution, though instead of checking “is PropertyB” you better check for your own custom attributes that define property-level binders, like

[PropertyBinder(typeof(PropertyBBinder))]
public IList<int> PropertyB {get; set;}

You can see an example of BindProperty override here.

Leave a Comment