title: ASP.Net MVC Custom Model Binding explanation
body: <p>Is anyone aware of where I can find a tutorial for building a custom model binder. </p>
  
  <p>I have found several issues using the default model binder with EntitySets (not populating when creating new objects and creating duplicates on editing objects) and find that my UI doesn't match my model exactly (e.g. time fields formated "hh:mm am" do not match with a timespan). I therefore want to look at whether creating a custom model binder is a better solution. I have found a couple of examples: <a href="http://davidhayden.com/blog/dave/archive/2008/09/08/CustomModelBinderMoreUIValidationASPNETMVC.aspx" rel="noreferrer">here</a> and <a href="http://www.hanselman.com/blog/SplittingDateTimeUnitTestingASPNETMVCCustomModelBinders.aspx" rel="noreferrer">here</a>. The first is I believe out of date and the second doesn't really explain what is going on. </p>
  
  <p>My main problem is that I don't fully understand what the ControllerContext and ModelBindingContext Of the BindModel method actually are, i.e. how they relate to the controller and model. </p>
  
  <p>I would be grateful if someone point me to a tutorial or could take a look at the <a href="http://davidhayden.com/blog/dave/archive/2008/09/08/CustomModelBinderMoreUIValidationASPNETMVC.aspx" rel="noreferrer">dave hayden</a>'s post and show me how it might look with the current implementation of MVC. </p>