I have an action like this:
[HttpGet]
[Route("~/books/{id:int:min(1)}/{slug?}")]
public ActionResult Book(int? id, string slug)
{
if (slug == null)
{
slug = "awesome-book";
return RedirectToAction("Book", new { id, slug });
}
etc.
}
The problem is that the new route is generated like 'books/1?slug=awesome-book' and that's not what I wanted but 'books/1/awesome-book'. How can I properly set the slug?