# PersistentStateFactory.Create(IGrainContext, IPersistentStateConfiguration)

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.runtime/orleans.runtime.persistentstatefactory/) | [Methods](/orleans/docs/api/csharp/microsoft.orleans.runtime/orleans.runtime.persistentstatefactory/methods/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Runtime/Facet/Persistent/PersistentStateStorageFactory.cs#L22-L31)

```csharp
public IPersistentState<TState> Create<TState>(IGrainContext context, IPersistentStateConfiguration cfg)
```

Creates a persistent state instance for the provided grain.

### Parameters

- `context` (`IGrainContext`): The grain context.
- `cfg` (`IPersistentStateConfiguration`): The state facet configuration.

### Returns

A persistent state instance for the provided grain with the specified configuration.
