如何使用带连字符的查询字符串参数作为操作方法参数

时间:2018-06-14 11:45:58

标签: asp.net-mvc asp.net-core-2.0

我正在使用ASP.NET Core 2.0。

我有以下行动:

    [HttpGet]        
    [Route("resultado-pesquisa")]
    public IActionResult ResultadoPesquisaProdutos(string palavrasChave, int pagina = 1)
    {

当我在我的刀片视图中使用它时

<a asp-controller="Produtos" asp-action="ResultadoPesquisaProdutos" asp-route-palavraschave="edredoms" panelas>edredom</a>

它会生成如下链接:

http://localhost:5000/resultado-pesquisa?palavrasChave=edredom

我不喜欢驼峰式查询字符串。

如何将其更改为

http://localhost:5000/resultado-pesquisa?palavras-chave=panela

0 个答案:

没有答案