Model binding to Dictionary from URI in ASP.NET Web API

后端 未结 2 918
温柔的废话
温柔的废话 2021-01-12 22:33

Please refer to this link from MVC: http://aspnetwebstack.codeplex.com/discussions/351011

I am having trouble with model binding. From JavaScript I do an GET Ajax re

2条回答
  •  抹茶落季
    2021-01-12 23:04

    You can still leverage out of the box default model binder and your uri would look like

    http://localhost/api/products?page=1&count=10&filter[0].key=name&filter[0].value=Test1&filter[1].key=price&filter[0].value=10&sorting[0].key=name&sorting[0].value=desc
    

提交回复
热议问题