One of the simplest and easiest ways to pass parameters to an action method is passing it via the URL. The following code snippet illustrates how you can pass parameters in the URL.
[HttpGet]
[Route("Default/GetAuthor/{authorId:int}")]
public IActionResult GetAuthor(int authorId)
{
var data = authorRepository.GetAuthor(authorId);
return View(data);
}
The URL to the endpoint is:
GET: http://localhost:8061/Default/GetAuthor/1
Here are some of links;
![Favorite Favorite](/wp-content/plugins/wp-favorite-posts/img/star.png)
![Loading Loading](/wp-content/plugins/wp-favorite-posts/img/loading.gif)