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

后端 未结 2 943
温柔的废话
温柔的废话 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:01

    I think it is better to use a model as parameter, such as:

    Public class model
    {
    Public Dictionary filter{get;set;}
    Public Dictionary sorting{get;set;}
    Public int sorting{get;set;}
    }
    
    public async IHttpActionResult Get(model yourModel)
    {
            //...
    }
    

提交回复
热议问题