title: Extending PartialViewResult, Model isn't validated?
body: <p>I've got a class which extends <code>PartialViewResult</code> and in this class I'm setting the <code>Response.StatusCode</code> and the Model via <code>ViewData</code>.</p>
  
  <p>My model and statuscode are getting set as I'd expect, but my model isn't validated. Are their additional steps needed to ensure my model is validated? It feels like I've hooked into the wrong place (as in too late) in the pipeline and the model should already be validated before passing it to result but I'm not 100%.</p>
  
  <p>Here's the class:</p>
  
  <pre><code>public class PartialViewResultWithErrorCode&lt;T&gt; : PartialViewResult where T : class
  {
      private readonly HttpStatusCode statusCode;
      private readonly T model;
  
      public PartialViewResultWithErrorCode(HttpStatusCode statusCode, string viewName, T model)
      {
          this.statusCode = statusCode;
          this.model = model;
          ViewName = viewName;
      }
  
      public override void ExecuteResult(ControllerContext context)
      {
          context.HttpContext.Response.StatusCode = (int)statusCode;
          ViewData = new ViewDataDictionary(model);
          base.ExecuteResult(context);
      }
  }
  </code></pre>
  
  <p>Any thoughts greatly appreciated.</p>