# AdoNetGrainStorage Methods

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.persistence.adonet/orleans.storage.adonetgrainstorage/)

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

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.persistence.adonet/orleans.storage.adonetgrainstorage/methods/clearstateasync-1-string-orleans-runtime-grainid-orleans-igrainstate-t-9e872e18/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/AdoNet/Orleans.Persistence.AdoNet/Storage/Provider/AdoNetGrainStorage.cs#L154-L213)

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

Clear state data function for this storage provider.

### Parameters

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

## Participate(ISiloLifecycle) {#participate-orleans-runtime-isilolifecycle-e2b6abc8}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.persistence.adonet/orleans.storage.adonetgrainstorage/methods/participate-orleans-runtime-isilolifecycle-e2b6abc8/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/AdoNet/Orleans.Persistence.AdoNet/Storage/Provider/AdoNetGrainStorage.cs#L145-L146)

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

Adds the provided observer as a participant in the lifecycle.

### Parameters

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

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

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.persistence.adonet/orleans.storage.adonetgrainstorage/methods/readstateasync-1-string-orleans-runtime-grainid-orleans-igrainstate-t-14bac435/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/AdoNet/Orleans.Persistence.AdoNet/Storage/Provider/AdoNetGrainStorage.cs#L222-L278)

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

Read state data function for this storage provider.

### Parameters

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

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

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.persistence.adonet/orleans.storage.adonetgrainstorage/methods/writestateasync-1-string-orleans-runtime-grainid-orleans-igrainstate-t-6633a67a/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/AdoNet/Orleans.Persistence.AdoNet/Storage/Provider/AdoNetGrainStorage.cs#L287-L332)

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

Write state data function for this storage provider.

### Parameters

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