# MemoryGrainStorageWithLatency Methods

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.persistence.memory/orleans.storage.memorygrainstoragewithlatency/)

## ClearStateAsync(string, GrainId, IGrainState&lt;T&gt;) {#clearstateasync-1-string-orleans-runtime-grainid-orleans-igrainstate-t-3e72e626}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.persistence.memory/orleans.storage.memorygrainstoragewithlatency/methods/clearstateasync-1-string-orleans-runtime-grainid-orleans-igrainstate-t-3e72e626/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Persistence.Memory/Storage/MemoryStorageWithLatency.cs#L88)

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

Delete / Clear state data function for this storage provider.

### Parameters

- `grainType` (`string`)
- `grainId` (`GrainId`)
- `grainState` (`IGrainState<T>`)

## ReadStateAsync(string, GrainId, IGrainState&lt;T&gt;) {#readstateasync-1-string-orleans-runtime-grainid-orleans-igrainstate-t-f9400a59}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.persistence.memory/orleans.storage.memorygrainstoragewithlatency/methods/readstateasync-1-string-orleans-runtime-grainid-orleans-igrainstate-t-f9400a59/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Persistence.Memory/Storage/MemoryStorageWithLatency.cs#L74)

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

Read state data function for this storage provider.

### Parameters

- `grainType` (`string`)
- `grainId` (`GrainId`)
- `grainState` (`IGrainState<T>`)

## WriteStateAsync(string, GrainId, IGrainState&lt;T&gt;) {#writestateasync-1-string-orleans-runtime-grainid-orleans-igrainstate-t-38415bc8}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.persistence.memory/orleans.storage.memorygrainstoragewithlatency/methods/writestateasync-1-string-orleans-runtime-grainid-orleans-igrainstate-t-38415bc8/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Persistence.Memory/Storage/MemoryStorageWithLatency.cs#L81)

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

Write state data function for this storage provider.

### Parameters

- `grainType` (`string`)
- `grainId` (`GrainId`)
- `grainState` (`IGrainState<T>`)
