<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="1.1.3" />
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
services.AddMvc(); //configureServices
app.UseMvc();//configure
app.UseMvc(routes=>routes.MapRoute("default","{controller}/{action}",new {controller="Home",action="Default" }));
or
app.UseMvc(routes=>routes.MapRoute("default","{controller=Home}/{action=Default}"));
or
[Route("/[controller]"),Route("/")]
public class HomeController : Controller
{
// GET: /<controller>/
[Route("[action]"),Route("")]
public IActionResult Default()
{
return Content("Hello from a controller!");
}
}