Share via


ControllerBase.Ok Method

Definition

Overloads

Ok()

Creates an OkResult object that produces an empty Status200OK response.

Ok(Object)

Creates an OkObjectResult object that produces a Status200OK response.

Ok()

Source:
ControllerBase.cs
Source:
ControllerBase.cs
Source:
ControllerBase.cs

Creates an OkResult object that produces an empty Status200OK response.

[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.OkResult Ok();

Returns

The created OkResult for the response.

Attributes

Applies to

Ok(Object)

Source:
ControllerBase.cs
Source:
ControllerBase.cs
Source:
ControllerBase.cs

Creates an OkObjectResult object that produces a Status200OK response.

[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.OkObjectResult Ok(object value);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.OkObjectResult Ok(object? value);

Parameters

value
Object

The content value to format in the entity body.

Returns

The created OkObjectResult for the response.

Attributes

Applies to