JsonMediaTypeFormatter.SetSerializer Method (Type, DataContractJsonSerializer)
[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
Registers the DataContractJsonSerializer to use to read or write the specified type.
Namespace: System.Net.Http.Formatting
Assembly: System.Net.Http.Formatting (in System.Net.Http.Formatting.dll)
Syntax
'Declaration
Public Sub SetSerializer ( _
type As Type, _
serializer As DataContractJsonSerializer _
)
public void SetSerializer(
Type type,
DataContractJsonSerializer serializer
)
public:
void SetSerializer(
Type^ type,
DataContractJsonSerializer^ serializer
)
member SetSerializer :
type:Type *
serializer:DataContractJsonSerializer -> unit
public function SetSerializer(
type : Type,
serializer : DataContractJsonSerializer
)
Parameters
- type
Type: System.Type
The type of object that will be serialized or deserialized with the serializer.
- serializer
Type: System.Runtime.Serialization.Json.DataContractJsonSerializer
The DataContractJsonSerializer instance to use.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.