# OrleansService

- Module: [Aspire.Hosting.Orleans](/reference/api/typescript/aspire.hosting.orleans.md)
- Version: `13.4.0`
- Kind: `handle`
- Source: [GitHub](https://github.com/microsoft/aspire)

Describes an Orleans service.

## Definition

```typescript
interface OrleansService {
  asClient(): OrleansServiceClient;
  withBroadcastChannel(name: string): OrleansService;
  withClusterId(clusterId: string): OrleansService;
  withClustering(provider: IResourceWithConnectionString): OrleansService;
  withDevelopmentClustering(): OrleansService;
  withGrainDirectory(
      name: string,
      provider: IResourceWithConnectionString): OrleansService;
  withGrainStorage(
      name: string,
      provider: IResourceWithConnectionString): OrleansService;
  withMemoryGrainStorage(name: string): OrleansService;
  withMemoryReminders(): OrleansService;
  withMemoryStreaming(name: string): OrleansService;
  withReminders(provider: IResourceWithConnectionString): OrleansService;
  withServiceId(serviceId: string): OrleansService;
  withStreaming(
      name: string,
      provider: IResourceWithConnectionString): OrleansService;
}
```

## Methods

- [asClient](/reference/api/typescript/aspire.hosting.orleans/orleansservice/asclient.md) -- `method` -- Returns a model of the clients of an Orleans service.
    ```typescript
  asClient(): OrleansServiceClient
  ```
- [withBroadcastChannel](/reference/api/typescript/aspire.hosting.orleans/orleansservice/withbroadcastchannel.md) -- `method` -- Adds a broadcast channel provider to the Orleans service.
    ```typescript
  withBroadcastChannel(name: string): OrleansService
  ```
- [withClusterId](/reference/api/typescript/aspire.hosting.orleans/orleansservice/withclusterid.md) -- `method` -- Sets the ClusterId of the Orleans service.
    ```typescript
  withClusterId(clusterId: string): OrleansService
  ```
- [withClustering](/reference/api/typescript/aspire.hosting.orleans/orleansservice/withclustering.md) -- `method` -- Configures the Orleans service to use the provided clustering provider.
    ```typescript
  withClustering(provider: IResourceWithConnectionString): OrleansService
  ```
- [withDevelopmentClustering](/reference/api/typescript/aspire.hosting.orleans/orleansservice/withdevelopmentclustering.md) -- `method` -- Configures the Orleans service to use development-only clustering.
    ```typescript
  withDevelopmentClustering(): OrleansService
  ```
- [withGrainDirectory](/reference/api/typescript/aspire.hosting.orleans/orleansservice/withgraindirectory.md) -- `method` -- Adds a grain directory provider to the Orleans service.
    ```typescript
  withGrainDirectory(name: string, provider: IResourceWithConnectionString): OrleansService
  ```
- [withGrainStorage](/reference/api/typescript/aspire.hosting.orleans/orleansservice/withgrainstorage.md) -- `method` -- Adds a grain storage provider to the Orleans service.
    ```typescript
  withGrainStorage(name: string, provider: IResourceWithConnectionString): OrleansService
  ```
- [withMemoryGrainStorage](/reference/api/typescript/aspire.hosting.orleans/orleansservice/withmemorygrainstorage.md) -- `method` -- Adds an in-memory grain storage to the Orleans service.
    ```typescript
  withMemoryGrainStorage(name: string): OrleansService
  ```
- [withMemoryReminders](/reference/api/typescript/aspire.hosting.orleans/orleansservice/withmemoryreminders.md) -- `method` -- Configures in-memory reminder storage for the Orleans service.
    ```typescript
  withMemoryReminders(): OrleansService
  ```
- [withMemoryStreaming](/reference/api/typescript/aspire.hosting.orleans/orleansservice/withmemorystreaming.md) -- `method` -- Adds an in-memory stream provider to the Orleans service.
    ```typescript
  withMemoryStreaming(name: string): OrleansService
  ```
- [withReminders](/reference/api/typescript/aspire.hosting.orleans/orleansservice/withreminders.md) -- `method` -- Configures reminder storage for the Orleans service.
    ```typescript
  withReminders(provider: IResourceWithConnectionString): OrleansService
  ```
- [withServiceId](/reference/api/typescript/aspire.hosting.orleans/orleansservice/withserviceid.md) -- `method` -- Sets the ServiceId of the Orleans service.
    ```typescript
  withServiceId(serviceId: string): OrleansService
  ```
- [withStreaming](/reference/api/typescript/aspire.hosting.orleans/orleansservice/withstreaming.md) -- `method` -- Adds a stream provider to the Orleans service.
    ```typescript
  withStreaming(name: string, provider: IResourceWithConnectionString): OrleansService
  ```
