Webapi object parameter with FromUri is null if no querystring passed
<p>I have the following API Controller action</p>

<pre><code>[HttpGet]
[Route("assets")]
public async Task&lt;HttpResponseMessage&gt; Get([FromUri]SearchCriteria searchCriteria)
{

}
</code></pre>

<p>When i test this with fiddler by accessing the url </p>

<p><a href="http://localhost/assets" rel="nofollow">http://localhost/assets</a> </p>

<p>the searchCriteria parameter is null but when i try with</p>

<p><a href="http://localhost/assets?param1=1&amp;param2=2" rel="nofollow">http://localhost/assets?param1=1&amp;param2=2</a> then searchCriteria has got the instance of the object.</p>

<p>The SearchCriteria class is defined as</p>

<pre><code>public class SearchCriteria
{
    public SearchCriteria()
    {
        Param1 = "";
        Param2 = "";
        PageIndex = 0;
        PageSize = 10;
    }
    public string Param1 { get; set; }
    public string Param2 { get; set; }
    public int PageIndex{ get; set; }
    public int PageSize { get; set; }
}
</code></pre>

<p>What is wrong in my approach? Why the action parameter is null when no querystring is passed?</p>

<p>Thanks</p>