Reputation: 33128
First let me be clear I am talking about the independent project of AttributeRouting http://attributerouting.net/ and not the built-in attribute routing.
Take this slightly modified version of their example code:
public class SampleController : Controller
{
[GET("Sample")]
public ActionResult Index() { /* ... */ }
[POST("Sample")]
public ActionResult Create() { /* ... */ }
[PUT("Sample/{id}")]
public ActionResult Update(string id) { /* ... */ }
}
Suppose that for Update
I wanted to have the request PUT Sample/Cheese/Swiss
is there any way to inform AttributeRouting that the id
parameter should capture "Cheese/Swiss"?
Upvotes: 0
Views: 54
Reputation: 520
Wouldn't [PUT("Sample/{*id}")] work? The asterisk means "take the rest".
Upvotes: 1