# CosmosGrainStorage.ClearStateAsync(string, GrainId, IGrainState&lt;T&gt;, CancellationToken)

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

[Source](https://github.com/dotnet/orleans/blob/fbe240c34e9a1389ca5ab2d52f292ed8749ea530/src/Azure/Orleans.Persistence.Cosmos/CosmosGrainStorage.cs#L203)

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

Delete / Clear data function for this storage instance.

### Parameters

- `grainType` (`string`): Name of the state for this grain.
- `grainId` (`GrainId`): Grain ID.
- `grainState` (`IGrainState<T>`): Copy of last-known state data object for this grain.
- `cancellationToken` (`CancellationToken`): The cancellation token.

### Returns

Completion promise for the Delete operation on the specified grain.
