title: ASP.NET core Web API routing
body: <ol>
  <li>Route using "UseMvc" but not able to call the controller</li>
  <li>In startup page have added <code>service.AddMvc</code> method &amp; in configure section it's <code>app.useMvc()</code></li>
  <li>I am not able to route and can't figure out what the problem is</li>
  </ol>
  
  <p>The controller code is here and have route : the action method is <code>Get</code> with parameter <code>start</code> of <code>DateTime</code> type</p>
  
  <pre><code>public void ConfigureServices(IServiceCollection services)
  {
      services.AddDbContext&lt;CurrencyContext&gt;(cfg =&gt; {
                    cfg.UseSqlServer(_config.GetConnectionString("BitCoinIndexConnectionString"));
      });
  
      services.AddMvc();
  }
  
  public void Configure(IApplicationBuilder app, IHostingEnvironment env)
  {
      app.UseStaticFiles();
      app.UseNodeModules(env);
  
      app.UseMvc(routes =&gt;
                        {             
                            routes.MapRoute(name: "default",
                                            template: "api/{controller}/{action}/{start:DateTime}",
                                            defaults: new { 
                                                              controller = "Currency", 
                                                              action = "Get", 
                                                              start = DateTime.Now.AddDays(-14)});                          
                                                          });
                        }
  }
  
  [Route("api/[Controller]")]
  public class CurrencyController : Controller
  {
      private BitCoinRepository&lt;BitCoinIndex&gt; _repository;
  
      public CurrencyController(BitCoinRepository&lt;BitCoinIndex&gt; repository)
      {
          _repository = repository;
      }
  
      // GET: api/&lt;controller&gt;
      [HttpGet("{start}",Name ="Get")]
      public IActionResult Get(DateTime start)
      {
          // var bci =  _repository.GetByDates(start).ToDictionary(t =&gt; t.Date.ToString(), t =&gt; t.Rate);
          return View();    
      }
  }
  </code></pre>