title: WEB API .NET Action with custom endpoint names
body: <p>So I've set up a backend in .NET and the basic HTTP calls are working. Now I need an alternative method that will not search by ID but by a property, so i want to make a REST call with a different property at the end.</p>
  
  <p>Here are the 2 methods of my controller:</p>
  
  <pre><code>public IHttpActionResult GetCategory(int id)
  {
      var category = _productService.GetCategoryById(id);
  
      if (category == null) return NotFound();
      var dto = CategoryToDto(category);
      return Ok(dto);
  }
  
  
  public IHttpActionResult GetCategoryByName(string name)
  {
      var category = _productService.GetCategoryByName(name);
  
      if(category == null) return NotFound();
      var dto = CategoryToDto(category);
      return Ok(dto);
  }
  </code></pre>
  
  <p>My API config is configured as follow: <code>/api/{controller}/{action}/{id}</code>.</p>
  
  <p>So the first call works with this call: <code>/api/category/getcategory/2</code></p>
  
  <p>When I try the second method with this call : <code>/api/category/getcategorybyname/Jewelry</code></p>
  
  <p>I get an error saying that no action in my controller matches the request.</p>
  
  <p>What's the problem here?</p>