title: Single optional parameter on asp.net core routing in Controller
body: <p>I want to know how to set url path with single optional parameter with prefix routing path.
  Because when I try to do [HttpGet("id:int?}"], then I try to access
  "[myserver]/prefix"
  it's not working.</p>
  
  <p>I do this for
  [myserver]/prefix
  [myserver]/prefix/1</p>
  
  <p>This is route setting
  Prefix
      [Route("manage/test")]
  function
      [HttpGet("{id:int?}")</p>
  
  <p>I know it's working with additional routing setting
  -> [HttpGet("")]
  Or
  Setting prefix route
     [Route("manage")]
  function route
     [HttpGet("test/{id:int?}"]</p>
  
  <p>But I wanna know why the first parameter is the only one word of routing and it's not working.</p>
  
  <pre><code>[Route("manage/test")]
  public class ManageController : BaseController //(inherited from Controller)
  {
      //[HttpGet("")]
      [HttpGet("{id:int?}"]
      public IActionResult Index(int? id = null)
      {
      }
  }
  </code></pre>
  
  <p>For this "[myserver]/prefix"</p>
  
  <p>The view '/Views/manage/test/.cshtml' was not found. The following locations were searched: /Views/manage/test/.cshtml</p>
  
  <p>But for "[myserver]/prefix/1"</p>
  
  <p>The view '/Views/manage/test/.cshtml' was not found. The following locations were searched: /Views/manage/test/Index.cshtml</p>
  
  <pre><code>[Route("manage")]
  public class ManageController
  {
      [HttpGet("{id:int?}"]
      public IActionResult Index(int? id = null)
      {
          return View();
      }
  }
  </code></pre>