AspNetCore.Docs icon indicating copy to clipboard operation
AspNetCore.Docs copied to clipboard

Routing to Controller Actions

Open danroth27 opened this issue 11 years ago • 14 comments

ASP.NET MVC -> Controllers -> Routing to Controller Actions

  • Relationship to middleware (#61)
  • Startup code and relationship to MVC route handler
  • Attribute routing
    • [Route], [Http*]
    • Routes on controller vs actions
    • Inheritance
    • Token replacement in route templates ([controller], [action], [area])
    • Custom route attributes using IRouteTemplateProvider
    • Pointer to using Application Model to customize attribute routes
  • Conventional routing
    • Mapping of action/area/controller maps to a controller action (action selection)
  • Action constraints
    • HTTP method constraints
    • Custom constraints

danroth27 avatar Apr 21 '15 05:04 danroth27

cc @ssargent

pranavkm avatar Aug 18 '15 16:08 pranavkm

Is there going to be any way to create route configuration files that point directly to controllers? There still seems to be quite a heavy focus on attribute routing. This ticket explains some of the things I'd hope to see made available.

atrauzzi avatar Aug 25 '15 12:08 atrauzzi

Some existing content we might leverage: http://www.asp.net/web-api/overview/web-api-routing-and-actions/attribute-routing-in-web-api-2

danroth27 avatar Aug 28 '15 22:08 danroth27

@danroth27 - I meant, not using attribute routing. "route configuration files that point directly to controllers".

Attribute and in-code routes are a somewhat dated practice compared to what other mature frameworks out there are doing.

atrauzzi avatar Aug 29 '15 00:08 atrauzzi

This is about documenting the existing features. Use that ticket to further ask for things (or open a new one) but this issue isn't about adding new features.

davidfowl avatar Aug 29 '15 07:08 davidfowl

o_O

njasm avatar Nov 27 '15 23:11 njasm

Initial content in PR: https://github.com/aspnet/Docs/pull/602

danroth27 avatar Dec 10 '15 18:12 danroth27

Any way to map routes in a separate file / class? @danroth27 @atrauzzi

ar27111994 avatar Feb 21 '16 18:02 ar27111994

I have searched everywhere for some content on how to handle custom inline route constraints in MVC 6. Are they still in?

NinoFloris avatar Mar 03 '16 16:03 NinoFloris

When you say custom, you mean beyond the ones that are available here?
https://github.com/aspnet/Routing/blob/1.0.0-rc1/src/Microsoft.AspNet.Routing/RouteOptions.cs

ardalis avatar Mar 03 '16 16:03 ardalis

Any updates on this issue? I would appreciate some documentation on this topic :) ... would older documentation work until then?

PeterBocan avatar Jul 22 '16 22:07 PeterBocan

It's in progress

danroth27 avatar Jul 23 '16 03:07 danroth27

I'd be happy to be a test-subject for your documentation when you feel it's ready. I'm about 200 hours into working with MVC/webapi after about 25 years of software engineering experience. [email protected].

glangdonvt avatar Aug 22 '16 02:08 glangdonvt

fixed by https://docs.asp.net/en/latest/mvc/controllers/routing.html

Rick-Anderson avatar Sep 22 '16 19:09 Rick-Anderson