ObjectContent<T> Constructor

 

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

Overload List

Name Description
System_CAPS_pubmethod ObjectContent<T>(T, MediaTypeFormatter)

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

System_CAPS_pubmethod ObjectContent<T>(T, MediaTypeFormatter, MediaTypeHeaderValue)

Initializes a new instance of the <see cref="T:System.Net.Http.ObjectContent`1" /> class.

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

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

See Also

ObjectContent<T> Class
System.Net.Http Namespace

Return to top

ObjectContent<T> Constructor (T, MediaTypeFormatter)

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

Syntax

public ObjectContent(
    T value,
    MediaTypeFormatter formatter
)
public:
ObjectContent(
    T value,
    MediaTypeFormatter^ formatter
)
new : 
        value:'T *
        formatter:MediaTypeFormatter -> ObjectContent
Public Sub New (
    value As T,
    formatter As MediaTypeFormatter
)

Parameters

  • value
    Type: T

    The value of the object this instance will contain.

Return to top

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

Initializes a new instance of the <see cref="T:System.Net.Http.ObjectContent`1" /> class.

Syntax

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 Sub New (
    value As T,
    formatter As MediaTypeFormatter,
    mediaType As MediaTypeHeaderValue
)

Parameters

  • value
    Type: T

    The value of the object this instance will contain.

Return to top

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

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

Syntax

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 Sub New (
    value As T,
    formatter As MediaTypeFormatter,
    mediaType As 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.

Return to top