DEV Community

Discussion on: Kentico 12: Design Patterns Part 10 - MVC Routing with NodeAliasPath

Collapse
 
seangwright profile image
Sean G. Wright

Jim,

Thanks for the feedback and I'm glad the post is helpful.

I don't have any repo with the full picture of this implementation, but I'm planning on writing a follow up about generating URLs when using NodeAliasPath routing. Maybe I could put an example online then.

Was there a specific bit of code you were unsure about?

There shouldn't be too many pieces in then end...

  1. NodeAliasPathConstraint
  2. PageTypeRoute
  3. Static PageTypeRouteAttributeCacheHelper class to do path -> Controller/Action name lookup

You can define these anywhere, though Kentico uses an \Infrastructure\ folder at the root of their MVC codebase and puts these cross-cutting or framework code pieces in there - I think that's a good pattern.