// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, IRideViewModel viewModel) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseMvc(routes => { routes.MapRoute("default", "{Controller=Rides}/{Action=Index}"); routes.MapRoute("year", "rides/{year}", new { controller = "rides", action = "yearRides" }); routes.MapRoute("month", "rides/{year}/{month}", new { controller = "rides", action = "monthRides" }); routes.MapRoute("add", "add", defaults: new { controller = "rides", action = "add" }); }); }
public RidesController(IRideViewModel viewModel) { _viewModel = viewModel; }