3
I have the following method in my Controller
:
public IHttpActionResult Get(string id)
{
var product = objds.GetProduct(new ObjectId(id));
if (product == null)
{
return NotFound();
}
return Ok(product);
}
If the product is null
then return one 404
, otherwise return a OK
with the product. My doubts are as follows::
- How can I return a message along with the status
404
? - Do you have any problem returning a message along with the
status
?