# PersistentStreamProvider Methods

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.streaming/orleans.providers.streams.common.persistentstreamprovider/)

## Create(IServiceProvider, string) {#create-system-iserviceprovider-string-917d87a8}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.streaming/orleans.providers.streams.common.persistentstreamprovider/methods/create-system-iserviceprovider-string-917d87a8/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Streaming/PersistentStreams/PersistentStreamProvider.cs#L227-L229)

```csharp
public static IStreamProvider Create(IServiceProvider services, string name)
```

### Parameters

- `services` (`IServiceProvider`)
- `name` (`string`)

## ExecuteCommand(int, object) {#executecommand-int-object-9262c4f6}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.streaming/orleans.providers.streams.common.persistentstreamprovider/methods/executecommand-int-object-9262c4f6/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Streaming/PersistentStreams/PersistentStreamProvider.cs#L194-L216)

```csharp
public Task<object> ExecuteCommand(int command, object arg)
```

A function to execute a control command.

### Parameters

- `command` (`int`): A serial number of the command.
- `arg` (`object`): An opaque command argument.

### Returns

The value returned from the command handler.

## GetStream(StreamId) {#getstream-1-orleans-runtime-streamid-e7397f6e}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.streaming/orleans.providers.streams.common.persistentstreamprovider/methods/getstream-1-orleans-runtime-streamid-e7397f6e/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Streaming/PersistentStreams/PersistentStreamProvider.cs#L168-L170)

```csharp
public IAsyncStream<T> GetStream<T>(StreamId streamId)
```

Gets the stream with the specified identity.

### Parameters

- `streamId` (`StreamId`): The stream identifier.

### Returns

The stream.

## GetStreamSubscriptionManager {#getstreamsubscriptionmanager-59e35830}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.streaming/orleans.providers.streams.common.persistentstreamprovider/methods/getstreamsubscriptionmanager-59e35830/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Streaming/PersistentStreams/PersistentStreamProvider.cs#L141)

```csharp
public IStreamSubscriptionManager GetStreamSubscriptionManager()
```

Gets the stream subscription manager.

### Returns

The [IStreamSubscriptionManager](/orleans/docs/api/csharp/microsoft.orleans.streaming/orleans.streams.core.istreamsubscriptionmanager/).

## Participate(ILifecycleObservable) {#participate-orleans-ilifecycleobservable-362b567f}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.streaming/orleans.providers.streams.common.persistentstreamprovider/methods/participate-orleans-ilifecycleobservable-362b567f/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Streaming/PersistentStreams/PersistentStreamProvider.cs#L221-L223)

```csharp
public void Participate(ILifecycleObservable lifecycle)
```

Adds the provided observer as a participant in the lifecycle.

### Parameters

- `lifecycle` (`ILifecycleObservable`): The observer.

## ParticipateIn(IServiceProvider, string) {#participatein-1-system-iserviceprovider-string-6672267d}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.streaming/orleans.providers.streams.common.persistentstreamprovider/methods/participatein-1-system-iserviceprovider-string-6672267d/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Streaming/PersistentStreams/PersistentStreamProvider.cs#L235-L236)

```csharp
public static ILifecycleParticipant<TLifecycle> ParticipateIn<TLifecycle>(IServiceProvider serviceProvider, string name)
```

### Parameters

- `serviceProvider` (`IServiceProvider`)
- `name` (`string`)
