How to use FromQuery Attribute get a complex object?

后端 未结 1 1497
广开言路
广开言路 2021-01-17 11:40

How to use FromQueryAttribute get a complex object?

[HttpGet]
public IActionResult Get([FromQuery] DataGridRequest request)
{
    ...
}

The

相关标签:
1条回答
  • 2021-01-17 12:03

    You can try a Get request like this

    controller?Size=1&Index=2
    

    Also try to use [FromUri] instead [FromQuery]. The [FromUri] attribute tries to bind the object properties to the query string properties by name

    0 讨论(0)
提交回复
热议问题