MediaTypeFormatter.CanWriteType Method

Queries whether this MediaTypeFormatter can serializean object of the specified type.

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


Public MustOverride Function CanWriteType ( _
    type As Type _
) As Boolean
Dim instance As MediaTypeFormatter
Dim type As Type
Dim returnValue As Boolean

returnValue = instance.CanWriteType(type)
public abstract bool CanWriteType(
    Type type
virtual bool CanWriteType(
    Type^ type
) abstract
abstract CanWriteType : 
        type:Type -> bool 
public abstract function CanWriteType(
    type : Type
) : boolean


Return Value

Type: System.Boolean
true if the MediaTypeFormatter can serialize the type; otherwise, false.


Derived classes must implement this method and indicate whether a type can be serialized.

See Also


MediaTypeFormatter Class

System.Net.Http.Formatting Namespace