ApiController.Content<T>(HttpStatusCode, T) 方法

定义

NegotiatedContentResult<T>创建具有指定值的 。

[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)

类型参数

T

实体正文中的内容类型。

参数

statusCode
HttpStatusCode

响应消息的 HTTP 状态代码。

value
T

要在实体正文中协商和设置格式的内容值。

返回

具有 NegotiatedContentResult<T> 指定值的 。

属性

适用于