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: TThe value of the object this instance will contain.
formatter
Type: System.Net.Http.Formatting.MediaTypeFormatterThe formatter to use when serializing the value.
mediaType
Type: MediaTypeHeaderValueThe authoritative value of the Content-Type header. Can be null, in which case the default content type of the formatter will be used.