I'm running the Action below, but the "CategoryObject" parameter is not being passed to the Controller. I'm working with asp.net core 2.0.
public async Task<IActionResult> Buscar(string ArtigoOuCategoria)
{
...
}
The Action call is below:
<div class="card mb-4">
<div class="card-body">
<h4 class="card-title">Categorias</h4>
@foreach (var item in Model.Categorias)
{
<a class="btn btn-light btn-sm mb-1" asp-controller="Artigo" asp-action="Buscar/@item.Descricao">@item.Descricao</a>
}
</div>
</div>
The Action call was also made as follows:
<a href="Artigo/Buscar/@item.Descricao">@item.Descricao</a>
Includes the route instructions in the project startup.cs file:
routes.MapRoute(
name: "buscar",
template: "Artigo/Buscar/{ArtigoOuCategoria?}",
defaults: new { controller = "Artigo", action = "Buscar" });