# AdoNetGrainStorageKeyFormat

Package: [Microsoft.Orleans.Persistence.AdoNet](/orleans/docs/api/csharp/microsoft.orleans.persistence.adonet/) 10.0.0

[NuGet package](https://www.nuget.org/packages/Microsoft.Orleans.Persistence.AdoNet) | [Source](https://github.com/dotnet/orleans/blob/997f2589e814db85c6a451b59c081c88e50b8944/src/AdoNet/Orleans.Persistence.AdoNet/Options/AdoNetGrainStorageKeyFormat.cs#L10)

```csharp
public enum AdoNetGrainStorageKeyFormat
```

Specifies how ADO.NET grain storage maps a grain state to the key columns of the `OrleansStorage` table.

## Remarks

The key format determines where state is stored. Changing the format of an existing database makes state written with the previous format unreachable; no automatic migration is performed.

## Fields

- `Legacy` = `0` - Stores the state name in GrainTypeString and keys rows by the grain key only. Integer and GUID keys are recognized by parsing the grain key.
- `GrainTypeQualified` = `1` - Stores the grain type, state name, and grain key as hexadecimal text of their exact bytes, so that each combination of grain type, state name, and grain key has its own row under any database collation and hasher.
