Bagikan melalui


ControllerBase.StatusCode Metode

Definisi

Overload

StatusCode(Int32)

Membuat objek StatusCodeResult dengan menentukan statusCode.

StatusCode(Int32, Object)

Membuat objek ObjectResult dengan menentukan statusCode dan value

StatusCode(Int32)

Sumber:
ControllerBase.cs
Sumber:
ControllerBase.cs
Sumber:
ControllerBase.cs

Membuat objek StatusCodeResult dengan menentukan statusCode.

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

Parameter

statusCode
Int32

Kode status untuk diatur pada respons.

Mengembalikan

Objek StatusCodeResult yang dibuat untuk respons.

Atribut

Berlaku untuk

StatusCode(Int32, Object)

Sumber:
ControllerBase.cs
Sumber:
ControllerBase.cs
Sumber:
ControllerBase.cs

Membuat objek ObjectResult dengan menentukan statusCode dan value

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

Parameter

statusCode
Int32

Kode status untuk diatur pada respons.

value
Object

Nilai yang akan diatur pada ObjectResult.

Mengembalikan

Objek ObjectResult yang dibuat untuk respons.

Atribut

Berlaku untuk