Now why wont it go to the same category If I add another record in URLRECORD table and add slug as make/model/abc and set the entityID as as of the record earlier.
It does not work, for that reason I added this route :
endpointRouteBuilder.MapControllerRoute(name: "CategoryRoute",
pattern: @"{make}/{model}/{categoryname}",
defaults: new { controller = "Catalog", action = "Category" }
);
Which work and I reach the desired controller :
public virtual async Task<IActionResult> Category(int categoryId, CatalogProductsCommand command)
{
}
But the categoryID=0 , I can get the make,model from here using:
var make = RouteData.Values["make"]?.ToString();
var mode = RouteData.Values["model"]?.ToString();
var categoryName = RouteData.Values["categoryname"]?.ToString();
and get it but why wont it show category ID here as it would normally do when I go to url = abc which is described in the same URLRECORD table.