Class SystemTextJsonCosmosSerializer
Inherited Members
Namespace: Benday.CosmosDb.Utilities
Assembly: Benday.CosmosDb.dll
Syntax
public class SystemTextJsonCosmosSerializer : CosmosLinqSerializer
Constructors
| Edit this page View SourceSystemTextJsonCosmosSerializer(JsonSerializerOptions)
Declaration
public SystemTextJsonCosmosSerializer(JsonSerializerOptions jsonSerializerOptions)
Parameters
| Type | Name | Description |
|---|---|---|
| JsonSerializerOptions | jsonSerializerOptions |
Methods
| Edit this page View SourceFromStream<T>(Stream)
Convert a Stream of JSON to an object. The implementation is responsible for Disposing of the stream, including when an exception is thrown, to avoid memory leaks.
Declaration
public override T FromStream<T>(Stream stream)
Parameters
| Type | Name | Description |
|---|---|---|
| Stream | stream | The Stream response containing JSON from Cosmos DB. |
Returns
| Type | Description |
|---|---|
| T | The object deserialized from the stream. |
Type Parameters
| Name | Description |
|---|---|
| T | Any type passed to Container. |
Overrides
| Edit this page View SourceSerializeMemberName(MemberInfo)
Convert a MemberInfo to a string for use in LINQ query translation. This must be implemented when using a custom serializer for LINQ queries.
Declaration
public override string? SerializeMemberName(MemberInfo memberInfo)
Parameters
| Type | Name | Description |
|---|---|---|
| MemberInfo | memberInfo | Any MemberInfo used in the query. |
Returns
| Type | Description |
|---|---|
| string | A serialized representation of the member. |
Overrides
| Edit this page View SourceToStream<T>(T)
Convert the object to a Stream. The caller will take ownership of the stream and ensure it is correctly disposed of. Stream.CanRead must be true.
Declaration
public override Stream ToStream<T>(T input)
Parameters
| Type | Name | Description |
|---|---|---|
| T | input | Any type passed to Container. |
Returns
| Type | Description |
|---|---|
| Stream | A readable Stream containing JSON of the serialized object. |
Type Parameters
| Name | Description |
|---|---|
| T |