Optional Parameters

Topics: Web Api
May 26, 2011 at 8:24 PM

Are optional parameters supported? Given the followoing possible uris:

DELETE /designs/1234

DELETE /designs/1234?permanent=true

Can I do this:

[WebInvoke(UriTemplate = "{designNumber}", Method = "DELETE")]       
public HttpResponseMessage DeleteDesign(int designNumber, bool permanent = false) { ... }

Which brings me to a second question...I don't want to necessarily permanently delete. As an implementation detail, I'm probably going to just mark an IsActive field as false. However, there are some cases where a real delete needs to take place. Any opinions on how to handle this? Should I use the qs parameter or should I create a different URI? The security restrictions behind the two things are different.