Re-routing Error asp.net Core with Ocelot (7.0.4)

后端 未结 1 537
清酒与你
清酒与你 2020-12-18 16:32
\"ReRoutes\": [
{
  \"DownstreamPathTemplate\": \"/api/Agent/GetPagedAgents?page={page}\",
  \"DownstreamScheme\": \"http\",
  \"DownstreamHostAndPorts\": [
    {
           


        
相关标签:
1条回答
  • 2020-12-18 17:20

    Did you try to add [FromQuery] attribute?

    public IActionResult Get([FromQuery] string page, [FromQuery] string pageSize, [FromQuery] string filter, [FromQuery]string sortBy)
    {
    ...
    }
    

    or create a simple model

    public class Request
    {
       public string Page { get; set; }
       public string PageSize { get; set; }
       public string Filter { get; set; }
       public string SortBy { get; set; }
    }
    

    and use it like

    public IActionResult Get([FromQuery] Request request)
    {
    ...
    }
    
    0 讨论(0)
提交回复
热议问题