Class JsonSerializable
Represents the base class for Azure Cosmos DB database objects and provides methods for serializing and deserializing from JSON.
public abstract class JsonSerializable
- Inheritance
-
JsonSerializable
- Derived
- Inherited Members
- Extension Methods
Methods
LoadFrom(JsonReader)
Loads the object from the specified JSON reader in the Azure Cosmos DB service.
public virtual void LoadFrom(JsonReader reader)
Parameters
readerJsonReaderLoads the object from this JSON reader.
LoadFrom(JsonReader, JsonSerializerSettings)
Loads the object from the specified JSON reader in the Azure Cosmos DB service.
public virtual void LoadFrom(JsonReader reader, JsonSerializerSettings serializerSettings)
Parameters
readerJsonReaderLoads the object from this JSON reader.
serializerSettingsJsonSerializerSettingsThe JsonSerializerSettings to be used.
LoadFromWithConstructor<T>(Stream, Func<T>)
Deserializes the specified stream using the given constructor in the Azure Cosmos DB service.
public static T LoadFromWithConstructor<T>(Stream stream, Func<T> constructorFunction)
Parameters
streamStreamThe stream to load from.
constructorFunctionFunc<T>The constructor used for the returning object.
Returns
- T
The object loaded from the specified stream.
Type Parameters
TThe type of the object.
LoadFromWithConstructor<T>(Stream, Func<T>, JsonSerializerSettings)
Deserializes the specified stream using the given constructor in the Azure Cosmos DB service.
public static T LoadFromWithConstructor<T>(Stream stream, Func<T> constructorFunction, JsonSerializerSettings settings)
Parameters
streamStreamThe stream to load from.
constructorFunctionFunc<T>The constructor used for the returning object.
settingsJsonSerializerSettingsThe JsonSerializerSettings to be used.
Returns
- T
The object loaded from the specified stream.
Type Parameters
TThe type of the object.
LoadFrom<T>(Stream)
Loads the object from the specified stream in the Azure Cosmos DB service.
public static T LoadFrom<T>(Stream stream) where T : JsonSerializable, new()
Parameters
streamStreamThe stream to load from.
Returns
- T
The object loaded from the specified stream.
Type Parameters
TThe type of the returning object.
SaveTo(Stream, SerializationFormattingPolicy)
Saves the object to the specified stream in the Azure Cosmos DB service.
public void SaveTo(Stream stream, SerializationFormattingPolicy formattingPolicy = SerializationFormattingPolicy.None)
Parameters
streamStreamSaves the object to this output stream.
formattingPolicySerializationFormattingPolicyUses an optional serialization formatting policy when saving the object. The default policy is set to None.
SaveTo(Stream, SerializationFormattingPolicy, JsonSerializerSettings)
Saves the object to the specified stream in the Azure Cosmos DB service.
public void SaveTo(Stream stream, SerializationFormattingPolicy formattingPolicy, JsonSerializerSettings settings)
Parameters
streamStreamSaves the object to this output stream.
formattingPolicySerializationFormattingPolicyUses a custom serialization formatting policy when saving the object.
settingsJsonSerializerSettingsThe serializer settings to use.
ToString()
Returns the string representation of the object in the Azure Cosmos DB service.
public override string ToString()
Returns
- string
The string representation of the object.