Hi,
I think I am missing something, I've created my custom catalog controller and IRouteProvider that registers the route. It all works as expected. My custom method is called. The problem is that categoryId is always 0 in the overridden Category method, seems like it's not passed through. Should I do something in addition to make it work?
public class CustomCatalogController : CatalogController
{
...
public async override Task<IActionResult> Category(int categoryId, CatalogProductsCommand command)
{
return await base.Category(categoryId, command);
}
}
public partial class RouteProvider : BaseRouteProvider, IRouteProvider
{
public void RegisterRoutes(IEndpointRouteBuilder endpointRouteBuilder)
{
var lang = GetLanguageRoutePattern();
var genericPattern = $"{lang}/{{SeName}}";
endpointRouteBuilder.MapControllerRoute(name: "Category",
pattern: genericPattern,
defaults: new { controller = "CustomCatalog", action = "Category" });
}