//......................................RouteConfig
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
//.................................
routes.MapMvcAttributeRoutes();
//.................................
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
}
//.................................Controller
[Route("Kargocular")]
//.................................
public async Task<ActionResult> Index()
{
return View(await db.Shippers.ToListAsync());
}
Yorumlar
Yorum Gönder