StronglyTypedId 1.0.0-beta01

This is a prerelease version of StronglyTypedId.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package StronglyTypedId --version 1.0.0-beta01                
NuGet\Install-Package StronglyTypedId -Version 1.0.0-beta01                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="StronglyTypedId" Version="1.0.0-beta01" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add StronglyTypedId --version 1.0.0-beta01                
#r "nuget: StronglyTypedId, 1.0.0-beta01"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install StronglyTypedId as a Cake Addin
#addin nuget:?package=StronglyTypedId&version=1.0.0-beta01&prerelease

// Install StronglyTypedId as a Cake Tool
#tool nuget:?package=StronglyTypedId&version=1.0.0-beta01&prerelease                

A source generator for creating strongly-typed IDs by decorating with a [StronglyTypedId] attribute

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

  • .NETStandard 2.0

    • No dependencies.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on StronglyTypedId:

Package Downloads

Package Description


Package Description


Framework to develop (work)flows following the enterprise integration pattern and run them with a single app instance or with distributed setup with different queue engines (RabbitMQ,...).

GitHub repositories (2)

Showing the top 2 popular GitHub repositories that depend on StronglyTypedId:

Repository Stars
A Rosyln-powered generator for strongly-typed IDs
A Dotnet 8.0 WebApi template project. MediatR, Swagger, Mapper, Serilog and more implemented.
Version Downloads Last updated
1.0.0-beta08 60,441 4/25/2024
1.0.0-beta07 104,333 12/14/2023
1.0.0-beta06 1,214,326 2/19/2022
1.0.0-beta05 34,699 11/27/2021
1.0.0-beta04 4,777 11/26/2021
1.0.0-beta03 4,954 11/25/2021
1.0.0-beta02 3,789 8/30/2021
1.0.0-beta01 2,488 8/21/2021
0.2.1 372,231 5/17/2020
0.2.0 4,250 4/29/2020
0.1.2 4,263 6/5/2019

Version 0.x of this library used the helper library CodeGeneration.Roslyn for build-time source generation. In version 1.x this approach has been completely replaced in favour of source generators, as these are explicitly supported in .NET 5+. As part of this change, there were a number of additional features added and breaking changes made.

Breaking Changes

* `StronglyTypedIds` namespace is required. In version 0.x of the library, the `[StronglyTypedId]` attribute was in the global namespace. In version 1.x, the attribute is in the `StronglyTypedIds` namespace, so you must add `namespace StronglyTypedIds;`.
* The properties exposed by `StronglyTypedIds` have changed: there is no longer a `generateJsonConverter` property. Instead, this is infered based on the `StronglyTypedIdConverters` flags provided.
* The `String` backing typed ID will throw if you call the constructor with a `null` value

New Features

* The attributes can now auto-generate additional converter types such as EF Core `ValueConverter` and Dapper `TypeHandler`, as described in [my blog posts]( These are optional flags on the `converters` property.
* Made interface implementations (`IEquatable<T>` and `IComparable<T>` currently) optional. This is to potentially support additional interfaces in future versions.
* Added a `NullableString` backing type. Due to the behaviour of `struct`s in c#, the `String` backing type ID _may_ still be null, but you can't explicitly call the constructor with a null value. In contrast, you can do this with the `NullableString` backing type.
* Added a `[StronglyTypedIdDefaults]` attribute to set default values for all `[StronglyTypedId]` attributes in your project. This is useful if you want to customise all the attributes, for example, if you want to generate additional converters by default. You can still override all the properties of a `[StronglyTypedId]` instance.

Bug Fixes

* Some converters had incorrect implementations, such as in ([#26]( These have been addressed in version 1.x.
* Better null handling has been added for the `String` backing type, handling issues such as [#32](
* The code is marked as auto generated, to avoid errors such as #CS1591 as described in [#27](

See for more details.