# HostingExtensions

Package: [Microsoft.Orleans.Persistence.Cosmos](/orleans/docs/api/csharp/microsoft.orleans.persistence.cosmos/) 10.0.0

[NuGet package](https://www.nuget.org/packages/Microsoft.Orleans.Persistence.Cosmos) | [Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Azure/Orleans.Persistence.Cosmos/HostingExtensions.cs#L13)

```csharp
public static class HostingExtensions
```

Extension methods for configuring Azure Cosmos DB persistence.

## Methods

- [AddCosmosGrainStorage(IServiceCollection, string, Action&lt;CosmosGrainStorageOptions&gt;)](/orleans/docs/api/csharp/microsoft.orleans.persistence.cosmos/orleans.hosting.hostingextensions/methods/addcosmosgrainstorage-this-microsoft-extensions-dependencyinjection-iservicecoll-a507245e/)
- [AddCosmosGrainStorage(IServiceCollection, string, Action&lt;OptionsBuilder&lt;CosmosGrainStorageOptions&gt;&gt;)](/orleans/docs/api/csharp/microsoft.orleans.persistence.cosmos/orleans.hosting.hostingextensions/methods/addcosmosgrainstorage-this-microsoft-extensions-dependencyinjection-iservicecoll-11e671f2/)
- [AddCosmosGrainStorage(ISiloBuilder, string, Action&lt;CosmosGrainStorageOptions&gt;)](/orleans/docs/api/csharp/microsoft.orleans.persistence.cosmos/orleans.hosting.hostingextensions/methods/addcosmosgrainstorage-this-orleans-hosting-isilobuilder-string-system-action-orl-f6a139eb/)
- [AddCosmosGrainStorage(ISiloBuilder, string, Action&lt;CosmosGrainStorageOptions&gt;, Type)](/orleans/docs/api/csharp/microsoft.orleans.persistence.cosmos/orleans.hosting.hostingextensions/methods/addcosmosgrainstorage-this-orleans-hosting-isilobuilder-string-system-action-orl-9d7bb572/)
- [AddCosmosGrainStorage(ISiloBuilder, string, Action&lt;OptionsBuilder&lt;CosmosGrainStorageOptions&gt;&gt;)](/orleans/docs/api/csharp/microsoft.orleans.persistence.cosmos/orleans.hosting.hostingextensions/methods/addcosmosgrainstorage-this-orleans-hosting-isilobuilder-string-system-action-mic-fc355843/)
- [AddCosmosGrainStorage(ISiloBuilder, string, Type, Action&lt;OptionsBuilder&lt;CosmosGrainStorageOptions&gt;&gt;)](/orleans/docs/api/csharp/microsoft.orleans.persistence.cosmos/orleans.hosting.hostingextensions/methods/addcosmosgrainstorage-this-orleans-hosting-isilobuilder-string-system-type-syste-e3ed5be2/)
- [AddCosmosGrainStorage(ISiloBuilder, string, Action&lt;CosmosGrainStorageOptions&gt;)](/orleans/docs/api/csharp/microsoft.orleans.persistence.cosmos/orleans.hosting.hostingextensions/methods/addcosmosgrainstorage-1-this-orleans-hosting-isilobuilder-string-system-action-o-42abbec1/)
- [AddCosmosGrainStorage(ISiloBuilder, string, Action&lt;OptionsBuilder&lt;CosmosGrainStorageOptions&gt;&gt;)](/orleans/docs/api/csharp/microsoft.orleans.persistence.cosmos/orleans.hosting.hostingextensions/methods/addcosmosgrainstorage-1-this-orleans-hosting-isilobuilder-string-system-action-m-affbcbad/)
- [AddCosmosGrainStorageAsDefault(IServiceCollection, Action&lt;CosmosGrainStorageOptions&gt;)](/orleans/docs/api/csharp/microsoft.orleans.persistence.cosmos/orleans.hosting.hostingextensions/methods/addcosmosgrainstorageasdefault-this-microsoft-extensions-dependencyinjection-ise-e6d48573/)
- [AddCosmosGrainStorageAsDefault(IServiceCollection, Action&lt;OptionsBuilder&lt;CosmosGrainStorageOptions&gt;&gt;)](/orleans/docs/api/csharp/microsoft.orleans.persistence.cosmos/orleans.hosting.hostingextensions/methods/addcosmosgrainstorageasdefault-this-microsoft-extensions-dependencyinjection-ise-b99f47db/)
- [AddCosmosGrainStorageAsDefault(ISiloBuilder, Action&lt;CosmosGrainStorageOptions&gt;)](/orleans/docs/api/csharp/microsoft.orleans.persistence.cosmos/orleans.hosting.hostingextensions/methods/addcosmosgrainstorageasdefault-this-orleans-hosting-isilobuilder-system-action-o-4597b534/)
- [AddCosmosGrainStorageAsDefault(ISiloBuilder, Action&lt;CosmosGrainStorageOptions&gt;, Type)](/orleans/docs/api/csharp/microsoft.orleans.persistence.cosmos/orleans.hosting.hostingextensions/methods/addcosmosgrainstorageasdefault-this-orleans-hosting-isilobuilder-system-action-o-c9d37c97/)
- [AddCosmosGrainStorageAsDefault(ISiloBuilder, Action&lt;OptionsBuilder&lt;CosmosGrainStorageOptions&gt;&gt;)](/orleans/docs/api/csharp/microsoft.orleans.persistence.cosmos/orleans.hosting.hostingextensions/methods/addcosmosgrainstorageasdefault-this-orleans-hosting-isilobuilder-system-action-m-29b37b1c/)
- [AddCosmosGrainStorageAsDefault(ISiloBuilder, Type, Action&lt;OptionsBuilder&lt;CosmosGrainStorageOptions&gt;&gt;)](/orleans/docs/api/csharp/microsoft.orleans.persistence.cosmos/orleans.hosting.hostingextensions/methods/addcosmosgrainstorageasdefault-this-orleans-hosting-isilobuilder-system-type-sys-5c41de9b/)
- [AddCosmosGrainStorageAsDefault(ISiloBuilder, Action&lt;CosmosGrainStorageOptions&gt;)](/orleans/docs/api/csharp/microsoft.orleans.persistence.cosmos/orleans.hosting.hostingextensions/methods/addcosmosgrainstorageasdefault-1-this-orleans-hosting-isilobuilder-system-action-7db9a628/)
- [AddCosmosGrainStorageAsDefault(ISiloBuilder, Action&lt;OptionsBuilder&lt;CosmosGrainStorageOptions&gt;&gt;)](/orleans/docs/api/csharp/microsoft.orleans.persistence.cosmos/orleans.hosting.hostingextensions/methods/addcosmosgrainstorageasdefault-1-this-orleans-hosting-isilobuilder-system-action-bce4db20/)
