if (id.Contains(".css"))
return File($"{category}/{id}", "text/css");
else if (id.Contains(".woff"))
return File($"{category}/{id}", "font/woff");
else if (id.Contains(".jpg"))
return File($"{category}/{id}", "image/jpeg");
[Route("{category}/{id}", Name = "Service")]
public IActionResult Service(string id, string category) { }
<select asp-for="Category" asp-items="ViewBag.Categories"></select>
<select asp-for="Category.Id" asp-items="ViewBag.Categories"></select>