我正在尝试从MVC asp.net core 2 Web应用程序中的类中的代码中抛出一个简单的HttpException 404错误。
From documentation you could use StatusCodeResult
as the result:
public StatusCodeResult StatusCodeActionResult()
{
return StatusCode(404);
}
For more information see StatusCodeResult
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.