ControllerBase.StatusCode 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
StatusCode(Int32) |
通过指定 |
StatusCode(Int32, Object) |
通过指定 |
StatusCode(Int32)
- Source:
- ControllerBase.cs
- Source:
- ControllerBase.cs
- Source:
- ControllerBase.cs
通过指定 statusCode
创建 StatusCodeResult 对象。
public:
virtual Microsoft::AspNetCore::Mvc::StatusCodeResult ^ StatusCode(int statusCode);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.StatusCodeResult StatusCode (int statusCode);
[<Microsoft.AspNetCore.Mvc.NonAction>]
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:
- ControllerBase.cs
- Source:
- ControllerBase.cs
- Source:
- ControllerBase.cs
通过指定 statusCode
和 value
来创建 ObjectResult 对象
public:
virtual Microsoft::AspNetCore::Mvc::ObjectResult ^ StatusCode(int statusCode, System::Object ^ value);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.ObjectResult StatusCode (int statusCode, object value);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.ObjectResult StatusCode (int statusCode, object? value);
[<Microsoft.AspNetCore.Mvc.NonAction>]
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 对象。
- 属性