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
You can use return new ForbidResult(); Class declaration is
return new ForbidResult();
public class ForbidResult : ActionResult, IActionResult
For more spesific usages visit https://docs.microsoft.com/en-us/aspnet/core/api/microsoft.aspnetcore.mvc.forbidresult