LayeredCraft.SourceGeneratorTools.Generator 0.1.0-alpha.7

This is a prerelease version of LayeredCraft.SourceGeneratorTools.Generator.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package LayeredCraft.SourceGeneratorTools.Generator --version 0.1.0-alpha.7
                    
NuGet\Install-Package LayeredCraft.SourceGeneratorTools.Generator -Version 0.1.0-alpha.7
                    
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="LayeredCraft.SourceGeneratorTools.Generator" Version="0.1.0-alpha.7">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LayeredCraft.SourceGeneratorTools.Generator" Version="0.1.0-alpha.7" />
                    
Directory.Packages.props
<PackageReference Include="LayeredCraft.SourceGeneratorTools.Generator">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
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 LayeredCraft.SourceGeneratorTools.Generator --version 0.1.0-alpha.7
                    
#r "nuget: LayeredCraft.SourceGeneratorTools.Generator, 0.1.0-alpha.7"
                    
#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 LayeredCraft.SourceGeneratorTools.Generator@0.1.0-alpha.7
                    
#: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=LayeredCraft.SourceGeneratorTools.Generator&version=0.1.0-alpha.7&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=LayeredCraft.SourceGeneratorTools.Generator&version=0.1.0-alpha.7&prerelease
                    
Install as a Cake Tool

SourceGeneratorTools

Build Status NuGet License: MIT

A .NET utility library providing reusable components for building C# Source Generators. This library offers type-safe, immutable data structures specifically designed for source generator development.

Key Highlights

  • Zero-reflection overhead - Compile-time utilities designed for source generators
  • Type-safe immutable collections with value equality semantics
  • Immutable by design - Thread-safe for read operations
  • Polyfill support for .NET Standard 2.0+ compatibility
  • Comprehensive unit test coverage with 150+ test cases

Installation

Install via NuGet:

dotnet add package LayeredCraft.SourceGeneratorTools

Quick Start

EquatableArray<T> - Value-based Array Equality

using LayeredCraft.SourceGeneratorTools.Types;

var array1 = new EquatableArray<string>(new[] { "foo", "bar" });
var array2 = new EquatableArray<string>(new[] { "foo", "bar" });

// Value equality - useful for caching in source generators
Console.WriteLine(array1.Equals(array2)); // True
Console.WriteLine(array1.GetHashCode() == array2.GetHashCode()); // True

Features

EquatableArray<T>

  • Value equality semantics - Arrays compared by content, not reference
  • Immutable by design - Safe to share across threads
  • Zero-allocation access via AsSpan() for high-performance scenarios
  • Index and Range support - Modern C# slicing syntax
  • Thread-safe for read operations - No locking required
  • Generic IEnumerable<T> support - Works with LINQ and foreach

Documentation

License

This project is licensed under the MIT License - see the LICENSE file for details.

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

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
0.1.0-beta.10 425 12/21/2025
0.1.0-alpha.9 123 12/21/2025
0.1.0-alpha.8 130 12/21/2025
0.1.0-alpha.7 114 12/20/2025
0.1.0-alpha.6 237 12/20/2025