Open
Description
The route values property in the anthor tag helper only allows for route values to have a single value since it of type IDictionary<string, string>
. Therefore when you say:
<a asp-action="Index" asp-all-route-data="@Context.Request.Query.ToDictionary(kvp => kvp.Key, kvp => (string)kvp.Value)">Link 1</a>
If the query string is ?filter=Red&filter=Green
it produces:
<a href="/shop?filter=Red,Green">Link 1</a>
However if you say:
<a href="@Url.Action("Index", Context.Request.Query.ToDictionary(kvp => kvp.Key, kvp => (object?)kvp.Value))">Link 1</a>
It correctly produces:
<a href="/shop?filter=Red&filter=Green">Link 1</a>