Integrations

edit

An 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.

LibraryWhat the generator providesConfiguration
System.Text.JsonA JsonConverter<T>, also for dictionary keysNone, except with a source-generated JsonSerializerContext
Newtonsoft.JsonA JsonConverter, when the project references Newtonsoft.JsonNone
MongoDBA BSON serializer, when the project references MongoDB.BsonNone
TypeConverter and configurationA TypeConverter, used by Microsoft.Extensions.Configuration and UI frameworksNone
ASP.NET CoreTryParse and IParsable<T> for route and query values, and the JSON converter for bodiesNone
Entity Framework CoreNothing specificA value converter that you write once per ID type

Each converter can be turned off with an option.