Dela via


ApiController.Content<T>(HttpStatusCode, T) Method

Definition

Creates a NegotiatedContentResult<T> with the specified values.

[Microsoft.AspNetCore.Mvc.NonAction]
public virtual System.Web.Http.NegotiatedContentResult<T> Content<T> (System.Net.HttpStatusCode statusCode, T value);
[<Microsoft.AspNetCore.Mvc.NonAction>]
abstract member Content : System.Net.HttpStatusCode * 'T -> System.Web.Http.NegotiatedContentResult<'T>
override this.Content : System.Net.HttpStatusCode * 'T -> System.Web.Http.NegotiatedContentResult<'T>
Public Overridable Function Content(Of T) (statusCode As HttpStatusCode, value As T) As NegotiatedContentResult(Of T)

Type Parameters

T

The type of content in the entity body.

Parameters

statusCode
HttpStatusCode

The HTTP status code for the response message.

value
T

The content value to negotiate and format in the entity body.

Returns

A NegotiatedContentResult<T> with the specified values.

Attributes

Applies to