MediaTypeFormatterCollection.FindWriter Method
Searches a collection for a formatter that can write the .NET type in the given mediaType.
Namespace: System.Net.Http.Formatting
Assembly: System.Net.Http.Formatting (in System.Net.Http.Formatting.dll)
Syntax
'Declaration
Public Function FindWriter ( _
type As Type, _
mediaType As MediaTypeHeaderValue _
) As MediaTypeFormatter
'Usage
Dim instance As MediaTypeFormatterCollection
Dim type As Type
Dim mediaType As MediaTypeHeaderValue
Dim returnValue As MediaTypeFormatter
returnValue = instance.FindWriter(type, _
mediaType)
public MediaTypeFormatter FindWriter(
Type type,
MediaTypeHeaderValue mediaType
)
public:
MediaTypeFormatter^ FindWriter(
Type^ type,
MediaTypeHeaderValue^ mediaType
)
member FindWriter :
type:Type *
mediaType:MediaTypeHeaderValue -> MediaTypeFormatter
public function FindWriter(
type : Type,
mediaType : MediaTypeHeaderValue
) : MediaTypeFormatter
Parameters
type
Type: System.TypeThe .NET type to write.
mediaType
Type: MediaTypeHeaderValueThe media type to match on.
Return Value
Type: System.Net.Http.Formatting.MediaTypeFormatter
The MediaTypeFormatter that can write the type, or null if no formatter found.