Skaar.ValueType 4.0.0

dotnet add package Skaar.ValueType --version 4.0.0
                    
NuGet\Install-Package Skaar.ValueType -Version 4.0.0
                    
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="Skaar.ValueType" Version="4.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Skaar.ValueType" Version="4.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Skaar.ValueType" />
                    
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 Skaar.ValueType --version 4.0.0
                    
#r "nuget: Skaar.ValueType, 4.0.0"
                    
#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 Skaar.ValueType@4.0.0
                    
#: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=Skaar.ValueType&version=4.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Skaar.ValueType&version=4.0.0
                    
Install as a Cake Tool

Value type model code generator

This library generates code for value types that wrap string values or structs/primitives.

When you want strong types for your value objects or identifiers, this library can help you.

[ValueType]
public partial struct MyValueTypeWrappingStrings;

[ValueType<Guid>]
public partial struct MyValueTypeWrappingGuids;

MyValueTypeWrappingGuids myInstance = Guid.NewGuid();
Console.WriteLine(myInstance); // prints the Guid value

The code generated assumes a fairly recent version of C#.

Documentation on GitHub

Icon

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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.
  • .NETStandard 2.0

    • No dependencies.

NuGet packages (5)

Showing the top 5 NuGet packages that depend on Skaar.ValueType:

Package Downloads
Skaar.Fodselsnummer

A library implementing a type for Norwegian identification numbers.

Skaar.Organisasjonsnummer

A library implementing a type for Norwegian organization numbers.

Skaar.Kontonummer

A library implementing a type for Norwegian bank account numbers.

Skaar.Vin

A value type representing a VIN number

Skaar.BilRegNr

A library implementing a type for Norwegian car registration numbers.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.0 200 11/4/2026
3.0.1 273 2/16/2026
3.0.0 415 9/14/2025
2.0.1 245 9/14/2025
2.0.0 230 9/13/2025
1.1.0 307 8/26/2025
1.0.0 285 8/13/2025
0.0.1 249 8/13/2025

-
           1.0.0: Initial.
           1.1.0: Custom constructor
           2.0.0: Struct based value types
           2.0.1: Remove some warnings
           3.0.0: Clean and Validation no longer partial methods
           3.0.1: Proper hash code for string based value types (same value gets same hash code)
           4.0.0: Shared types (attributes, interfaces, converters, Helper) moved to Skaar.ValueType.Abstractions.dll shipped in the package, instead of being generated into each assembly. Fixes CS0436 when several assemblies use the generator.