# IStreamSubscriptionManager Methods

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.streaming/orleans.streams.core.istreamsubscriptionmanager/)

## AddSubscription(string, StreamId, GrainReference) {#addsubscription-string-orleans-runtime-streamid-orleans-runtime-grainreference-d7b7a3db}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.streaming/orleans.streams.core.istreamsubscriptionmanager/methods/addsubscription-string-orleans-runtime-streamid-orleans-runtime-grainreference-d7b7a3db/)

```csharp
public abstract Task<StreamSubscription> AddSubscription(string streamProviderName, StreamId streamId, GrainReference grainRef)
```

Subscribes the specified grain to a stream.

### Parameters

- `streamProviderName` (`string`): Name of the stream provider.
- `streamId` (`StreamId`): The stream identifier.
- `grainRef` (`GrainReference`): The grain reference.

### Returns

The stream subscription.

## GetSubscriptions(string, StreamId) {#getsubscriptions-string-orleans-runtime-streamid-557f9db0}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.streaming/orleans.streams.core.istreamsubscriptionmanager/methods/getsubscriptions-string-orleans-runtime-streamid-557f9db0/)

```csharp
public abstract Task<IEnumerable<StreamSubscription>> GetSubscriptions(string streamProviderName, StreamId streamId)
```

Gets the subscriptions for a stream.

### Parameters

- `streamProviderName` (`string`): Name of the stream provider.
- `streamId` (`StreamId`): The stream identifier.

### Returns

The subscriptions.

## RemoveSubscription(string, StreamId, Guid) {#removesubscription-string-orleans-runtime-streamid-system-guid-94a582ae}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.streaming/orleans.streams.core.istreamsubscriptionmanager/methods/removesubscription-string-orleans-runtime-streamid-system-guid-94a582ae/)

```csharp
public abstract Task RemoveSubscription(string streamProviderName, StreamId streamId, Guid subscriptionId)
```

Unsubscribes a grain from a stream.

### Parameters

- `streamProviderName` (`string`): Name of the stream provider.
- `streamId` (`StreamId`): The stream identifier.
- `subscriptionId` (`Guid`): The subscription identifier.

### Returns

A `System.Threading.Tasks.Task` representing the operation.
