title: ASP.NET MVC ModelBinding Inherited Classes
body: <p>I've got a question about ModelBinding in ASP.NET MVC (I'm using MVC 2 preview 2) related to inheritance.</p>
  
  <p>Say I have the following interfaces/classes:</p>
  
  <pre><code>interface IBase
  class Base : IBase
  interface IChild
  class Child: Base, IChild
  </code></pre>
  
  <p>And I have a custom model binder BaseModelBinder.</p>
  
  <p>The following work fine:</p>
  
  <pre><code>ModelBinders.Binders[typeof(Child)] = new BaseModelBinder();
  ModelBinders.Binders[typeof(IChild)] = new BaseModelBinder();
  </code></pre>
  
  <p>The following do not work (on binding a on object of type Child):</p>
  
  <pre><code>ModelBinders.Binders[typeof(Base)] = new BaseModelBinder();
  ModelBinders.Binders[typeof(IBase)] = new BaseModelBinder();
  </code></pre>
  
  <p>Is there any way to have a model binder for a base class that will apply to all inherited classes?  I really don't want to have to manually input something for every possible inheriting class.</p>
  
  <p>Also, if it is possible, is there a way to override the modelbinder for a specific inheriting class?  Say I got this working but I needed a specific modelbinder for Child2.</p>
  
  <p>Thanks in advance.</p>