title: MVC Web API route not working with parameters. c#
body: <p>my web api works fine when i request a route without parameters, but it doesnt find the controller when i add parameter:</p>
  
  <p>This is my WebApiConfig.cs:</p>
  
  <pre><code>config.MapHttpAttributeRoutes();
  
          config.Routes.MapHttpRoute(
              name: "DefaultApi",
              routeTemplate: "v1/{controller}/{id}",
              defaults: new { area = "v1", id = RouteParameter.Optional }
          );
  </code></pre>
  
  <p>This is my controller in the Area "v1":</p>
  
  <pre><code>[RoutePrefix("v1/Dummy")]
  public class DummyController : ApiController
  {
      [HttpGet]
      //[Route("")]
      public IEnumerable&lt;string&gt; Get()
      {
          return new string[] { "value1", "value2" };
      }
  
      [HttpGet]
      [Route("{id:int}")]
      public string Get(int id)
      {
          return "value";
      }
  
      [HttpPost]
      public void Post([FromBody]string value)
      {
      }
  
      [HttpPut]
      public void Put(int id, [FromBody]string value)
      {
      }
  
      [HttpDelete]
      public void Delete(int id)
      {
      }
  }
  </code></pre>
  
  <p>Here's what's right:
  <a href="https://i.stack.imgur.com/Aor8k.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Aor8k.png" alt="CORRECT"></a>
  Here's What's Wrong:
  <a href="https://i.stack.imgur.com/NOMHH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NOMHH.png" alt="WRONG"></a></p>
  
  <p>Can anyone please help with this ?</p>
  
  <p>EDIT:</p>
  
  <p>I have tho following code in Application_Start():</p>
  
  <pre><code>AreaRegistration.RegisterAllAreas();
  
  System.Web.Http.GlobalConfiguration.Configure(WebApiConfig.Register);
  </code></pre>
  
  <p>EDIT 2:</p>
  
  <pre><code>private void RegisterRoutes()
      {
  
          RouteTable.Routes.Add(new ServiceRoute("SumiService/Customer", new WebServiceHostFactory(), typeof(SumiyCustomerService)));
          RouteTable.Routes.Add(new ServiceRoute("SumiService", new WebServiceHostFactory(), typeof(SumiService)));
  
          RouteTable.Routes.Add(new ServiceRoute("goops", new WindsorServiceHostFactory&lt;RestServiceModel&gt;(), typeof(IGoOpsService)));
  
          RouteTable.Routes.Add(new ServiceRoute("TempService", new WebServiceHostFactory(), typeof(TempService)));
          RouteTable.Routes.Add(new ServiceRoute("Go", new WindsorServiceHostFactory&lt;RestServiceModel&gt;(), typeof(GoBusinessContracts.IGoService)));
      }
  </code></pre>