JsonMediaTypeFormatter.CreateDefaultSerializer Method

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Creates the default serializer used to serialize objects of the specified type.

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

Syntax

'Declaration
Public Shared Function CreateDefaultSerializer ( _
    type As Type, _
    knownTypes As IEnumerable(Of Type), _
    allowReferenceDataContracts As Boolean _
) As DataContractJsonSerializer
public static DataContractJsonSerializer CreateDefaultSerializer(
    Type type,
    IEnumerable<Type> knownTypes,
    bool allowReferenceDataContracts
)
public:
static DataContractJsonSerializer^ CreateDefaultSerializer(
    Type^ type, 
    IEnumerable<Type^>^ knownTypes, 
    bool allowReferenceDataContracts
)
static member CreateDefaultSerializer : 
        type:Type * 
        knownTypes:IEnumerable<Type> * 
        allowReferenceDataContracts:bool -> DataContractJsonSerializer 
public static function CreateDefaultSerializer(
    type : Type, 
    knownTypes : IEnumerable<Type>, 
    allowReferenceDataContracts : boolean
) : DataContractJsonSerializer

Parameters

  • type
    Type: System.Type
    The type of object to create a serializer for.
  • allowReferenceDataContracts
    Type: System.Boolean
    true to create a serializer that can handle reference data contracts, otherwise false.

Return Value

Type: System.Runtime.Serialization.Json.DataContractJsonSerializer
A DataContractJsonSerializer that can serialize instances of the specified type.

.NET Framework Security

See Also

Reference

JsonMediaTypeFormatter Class

System.Net.Http.Formatting Namespace