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)
Syntax
'Declaration
<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
)
[ExtensionAttribute]
public:
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
- T
The type of value for the new ObjectContent.
Parameters
- response
Type: System.Net.Http.HttpResponseMessage
The existing HttpResponseMessage
- value
Type: T
The value for the new ObjectContent
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
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.