title: Afterwards Model Binding in ASP.NET MVC: How to convert QueryString values into a view model?
body: <p>I have an action method without parameters.</p>
  
  <p>The <code>QueryString</code> collection contain all of my values. The keys of the <code>QueryString</code> match my view model properties. </p>
  
  <pre><code>var queryStringValueProvider = new QueryStringValueProvider(ControllerContext);
  var providerResult = queryStringValueProvider.GetValue(ValidationKeys.Id); // ?!
  
  var viewModelTypeName = queryString[ValidationKeys.ViewModelType];
  
  var viewModelType = Type.GetType(viewModelTypeName);
  var viewModelInstance = providerResult.ConvertTo(viewModelType); // throws an InvalidOperationException
  </code></pre>
  
  <p>How can I convert the <code>QueryString</code> collection to a view model?
  ASP.NET MVC already do this when you just pass the view model into the action method parameters. So what I need is an <strong>afterwards model binding</strong> using ASP.NET MVC mechanics.</p>