ApiController.Content<T>(HttpStatusCode, T) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for