Skip to content

Instantly share code, notes, and snippets.

@dgfitch
Created January 25, 2013 17:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dgfitch/4636234 to your computer and use it in GitHub Desktop.
Save dgfitch/4636234 to your computer and use it in GitHub Desktop.
VB Area API routes
Public Overrides Sub RegisterArea(ByVal context As System.Web.Mvc.AreaRegistrationContext)
'' general api routes
context.MapRoute(
"api_default_sub_resource",
"api/v1/{controller}/{resource}/{subresource}/{action}.xml",
New With {.version = "1"}
)
context.MapRoute(
"api_default_resource",
"api/v1/{controller}/{resource}/{action}.xml",
New With {.version = "1"}
)
context.MapRoute(
"api_default",
"api/v1/{controller}/{action}.xml",
New With {.version = "1"}
)
'' not found
context.MapRoute(
"api_not_found",
"api/{path*}",
New With {.controller = "misc", .action = "notFound"}
)
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment