https://github.com/soenneker/soenneker.cosmos.serializer
A fast, lightweight JSON (de)serializer for Azure Cosmos DB
https://github.com/soenneker/soenneker.cosmos.serializer
azure cosmos csharp dotnet json serialization
Last synced: about 1 month ago
JSON representation
A fast, lightweight JSON (de)serializer for Azure Cosmos DB
- Host: GitHub
- URL: https://github.com/soenneker/soenneker.cosmos.serializer
- Owner: soenneker
- License: mit
- Created: 2023-03-29T01:19:48.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2026-02-19T04:53:38.000Z (5 months ago)
- Last Synced: 2026-02-19T07:26:35.935Z (5 months ago)
- Topics: azure, cosmos, csharp, dotnet, json, serialization
- Language: C#
- Homepage: https://soenneker.com
- Size: 3.06 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
- Security: .github/SECURITY.md
Awesome Lists containing this project
README
[](https://www.nuget.org/packages/Soenneker.Cosmos.Serializer/)
[](https://github.com/soenneker/soenneker.cosmos.serializer/actions/workflows/publish-package.yml)
[](https://www.nuget.org/packages/Soenneker.Cosmos.Serializer/)
[](https://github.com/soenneker/soenneker.cosmos.serializer/actions/workflows/codeql.yml)
#  Soenneker.Cosmos.Serializer
### A fast, lightweight JSON (de)serializer for Azure Cosmos DB
This serializer leverages `Systems.Text.Json`, overriding the default Json.Net serializer. It also uses `RecyclableMemoryStream` for further memory improvements.
## Installation
```
dotnet add package Soenneker.Cosmos.Serializer
```
## Usage
When constructing a `CosmosClientOptions`, simply set the `Serializer` property to a new instance and use your [`IMemoryStreamUtil`](https://github.com/soenneker/soenneker.utils.memorystream) singleton.
```csharp
var clientOptions = new CosmosClientOptions()
{
Serializer = new CosmosSystemTextJsonSerializer(_memoryStreamUtil)
};
```