Beskar.Memory.Code.TypeIdGenerator 1.5.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package Beskar.Memory.Code.TypeIdGenerator --version 1.5.1
                    
NuGet\Install-Package Beskar.Memory.Code.TypeIdGenerator -Version 1.5.1
                    
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="Beskar.Memory.Code.TypeIdGenerator" Version="1.5.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Beskar.Memory.Code.TypeIdGenerator" Version="1.5.1" />
                    
Directory.Packages.props
<PackageReference Include="Beskar.Memory.Code.TypeIdGenerator" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Beskar.Memory.Code.TypeIdGenerator --version 1.5.1
                    
#r "nuget: Beskar.Memory.Code.TypeIdGenerator, 1.5.1"
                    
#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.
#:package Beskar.Memory.Code.TypeIdGenerator@1.5.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Beskar.Memory.Code.TypeIdGenerator&version=1.5.1
                    
Install as a Cake Addin
#tool nuget:?package=Beskar.Memory.Code.TypeIdGenerator&version=1.5.1
                    
Install as a Cake Tool

Beskar.Memory.Code.TypeIdGenerator

NuGet Version

A high-performance C# incremental source generator that generates type-safe ID record structs (e.g., strong-typed wrappers for integers, GUIDs, and other unmanaged primitives) to prevent domain-level ID mixing bugs. The generated implementations are zero-allocation, extremely fast, and integrate with Beskar.Memory's performance primitives.


Core Component Directory

1. Attributes & Configuration

  • TypeSafeIdAttribute
    • Description: Marker attribute applied to record structs to trigger incremental code generation of strongly-typed identifiers.
    • Parameters:
      • isOverrideString (default true): Generates custom string representation.
      • addImplicitConversions (default true): Adds implicit operators to easily cast primitive values to their type-safe counterpart.
      • addExplicitConversions (default true): Adds explicit operators to retrieve the underlying value.
      • isSpanParsable (default true): Automatically implements ISpanParsable<TSelf> if the underlying type is parsable.
      • addJsonConverter (default true): Generates a custom, high-performance System.Text.Json.Serialization.JsonConverter to serialize and deserialize the ID seamlessly.

2. Interfaces & Types

  • ITypeSafeIdentifier<TUnderlying>
    • Description: The base interface implemented by all generated type-safe identifiers, exposing the underlying value.
    • Key Feature: Enforces clean type safety, IComparable, and IEquatable across domain identifiers.

3. Serialization & Converters

  • TypeSafeIdJsonConverter<TId, TUnderlying>
    • Description: An abstract base class for JSON converters to serialize and deserialize type-safe identifiers efficiently.
    • Key Feature: Prevents reflection-based JSON overhead, yielding zero heap-allocations during standard JSON reads and writes.
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.6.2 38 5/30/2026
1.6.1 48 5/29/2026
1.6.0 41 5/29/2026
1.5.9 28 5/29/2026
1.5.8 61 5/28/2026
1.5.7 38 5/28/2026
1.5.6 42 5/28/2026
1.5.5 40 5/28/2026
1.5.4 40 5/28/2026
1.5.3 46 5/28/2026
1.5.2 49 5/28/2026
1.5.1 36 5/26/2026
1.5.0 38 5/26/2026