{"id":1264,"date":"2013-09-23T02:00:00","date_gmt":"2013-09-23T02:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/webdev\/2013\/09\/23\/attribute-routing-changes-for-asp-net-web-stack-shipped-in-vs2013-rc\/"},"modified":"2022-08-09T05:20:06","modified_gmt":"2022-08-09T12:20:06","slug":"attribute-routing-changes-for-asp-net-web-stack-shipped-in-vs2013-rc","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/dotnet\/attribute-routing-changes-for-asp-net-web-stack-shipped-in-vs2013-rc\/","title":{"rendered":"Attribute Routing changes for ASP.NET Web Stack shipped in VS2013 RC"},"content":{"rendered":"<p>For the VS2013 Preview release, we published two articles about Attribute Routing for Web API 2:<\/p>\n<blockquote>\n<p>\u00b7 <a href=\"http:\/\/www.asp.net\/web-api\/overview\/web-api-routing-and-actions\/attribute-routing-in-web-api-2\">http:\/\/www.asp.net\/web-api\/overview\/web-api-routing-and-actions\/attribute-routing-in-web-api-2<\/a><\/p>\n<p>\u00b7 <a href=\"http:\/\/www.asp.net\/web-api\/overview\/web-api-routing-and-actions\/create-a-rest-api-with-attribute-routing\">http:\/\/www.asp.net\/web-api\/overview\/web-api-routing-and-actions\/create-a-rest-api-with-attribute-routing<\/a><\/p>\n<\/blockquote>\n<p>The VS2013 RC release includes more changes and features for attribute routing:<\/p>\n<h2>1. Explicitly declare a route template on an action<\/h2>\n<p>In RC, if attribute routing is enabled, you must explicitly declare the attribute for the desired actions. In Preview, you don\u2019t have to. <\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2013\/09\/7840.clip_image001_thumb_6ED8E080.png\"><img decoding=\"async\" title=\"clip_image001\" border=\"0\" alt=\"clip_image001\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2013\/09\/7840.clip_image001_thumb_6ED8E080.png\" width=\"475\" height=\"307\" \/><\/a><\/p>\n<h2>2. Added support for overriding RoutePrefix attribute.<\/h2>\n<p>In the following controller code, the action to \u2018get all the books\u2019 has a route template like \u201c~\/\u201d. This overrides the RoutePrefix for this action and a user can reach this action by requesting GET on <a href=\"http:\/\/hostname:hostport\/\">http:\/\/hostname:hostport\/<\/a> .<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2013\/09\/0830.clip_image002_thumb_0E1B8754.png\"><img decoding=\"async\" title=\"clip_image002\" border=\"0\" alt=\"clip_image002\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2013\/09\/0830.clip_image002_thumb_0E1B8754.png\" width=\"378\" height=\"142\" \/><\/a><\/p>\n<h2>3. Support for multiple RoutePrefix attributes on a controller has been removed. Only one RoutePrefix attribute can be applied to a controller.<\/h2>\n<h2>4. The Order property is removed from the RoutePrefix attribute.<\/h2>\n<p>We\u2019ll be changing even more for RTM &#8212; stay tuned. For information about what\u2019s planned, see <a href=\"http:\/\/aspnetwebstack.codeplex.com\/wikipage?title=Attribute%20routing%20in%20MVC%20and%20Web%20API&amp;referringTitle=Specs\">the attribute routing design specification<\/a> on the CodePlex site. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>For the VS2013 Preview release, we published two articles about Attribute Routing for Web API 2: \u00b7 http:\/\/www.asp.net\/web-api\/overview\/web-api-routing-and-actions\/attribute-routing-in-web-api-2 \u00b7 http:\/\/www.asp.net\/web-api\/overview\/web-api-routing-and-actions\/create-a-rest-api-with-attribute-routing The VS2013 RC release includes more changes and features for attribute routing: 1. Explicitly declare a route template on an action In RC, if attribute routing is enabled, you must explicitly declare the attribute for [&hellip;]<\/p>\n","protected":false},"author":410,"featured_media":58792,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[197],"tags":[7436],"class_list":["post-1264","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-aspnet","tag-visual-studio-2013"],"acf":[],"blog_post_summary":"<p>For the VS2013 Preview release, we published two articles about Attribute Routing for Web API 2: \u00b7 http:\/\/www.asp.net\/web-api\/overview\/web-api-routing-and-actions\/attribute-routing-in-web-api-2 \u00b7 http:\/\/www.asp.net\/web-api\/overview\/web-api-routing-and-actions\/create-a-rest-api-with-attribute-routing The VS2013 RC release includes more changes and features for attribute routing: 1. Explicitly declare a route template on an action In RC, if attribute routing is enabled, you must explicitly declare the attribute for [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/1264","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/users\/410"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/comments?post=1264"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/1264\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media\/58792"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media?parent=1264"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/categories?post=1264"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/tags?post=1264"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}