Consider the following exmaple:
[ActionName("SomeTestAction")]
[ResponseType(typeof(SomeObject))]
public IHttpActionResult SomeTestAction(string id)
{
SomeObject o = SomeMethod(id);
if (o == null)
{
var message = string.Format("Nothing found for id = {0}", id);
HttpError err = new HttpError(message);
return Content(HttpStatusCode.NotFound, err);
}
else
{
return Content(HttpStatusCode.OK, o);
}
}
This method can have two different ResponseType -s based on the outcome of a database query for example. Is there a way to specify this behavior in HelpPages of WebAPI, so that the user knows what the error response looks like?