Integrations
editAn ID is read and written as its underlying value everywhere: a number or a string in JSON, a value in a BSON document or a database column, a segment of a URL. The generator writes a converter for each serializer, nested in the ID and registered by an attribute on it, so most libraries use them without configuration.
| Library | What the generator provides | Configuration |
|---|---|---|
| System.Text.Json | A JsonConverter<T>, also for dictionary keys | None, except with a source-generated JsonSerializerContext |
| Newtonsoft.Json | A JsonConverter, when the project references Newtonsoft.Json | None |
| MongoDB | A BSON serializer, when the project references MongoDB.Bson | None |
| TypeConverter and configuration | A TypeConverter, used by Microsoft.Extensions.Configuration and UI frameworks | None |
| ASP.NET Core | TryParse and IParsable<T> for route and query values, and the JSON converter for bodies | None |
| Entity Framework Core | Nothing specific | A value converter that you write once per ID type |
Each converter can be turned off with an option.