> ## Documentation Index
> Fetch the complete documentation index at: https://si.easyaf.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# CosmosSystemTextJsonSerializer

> Cosmos serializer that uses source-generated [CosmosMcpTasksJsonContext](/mcpessentials/api-reference/CloudNimble/McpEssentials/Cosmos/Tasks/CosmosMcpTasksJsonContext) wit...

## Definition

**Assembly:** CloudNimble.McpEssentials.Cosmos.dll

**Namespace:** CloudNimble.McpEssentials.Cosmos.Tasks

**Inheritance:** Microsoft.Azure.Cosmos.CosmosSerializer

## Syntax

```csharp theme={"dark"}
CloudNimble.McpEssentials.Cosmos.Tasks.CosmosSystemTextJsonSerializer
```

## Summary

Cosmos serializer that uses source-generated [CosmosMcpTasksJsonContext](https://si.easyaf.dev/mcpessentials/api-reference/CloudNimble/McpEssentials/Cosmos/Tasks/CosmosMcpTasksJsonContext.md)
with a reflection fallback for types the context does not list.

## Constructors

### &#x20;.ctor

Initializes a new instance using [CosmosSystemTextJsonSerializer.CreateOptions](https://si.easyaf.dev/mcpessentials/api-reference/CloudNimble/McpEssentials/Cosmos/Tasks/CosmosSystemTextJsonSerializer.md#createoptions).

#### Syntax

```csharp theme={"dark"}
public CosmosSystemTextJsonSerializer()
```

## Methods

### &#x20;CreateOptions

Builds the JSON options passed to Cosmos and used by unit tests.

#### Syntax

```csharp theme={"dark"}
public static System.Text.Json.JsonSerializerOptions CreateOptions()
```

#### Returns

Type: `System.Text.Json.JsonSerializerOptions`
Camel-case options with the source-generated context first.

### &#x20;FromStream Override

#### Syntax

```csharp theme={"dark"}
public override T FromStream<T>(System.IO.Stream stream)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `stream` | `System.IO.Stream` | - |

#### Returns

Type: `T`

### &#x20;ToStream Override

#### Syntax

```csharp theme={"dark"}
public override System.IO.Stream ToStream<T>(T input)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `input` | `T` | - |

#### Returns

Type: `System.IO.Stream`


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.