# RedisGrainStorage.WriteStateAsync(string, GrainId, IGrainState&lt;T&gt;)

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.persistence.redis/orleans.persistence.redisgrainstorage/) | [Methods](/orleans/docs/api/csharp/microsoft.orleans.persistence.redis/orleans.persistence.redisgrainstorage/methods/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Redis/Orleans.Persistence.Redis/Storage/RedisGrainStorage.cs#L146-L171)

```csharp
public Task WriteStateAsync<T>(string grainType, GrainId grainId, IGrainState<T> grainState)
```

Write data function for this storage instance.

### Parameters

- `grainType` (`string`): Name of the state for this grain
- `grainId` (`GrainId`): Grain ID
- `grainState` (`IGrainState<T>`): State data object to be written for this grain.

### Returns

Completion promise for the Write operation on the specified grain.
