Class NewtonsoftJsonObjectSerializer | Azure SDK for .NET

Azure.Core.Serialization.ObjectSerializer NewtonsoftJsonObjectSerializer The Newtonsoft.Json.JsonSerializerSettings instance to use when serializing/deserializing. settings is null. Returns a Newtonsoft.Json.JsonSerializerSettings that's used when initializing the NewtonsoftJsonObjectSerializer using the parameterless constructor. The settings have default converters added.

Inheritance

Azure.Core.Serialization.ObjectSerializer

NewtonsoftJsonObjectSerializer

Namespace: System.Dynamic.ExpandoObject
Assembly: Microsoft.Azure.Core.NewtonsoftJson.dll
Syntax
public class NewtonsoftJsonObjectSerializer : Azure.Core.Serialization.ObjectSerializer, Azure.Core.Serialization.IMemberNameConverter

Constructors

NewtonsoftJsonObjectSerializer()

Declaration
public NewtonsoftJsonObjectSerializer ();

NewtonsoftJsonObjectSerializer(JsonSerializerSettings)

Declaration
public NewtonsoftJsonObjectSerializer (Newtonsoft.Json.JsonSerializerSettings settings);
Parameters
Newtonsoft.Json.JsonSerializerSettings settings

The Newtonsoft.Json.JsonSerializerSettings instance to use when serializing/deserializing.

Exceptions
System.ArgumentNullException

settings is null.

Methods

CreateJsonSerializerSettings()

Returns a Newtonsoft.Json.JsonSerializerSettings that's used when initializing the NewtonsoftJsonObjectSerializer using the parameterless constructor. The settings have default converters added.

Declaration
public static Newtonsoft.Json.JsonSerializerSettings CreateJsonSerializerSettings ();
Returns
Newtonsoft.Json.JsonSerializerSettings

Deserialize(Stream, Type, CancellationToken)

Read the binary representation into a returnType. The Stream will be read to completion.

Declaration
public override object Deserialize (System.IO.Stream stream, Type returnType, System.Threading.CancellationToken cancellationToken);
Parameters
System.IO.Stream stream

The System.IO.Stream to read from.

System.Type returnType

The type of the object to convert to and return.

System.Threading.CancellationToken cancellationToken

The System.Threading.CancellationToken to use during deserialization.

Returns
System.Object
Exceptions
System.ArgumentNullException

stream or returnType is null.

DeserializeAsync(Stream, Type, CancellationToken)

Read the binary representation into a returnType. The Stream will be read to completion.

Declaration
public override System.Threading.Tasks.ValueTask<object> DeserializeAsync (System.IO.Stream stream, Type returnType, System.Threading.CancellationToken cancellationToken);
Parameters
System.IO.Stream stream

The System.IO.Stream to read from.

System.Type returnType

The type of the object to convert to and return.

System.Threading.CancellationToken cancellationToken

The System.Threading.CancellationToken to use during deserialization.

Returns
System.Threading.Tasks.ValueTask<System.Object>
Exceptions
System.ArgumentNullException

stream or returnType is null.

Serialize(Stream, Object, Type, CancellationToken)

Convert the provided value to it's binary representation and write it to System.IO.Stream.

Declaration
public override void Serialize (System.IO.Stream stream, object value, Type inputType, System.Threading.CancellationToken cancellationToken);
Parameters
System.IO.Stream stream

The System.IO.Stream to write to.

System.Object value

The value to convert.

System.Type inputType

The type of the value to convert.

System.Threading.CancellationToken cancellationToken

The System.Threading.CancellationToken to use during serialization.

Exceptions
System.ArgumentNullException

stream or inputType is null.

SerializeAsync(Stream, Object, Type, CancellationToken)

Convert the provided value to it's binary representation and write it to System.IO.Stream.

Declaration
public override System.Threading.Tasks.ValueTask SerializeAsync (System.IO.Stream stream, object value, Type inputType, System.Threading.CancellationToken cancellationToken);
Parameters
System.IO.Stream stream

The System.IO.Stream to write to.

System.Object value

The value to convert.

System.Type inputType

The type of the value to convert.

System.Threading.CancellationToken cancellationToken

The System.Threading.CancellationToken to use during serialization.

Returns
System.Threading.Tasks.ValueTask
Exceptions
System.ArgumentNullException

stream or inputType is null.

Explicit Interface Implementations

IMemberNameConverter.ConvertMemberName(MemberInfo)

Converts a System.Reflection.MemberInfo to a serializable member name.

Declaration
string IMemberNameConverter.ConvertMemberName (System.Reflection.MemberInfo member);
Parameters
System.Reflection.MemberInfo member

The System.Reflection.MemberInfo to convert to a serializable member name.

Returns
System.String

The serializable member name, or null if the member is not defined or ignored by the serializer.

Exceptions
System.ArgumentNullException

member is null.

ncG1vNJzZmiZqqq%2Fpr%2FDpJuom6Njr627wWeaqKqVY8SqusOorqxmnprBcHDWnplonJ%2Bpu6bAjoagnKqfqLynwI16sa6qlWOQsL7EZ4Wer6Sku7S7xa2BrKeeZH9vfI1pZpqomWSOu8HRnmV8p6Kae5Sx0aKYpaGqlsGqu81oeLOtopp7hLvRnmWMnaKerq212ZqroqeeY5umw9OopaynlqmXtLvNiJmjnZOpoKa%2ByJqjorKVp3upwMyl

 Share!