User Routing


ASP.NET (Core) MVC Actions Routing Public New

Easy 

3min

Consider the following code sample:

public class UserController : Controller
{
    [Route("/user")]
    public IActionResult GetUser()
    {
        return Content("Ask for specific user on URL: /user/{userId}");
    }

    [Route("/user/{userId}")]
    public IActionResult GetUserById(string userId)
    {
        return Content($"User with id: {userId}");
    }
}

Select all of the following URLs that will be routed to the GetUserById method.

/user/someid
/user/user/1
/user/123
/user/21id
/user/name/password
/user/