title: What's the WebApi [FromUri] equivalent in ASP.NET MVC?
body: <p>In WebApi I can decorate a parameter on a controller action with <code>[FromUri]</code> to have the components of the URI 'deserialized', if you will, into a POCO model; aka model-binding.</p>
  <p>Despite using MVC since 2.0, I've never used it for websites (I don't know why). What's the equivalent of it in ASP.NET MVC 5?</p>
  <p>The attribute doesn't seem to be recognised in the IDE unless I need to reference a library.</p>
  <p>I'd like <code>~/thing/2014/9</code> to bind to the model below:</p>
  <pre><code>public class WhateverModel
  {
      public int Year { get; set; }
      public int Month { get; set; }
  }
  </code></pre>
  <p>Thanks</p>
  <p>Update</p>
  <p>In the other question (link above), the OP says:</p>
  <blockquote>
  <p>However, switch this to plain MVC not WebApi and the default model binder breaks down and cannot bind the properties on objects in the nested array</p>
  </blockquote>
  <p>Which implies that he's using the attribute from the WebApi. I guess. I don't have those references, because I'm in MVC, so is (ab)using WebApi's version the accepted way to do this in MVC?</p>
  <p>Update 2</p>
  <p>In the answer to that question is:</p>
  <blockquote>
  <p>You need to construct your query string respecting MVC model binder naming conventions.</p>
  <p>Additionally <code>[FromUri]</code> attribute in your example action is completely ignored, since it's not known to MVC DefaultModelBinder</p>
  </blockquote>
  <p>So I'm still left not knowing what to do or what on Earth the OP was even talking about in that question, if he was getting some success with the wrong attribute.</p>
  <p>I guess I'm hoping for a clear answer and not the mud of that other question.</p>