// Register the entity sets needed by OpenIddict but use a custom key type.
options.UseOpenIddict<Guid>();
});
```
### Use custom entities
For applications that require storing additional data alongside the properties used by OpenIddict, custom entities can be used. For that, you need to:
- **Create custom entities**:
```csharp
public class CustomApplication : OpenIddictEntityFrameworkCoreApplication<long,CustomAuthorization,CustomToken>
{
public string CustomProperty { get; set; }
}
public class CustomAuthorization : OpenIddictEntityFrameworkCoreAuthorization<long,CustomApplication,CustomToken>
{
public string CustomProperty { get; set; }
}
public class CustomScope : OpenIddictEntityFrameworkCoreScope<long>
{
public string CustomProperty { get; set; }
}
public class CustomToken : OpenIddictEntityFrameworkCoreToken<long,CustomApplication,CustomAuthorization>
{
public string CustomProperty { get; set; }
}
```
- **Call the generic `ReplaceDefaultEntities<TApplication, TAuthorization, TScope, TToken, TKey>()` method to force OpenIddict to use the custom entities**:
```csharp
services.AddOpenIddict()
.AddCore(options =>
{
// Configure OpenIddict to use the custom entities.