# OrleansServiceExtensions

- Kind: `class`
- Package: [Aspire.Hosting.Orleans](/reference/api/csharp/aspire.hosting.orleans.md)
- Version: `13.4.0`
- Namespace: `Aspire.Hosting`
- Target framework: `net8.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Orleans/OrleansServiceExtensions.cs)

Extensions to `Hosting.IDistributedApplicationBuilder` related to Orleans.

## Definition

```csharp
namespace Aspire.Hosting;

public static class OrleansServiceExtensions
{
    // ...
}
```

## Methods

- [AddOrleans(IDistributedApplicationBuilder, string)](/reference/api/csharp/aspire.hosting.orleans/orleansserviceextensions/methods.md#addorleans-idistributedapplicationbuilder-string) : [OrleansService](/reference/api/csharp/aspire.hosting.orleans/orleansservice.md) `extension` `ats export` -- Adds an Orleans service to the application.
- [AsClient(OrleansService)](/reference/api/csharp/aspire.hosting.orleans/orleansserviceextensions/methods.md#asclient-orleansservice) : [OrleansServiceClient](/reference/api/csharp/aspire.hosting.orleans/orleansserviceclient.md) `extension` `ats export` -- Returns a model of the clients of an Orleans service.
- [WithBroadcastChannel(OrleansService, string, IProviderConfiguration)](/reference/api/csharp/aspire.hosting.orleans/orleansserviceextensions/methods.md#withbroadcastchannel-orleansservice-string-iproviderconfiguration) : [OrleansService](/reference/api/csharp/aspire.hosting.orleans/orleansservice.md) `extension` `ats ignored` -- Adds a broadcast channel provider to the Orleans service.
- [WithBroadcastChannel(OrleansService, string)](/reference/api/csharp/aspire.hosting.orleans/orleansserviceextensions/methods.md#withbroadcastchannel-orleansservice-string) : [OrleansService](/reference/api/csharp/aspire.hosting.orleans/orleansservice.md) `extension` `ats export` -- Adds a broadcast channel provider to the Orleans service.
- [WithClusterId(OrleansService, string)](/reference/api/csharp/aspire.hosting.orleans/orleansserviceextensions/methods.md#withclusterid-orleansservice-string) : [OrleansService](/reference/api/csharp/aspire.hosting.orleans/orleansservice.md) `extension` `ats export` -- Sets the ClusterId of the Orleans service.
- [WithClusterId(OrleansService, IResourceBuilder<ParameterResource>)](/reference/api/csharp/aspire.hosting.orleans/orleansserviceextensions/methods.md#withclusterid-orleansservice-iresourcebuilder-parameterresource) : [OrleansService](/reference/api/csharp/aspire.hosting.orleans/orleansservice.md) `extension` `ats ignored` -- Sets the ClusterId of the Orleans service.
- [WithClustering(OrleansService, IResourceBuilder<IResourceWithConnectionString>)](/reference/api/csharp/aspire.hosting.orleans/orleansserviceextensions/methods.md#withclustering-orleansservice-iresourcebuilder-iresourcewithconnectionstring) : [OrleansService](/reference/api/csharp/aspire.hosting.orleans/orleansservice.md) `extension` `ats export` -- Configures the Orleans service to use the provided clustering provider.
- [WithClustering(OrleansService, IProviderConfiguration)](/reference/api/csharp/aspire.hosting.orleans/orleansserviceextensions/methods.md#withclustering-orleansservice-iproviderconfiguration) : [OrleansService](/reference/api/csharp/aspire.hosting.orleans/orleansservice.md) `extension` `ats ignored` -- Configures the Orleans service to use the provided clustering provider.
- [WithDevelopmentClustering(OrleansService)](/reference/api/csharp/aspire.hosting.orleans/orleansserviceextensions/methods.md#withdevelopmentclustering-orleansservice) : [OrleansService](/reference/api/csharp/aspire.hosting.orleans/orleansservice.md) `extension` `ats export` -- Configures the Orleans service to use development-only clustering.
- [WithGrainDirectory(OrleansService, IResourceBuilder<IResourceWithConnectionString>)](/reference/api/csharp/aspire.hosting.orleans/orleansserviceextensions/methods.md#withgraindirectory-orleansservice-iresourcebuilder-iresourcewithconnectionstring) : [OrleansService](/reference/api/csharp/aspire.hosting.orleans/orleansservice.md) `extension` `ats ignored` -- Adds a grain directory provider to the Orleans service.
- [WithGrainDirectory(OrleansService, string, IResourceBuilder<IResourceWithConnectionString>)](/reference/api/csharp/aspire.hosting.orleans/orleansserviceextensions/methods.md#withgraindirectory-orleansservice-string-iresourcebuilder-iresourcewithconnectionstring) : [OrleansService](/reference/api/csharp/aspire.hosting.orleans/orleansservice.md) `extension` `ats export` -- Adds a grain directory provider to the Orleans service.
- [WithGrainDirectory(OrleansService, string, IProviderConfiguration)](/reference/api/csharp/aspire.hosting.orleans/orleansserviceextensions/methods.md#withgraindirectory-orleansservice-string-iproviderconfiguration) : [OrleansService](/reference/api/csharp/aspire.hosting.orleans/orleansservice.md) `extension` `ats ignored` -- Adds a grain directory provider to the Orleans service.
- [WithGrainStorage(OrleansService, IResourceBuilder<IResourceWithConnectionString>)](/reference/api/csharp/aspire.hosting.orleans/orleansserviceextensions/methods.md#withgrainstorage-orleansservice-iresourcebuilder-iresourcewithconnectionstring) : [OrleansService](/reference/api/csharp/aspire.hosting.orleans/orleansservice.md) `extension` `ats ignored` -- Adds a grain storage provider to the Orleans service.
- [WithGrainStorage(OrleansService, string, IResourceBuilder<IResourceWithConnectionString>)](/reference/api/csharp/aspire.hosting.orleans/orleansserviceextensions/methods.md#withgrainstorage-orleansservice-string-iresourcebuilder-iresourcewithconnectionstring) : [OrleansService](/reference/api/csharp/aspire.hosting.orleans/orleansservice.md) `extension` `ats export` -- Adds a grain storage provider to the Orleans service.
- [WithGrainStorage(OrleansService, string, IProviderConfiguration)](/reference/api/csharp/aspire.hosting.orleans/orleansserviceextensions/methods.md#withgrainstorage-orleansservice-string-iproviderconfiguration) : [OrleansService](/reference/api/csharp/aspire.hosting.orleans/orleansservice.md) `extension` `ats ignored` -- Adds a grain storage provider to the Orleans service.
- [WithMemoryGrainStorage(OrleansService, string)](/reference/api/csharp/aspire.hosting.orleans/orleansserviceextensions/methods.md#withmemorygrainstorage-orleansservice-string) : [OrleansService](/reference/api/csharp/aspire.hosting.orleans/orleansservice.md) `extension` `ats export` -- Adds an in-memory grain storage to the Orleans service.
- [WithMemoryReminders(OrleansService)](/reference/api/csharp/aspire.hosting.orleans/orleansserviceextensions/methods.md#withmemoryreminders-orleansservice) : [OrleansService](/reference/api/csharp/aspire.hosting.orleans/orleansservice.md) `extension` `ats export` -- Configures in-memory reminder storage for the Orleans service.
- [WithMemoryStreaming(OrleansService, string)](/reference/api/csharp/aspire.hosting.orleans/orleansserviceextensions/methods.md#withmemorystreaming-orleansservice-string) : [OrleansService](/reference/api/csharp/aspire.hosting.orleans/orleansservice.md) `extension` `ats export` -- Adds an in-memory stream provider to the Orleans service.
- [WithReference(IResourceBuilder<T>, OrleansService)](/reference/api/csharp/aspire.hosting.orleans/orleansserviceextensions/methods.md#withreference-iresourcebuilder-t-orleansservice) : `IResourceBuilder<T>` `extension` `ats export` -- Adds Orleans to the resource.
- [WithReminders(OrleansService, IResourceBuilder<IResourceWithConnectionString>)](/reference/api/csharp/aspire.hosting.orleans/orleansserviceextensions/methods.md#withreminders-orleansservice-iresourcebuilder-iresourcewithconnectionstring) : [OrleansService](/reference/api/csharp/aspire.hosting.orleans/orleansservice.md) `extension` `ats export` -- Configures reminder storage for the Orleans service.
- [WithReminders(OrleansService, IProviderConfiguration)](/reference/api/csharp/aspire.hosting.orleans/orleansserviceextensions/methods.md#withreminders-orleansservice-iproviderconfiguration) : [OrleansService](/reference/api/csharp/aspire.hosting.orleans/orleansservice.md) `extension` `ats ignored` -- Configures reminder storage for the Orleans service.
- [WithServiceId(OrleansService, string)](/reference/api/csharp/aspire.hosting.orleans/orleansserviceextensions/methods.md#withserviceid-orleansservice-string) : [OrleansService](/reference/api/csharp/aspire.hosting.orleans/orleansservice.md) `extension` `ats export` -- Sets the ServiceId of the Orleans service.
- [WithServiceId(OrleansService, IResourceBuilder<ParameterResource>)](/reference/api/csharp/aspire.hosting.orleans/orleansserviceextensions/methods.md#withserviceid-orleansservice-iresourcebuilder-parameterresource) : [OrleansService](/reference/api/csharp/aspire.hosting.orleans/orleansservice.md) `extension` `ats ignored` -- Sets the ServiceId of the Orleans service.
- [WithStreaming(OrleansService, IResourceBuilder<IResourceWithConnectionString>)](/reference/api/csharp/aspire.hosting.orleans/orleansserviceextensions/methods.md#withstreaming-orleansservice-iresourcebuilder-iresourcewithconnectionstring) : [OrleansService](/reference/api/csharp/aspire.hosting.orleans/orleansservice.md) `extension` `ats ignored` -- Adds a stream provider to the Orleans service.
- [WithStreaming(OrleansService, string, IResourceBuilder<IResourceWithConnectionString>)](/reference/api/csharp/aspire.hosting.orleans/orleansserviceextensions/methods.md#withstreaming-orleansservice-string-iresourcebuilder-iresourcewithconnectionstring) : [OrleansService](/reference/api/csharp/aspire.hosting.orleans/orleansservice.md) `extension` `ats export` -- Adds a stream provider to the Orleans service.
- [WithStreaming(OrleansService, string, IProviderConfiguration)](/reference/api/csharp/aspire.hosting.orleans/orleansserviceextensions/methods.md#withstreaming-orleansservice-string-iproviderconfiguration) : [OrleansService](/reference/api/csharp/aspire.hosting.orleans/orleansservice.md) `extension` `ats ignored` -- Adds a stream provider to the Orleans service.
