ObjectContent Constructor

 

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

Overload List

Name Description
System_CAPS_pubmethod ObjectContent(Type, Object, MediaTypeFormatter)

Initializes a new instance of the ObjectContent class.

System_CAPS_pubmethod ObjectContent(Type, Object, MediaTypeFormatter, MediaTypeHeaderValue)

Initializes a new instance of the ObjectContent class.

System_CAPS_pubmethod ObjectContent(Type, Object, MediaTypeFormatter, String)

Initializes a new instance of the ObjectContent class.

See Also

ObjectContent Class
System.Net.Http Namespace

Return to top

ObjectContent Constructor (Type, Object, MediaTypeFormatter)

Initializes a new instance of the ObjectContent class.

Syntax

public ObjectContent(
    Type type,
    object value,
    MediaTypeFormatter formatter
)
public:
ObjectContent(
    Type^ type,
    Object^ value,
    MediaTypeFormatter^ formatter
)
new : 
        type:Type *
        value:Object *
        formatter:MediaTypeFormatter -> ObjectContent
Public Sub New (
    type As Type,
    value As Object,
    formatter As MediaTypeFormatter
)

Parameters

  • type
    Type: System.Type

    The type of object this instance will contain.

  • value
    Type: System.Object

    The value of the object this instance will contain.

Return to top

ObjectContent Constructor (Type, Object, MediaTypeFormatter, MediaTypeHeaderValue)

Initializes a new instance of the ObjectContent class.

Syntax

public ObjectContent(
    Type type,
    object value,
    MediaTypeFormatter formatter,
    MediaTypeHeaderValue mediaType
)
public:
ObjectContent(
    Type^ type,
    Object^ value,
    MediaTypeFormatter^ formatter,
    MediaTypeHeaderValue^ mediaType
)
new : 
        type:Type *
        value:Object *
        formatter:MediaTypeFormatter *
        mediaType:MediaTypeHeaderValue -> ObjectContent
Public Sub New (
    type As Type,
    value As Object,
    formatter As MediaTypeFormatter,
    mediaType As MediaTypeHeaderValue
)

Parameters

  • type
    Type: System.Type

    The type of object this instance will contain.

  • value
    Type: System.Object

    The value of the object this instance will contain.

Return to top

ObjectContent Constructor (Type, Object, MediaTypeFormatter, String)

Initializes a new instance of the ObjectContent class.

Syntax

public ObjectContent(
    Type type,
    object value,
    MediaTypeFormatter formatter,
    string mediaType
)
public:
ObjectContent(
    Type^ type,
    Object^ value,
    MediaTypeFormatter^ formatter,
    String^ mediaType
)
new : 
        type:Type *
        value:Object *
        formatter:MediaTypeFormatter *
        mediaType:string -> ObjectContent
Public Sub New (
    type As Type,
    value As Object,
    formatter As MediaTypeFormatter,
    mediaType As String
)

Parameters

  • type
    Type: System.Type

    The type of object this instance will contain.

  • value
    Type: System.Object

    The value of the object this instance will contain.

  • mediaType
    Type: System.String

    The authoritative value of the Content-Type header.

Return to top