NetEscapades.EnumGenerators
1.0.0-beta01
See the version list below for details.
dotnet add package NetEscapades.EnumGenerators --version 1.0.0-beta01
NuGet\Install-Package NetEscapades.EnumGenerators -Version 1.0.0-beta01
<PackageReference Include="NetEscapades.EnumGenerators" Version="1.0.0-beta01" />
paket add NetEscapades.EnumGenerators --version 1.0.0-beta01
#r "nuget: NetEscapades.EnumGenerators, 1.0.0-beta01"
// Install NetEscapades.EnumGenerators as a Cake Addin #addin nuget:?package=NetEscapades.EnumGenerators&version=1.0.0-beta01&prerelease // Install NetEscapades.EnumGenerators as a Cake Tool #tool nuget:?package=NetEscapades.EnumGenerators&version=1.0.0-beta01&prerelease
A source generator for creating helper extension methods on enums using a [EnumExtensions] attribute
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- NetEscapades.EnumGenerators.Attributes (>= 1.0.0-beta01)
NuGet packages (5)
Showing the top 5 NuGet packages that depend on NetEscapades.EnumGenerators:
Package | Downloads |
---|---|
DSharpPlus
A C# API for Discord based off DiscordSharp, but rewritten to fit the API standards. |
|
Indrivo.FileStorage.Accessor.Contracts
Package Description |
|
apex.net-Entities
Models for apex.net |
|
FileStorage.Accessor.Contracts
Package Description |
|
Starnight.Shared
Shared type library for Starnight assemblies |
GitHub repositories (3)
Showing the top 3 popular GitHub repositories that depend on NetEscapades.EnumGenerators:
Repository | Stars |
---|---|
Nexus-Mods/NexusMods.App
Home of the development of the Nexus Mods App
|
|
andrewlock/NetEscapades.EnumGenerators
A source generator for generating fast "reflection" methods for enums
|
|
SteveDunn/Intellenum
Intelligent Enums
|
Version | Downloads | Last updated |
---|---|---|
1.0.0-beta11 | 4,491 | 10/24/2024 |
1.0.0-beta09 | 83,714 | 5/15/2024 |
1.0.0-beta08 | 162,778 | 6/5/2023 |
1.0.0-beta07 | 72,037 | 3/10/2023 |
1.0.0-beta06 | 28,703 | 12/20/2022 |
1.0.0-beta05 | 252 | 12/19/2022 |
1.0.0-beta04 | 132,992 | 11/30/2021 |
1.0.0-beta03 | 1,903 | 11/26/2021 |
1.0.0-beta02 | 180 | 11/22/2021 |
1.0.0-beta01 | 370 | 11/18/2021 |
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](https://andrewlock.net/series/using-strongly-typed-entity-ids-to-avoid-primitive-obsession/). 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](https://github.com/andrewlock/StronglyTypedId/issues/24)). These have been addressed in version 1.x.
* Better null handling has been added for the `String` backing type, handling issues such as [#32](https://github.com/andrewlock/StronglyTypedId/issues/32).
* The code is marked as auto generated, to avoid errors such as #CS1591 as described in [#27](https://github.com/andrewlock/StronglyTypedId/issues/27)
See https://github.com/andrewlock/NetEscapades.EnumGenerators/blob/master/CHANGELOG.md#v100 for more details.