title: Overriding the default EditorFor template-selecting in ASP.NET MVC 3 RC
body: <p>I'm creating a MVC-application which currently uses EditorFor to gennerate a lot of views. The whole view is basically just an EditorForModel, and it works great. However, I've reached one small problem, which I can't seem to find a solution for, and it is important that it works the way I need it to, and that is when trying to render EditorFor an interface. The bindings and everything like that's been taken care of, but the problem is that the EditorFor sees that it's an interface, and defaults to the "Object" template. I need it to look at the interface and see if it can find a template with that name, and if it can't, I need it to look trough all the interfaces present to see if it matches any of them. To explain it more simply look at this example:</p>
  
  <p>interfaces:</p>
  
  <pre><code>public interface IAppProvider
  {
      string Name { get; set; }
  }
  
  public interface IAppMusicProvider : IAppProvider
  {
      int GetPlaylistCount();
  } // Yeah, I know, this interface is not smart, but it's only for show.
  </code></pre>
  
  <p>If I now create a View with model = "IAppMusicProvider", and run <code>Html.EditorForModel()</code>, I need it to find the "~Views\Shared\EditorTemplates\IAppProvider.cshtml"-template. Is there any simple way I can achieve this?</p>