HttpResponseMessageExtensions.CreateContent<T> Method (HttpResponseMessage, T)

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Creates a new ObjectContent instance associated with the given HttpResponseMessage.

Namespace:  System.Net.Http
Assembly:  System.Net.Http.Formatting (in System.Net.Http.Formatting.dll)


<ExtensionAttribute> _
Public Shared Function CreateContent(Of T) ( _
    response As HttpResponseMessage, _
    value As T _
) As ObjectContent(Of T)
public static ObjectContent<T> CreateContent<T>(
    this HttpResponseMessage response,
    T value
generic<typename T>
static ObjectContent<T>^ CreateContent(
    HttpResponseMessage^ response, 
    T value
static member CreateContent : 
        response:HttpResponseMessage * 
        value:'T -> ObjectContent<'T> 
JScript does not support generic types or methods.

Type Parameters


Return Value

Type: System.Net.Http.ObjectContent<T>

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type HttpResponseMessage. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

.NET Framework Security

See Also


HttpResponseMessageExtensions Class

CreateContent Overload

System.Net.Http Namespace