I would like to return a 403 Forbidden to the client when trying to perform an invalid operation. What is the method I need to use?
I searched over the internet but
If you don't return ActionResult for response, you can use the following code :
ActionResult
public List get() { ... ... // check logic ... Response.StatusCode = 403; return new List(); }