共用方式為


ApiController.StatusCode(HttpStatusCode) 方法

定義

使用指定的狀態碼建立 StatusCodeResult

[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.StatusCodeResult StatusCode (System.Net.HttpStatusCode status);
[<Microsoft.AspNetCore.Mvc.NonAction>]
abstract member StatusCode : System.Net.HttpStatusCode -> Microsoft.AspNetCore.Mvc.StatusCodeResult
override this.StatusCode : System.Net.HttpStatusCode -> Microsoft.AspNetCore.Mvc.StatusCodeResult
Public Overridable Function StatusCode (status As HttpStatusCode) As StatusCodeResult

參數

status
HttpStatusCode

回應訊息的 HTTP 狀態碼

傳回

StatusCodeResult具有指定狀態碼的 。

屬性

適用於