Share via


ObjectContent<T> Constructor (T, MediaTypeFormatter, )

Initializes a new instance of the <see cref="T:System.Net.Http.ObjectContent`1" /> 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 MediaTypeHeaderValue _
)
'Usage
Dim value As T
Dim formatter As MediaTypeFormatter 
Dim mediaType As MediaTypeHeaderValue 

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

Parameters

  • value
    Type: T

    The value of the object this instance will contain.

  • mediaType
    Type: MediaTypeHeaderValue

    The authoritative value of the Content-Type header. Can be null, in which case the default content type of the formatter will be used.

See Also

Reference

ObjectContent<T> Class

ObjectContent<T> Overload

System.Net.Http Namespace