PageModel.StatusCode 方法

定义

重载

StatusCode(Int32)

StatusCodeResult通过指定 statusCode创建 对象。

StatusCode(Int32, Object)

ObjectResult通过指定 statusCode 和 创建 对象value

StatusCode(Int32)

Source:
PageModel.cs
Source:
PageModel.cs
Source:
PageModel.cs

StatusCodeResult通过指定 statusCode创建 对象。

public:
 virtual Microsoft::AspNetCore::Mvc::StatusCodeResult ^ StatusCode(int statusCode);
public virtual Microsoft.AspNetCore.Mvc.StatusCodeResult StatusCode (int statusCode);
abstract member StatusCode : int -> Microsoft.AspNetCore.Mvc.StatusCodeResult
override this.StatusCode : int -> Microsoft.AspNetCore.Mvc.StatusCodeResult
Public Overridable Function StatusCode (statusCode As Integer) As StatusCodeResult

参数

statusCode
Int32

要对响应设置的状态代码。

返回

为响应创建的 StatusCodeResult 对象。

适用于

StatusCode(Int32, Object)

Source:
PageModel.cs
Source:
PageModel.cs
Source:
PageModel.cs

ObjectResult通过指定 statusCode 和 创建 对象value

public:
 virtual Microsoft::AspNetCore::Mvc::ObjectResult ^ StatusCode(int statusCode, System::Object ^ value);
public virtual Microsoft.AspNetCore.Mvc.ObjectResult StatusCode (int statusCode, object value);
abstract member StatusCode : int * obj -> Microsoft.AspNetCore.Mvc.ObjectResult
override this.StatusCode : int * obj -> Microsoft.AspNetCore.Mvc.ObjectResult
Public Overridable Function StatusCode (statusCode As Integer, value As Object) As ObjectResult

参数

statusCode
Int32

要对响应设置的状态代码。

value
Object

要在 ObjectResult 上设置的值。

返回

为响应创建的 ObjectResult 对象。

适用于