I have gone through this solution but this is not what I am looking for get parameters from URL in controller constructor.
Let's say, In an ASP.NET Core Controller I'm requesting to some methods. Let's say the controller is something like:
public class ClassroomsController : Controller {
    private string requestedUserId;
    // C O N S T R U C T O R
    public ClassroomsController()
    {
        /**** THIS POINT ***/
        requestedUserId = ;
    }
    [HttpGet("Classrooms/API01/{userId}")]
    public IActionResult API01(string userId)
    {
    }
    [HttpGet("Classrooms/API02/{userId}")]
    public IActionResult API02(string userId)
    {
    }
}
What I want is whether I request in Classrooms/API02 or Classrooms/API01 the requestedUserId should be initiated inside the constructor based on the parameter userId in both API01 and API02;