ObjectContent<T> Constructor (T, MediaTypeFormatter, String)

Initializes a new instance of the ObjectContent<T> class.

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

Syntax

'Declaration
Public Sub New ( _
    value As T, _
    formatter As MediaTypeFormatter, _
    mediaType As String _
)
'Usage
Dim value As T
Dim formatter As MediaTypeFormatter 
Dim mediaType As String 

Dim instance As New ObjectContent(value, formatter, _
    mediaType)
public ObjectContent(
    T value,
    MediaTypeFormatter formatter,
    string mediaType
)
public:
ObjectContent(
    T value, 
    MediaTypeFormatter^ formatter, 
    String^ mediaType
)
new : 
        value:'T * 
        formatter:MediaTypeFormatter * 
        mediaType:string -> ObjectContent
public function ObjectContent(
    value : T, 
    formatter : MediaTypeFormatter, 
    mediaType : String
)

Parameters

  • value
    Type: T

    The value of the object this instance will contain.

  • mediaType
    Type: System.String

    The authoritative value of the Content-Type header.

See Also

Reference

ObjectContent<T> Class

ObjectContent<T> Overload

System.Net.Http Namespace