Reputation: 7083
Having this model:
public class PagingParameters
{
public int PageIndex { get; set; }
public int PageSize { get; set; }
}
Using the following controller action:
[HttpGet]
public object Query([FromQuery] PagingParameters query)
{
return null;
}
Model data still won't properly bind:
Is there something missing here ?
Upvotes: 1
Views: 515
Reputation: 239260
You're sending a dictionary, not an object. In other words, instead of query[PageIndex]
, you need query.PageIndex
, or simply just PageIndex
.
Upvotes: 1