VOOZH about

URL: https://www.nuget.org/packages/Enigmatry.Entry.SmartEnums/

⇱ NuGet Gallery | Enigmatry.Entry.SmartEnums 10.2.3




👁 Image
Enigmatry.Entry.SmartEnums 10.2.3

dotnet add package Enigmatry.Entry.SmartEnums --version 10.2.3
 
 
NuGet\Install-Package Enigmatry.Entry.SmartEnums -Version 10.2.3
 
 
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="Enigmatry.Entry.SmartEnums" Version="10.2.3" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Enigmatry.Entry.SmartEnums" Version="10.2.3" />
 
Directory.Packages.props
<PackageReference Include="Enigmatry.Entry.SmartEnums" />
 
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 Enigmatry.Entry.SmartEnums --version 10.2.3
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Enigmatry.Entry.SmartEnums, 10.2.3"
 
 
#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 Enigmatry.Entry.SmartEnums@10.2.3
 
 
#: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=Enigmatry.Entry.SmartEnums&version=10.2.3
 
Install as a Cake Addin
#tool nuget:?package=Enigmatry.Entry.SmartEnums&version=10.2.3
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Smart Enums

A library that extends the traditional C# enum concept with rich, type-safe enumeration classes that can contain both data and behavior.

Intended Usage

Use Smart Enums when you need enumerations that contain additional data and behavior beyond simple named constants. Smart Enums provide type-safety, better refactoring support, and the ability to encapsulate logic related to the enumeration.

Installation

Add the package to your project:

dotnet add package Enigmatry.Entry.SmartEnums

Usage Example

Define a Smart Enum:

using Enigmatry.Entry.SmartEnums;

public class PaymentMethod : SmartEnum<PaymentMethod>
{
 public static readonly PaymentMethod CreditCard = new(1, nameof(CreditCard), "Credit Card", 0.02m);
 public static readonly PaymentMethod DebitCard = new(2, nameof(DebitCard), "Debit Card", 0.01m);
 public static readonly PaymentMethod BankTransfer = new(3, nameof(BankTransfer), "Bank Transfer", 0.00m);

 public string DisplayName { get; }
 public decimal TransactionFee { get; }

 private PaymentMethod(int id, string name, string displayName, decimal transactionFee) 
 : base(id, name)
 {
 DisplayName = displayName;
 TransactionFee = transactionFee;
 }

 public decimal CalculateFee(decimal amount) => amount * TransactionFee;
}

Using the Smart Enum:

// Get by name
var creditCard = PaymentMethod.FromName("CreditCard");

// Get by ID
var bankTransfer = PaymentMethod.FromId(3);

// Use the properties and methods
decimal fee = creditCard.CalculateFee(100.00m);

// List all values
var allMethods = PaymentMethod.List();

// Equality comparison works correctly
bool isSame = (PaymentMethod.CreditCard == creditCard); // true
Product Versions Compatible and additional computed target framework versions.
.NET net10.0 net10.0 is compatible.  net10.0-android net10.0-android was computed.  net10.0-browser net10.0-browser was computed.  net10.0-ios net10.0-ios was computed.  net10.0-maccatalyst net10.0-maccatalyst was computed.  net10.0-macos net10.0-macos was computed.  net10.0-tvos net10.0-tvos was computed.  net10.0-windows 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 (4)

Showing the top 4 NuGet packages that depend on Enigmatry.Entry.SmartEnums:

Package Downloads
Enigmatry.Entry.SmartEnums.VerifyTests

Building Block for support of SmartEnums with VerifyTests in an Entry based project

Enigmatry.Entry.SmartEnums.EntityFramework

Building Block for support of SmartEnums with EntityFramework in an Entry based project

Enigmatry.Entry.SmartEnums.Swagger

Building Block for support of SmartEnums with NSWag in an Entry based project

Enigmatry.Entry.SmartEnums.SystemTextJson

Building Block for support of SmartEnums with SystemTextJson in an Entry based project

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
10.2.3 144 6/1/2026
10.2.3-preview.4 77 6/1/2026
10.2.2 247 4/27/2026
10.2.1-preview.1 62 4/27/2026
10.1.0 259 4/16/2026
10.0.1 146 5/19/2026
10.0.1-preview.2 70 4/16/2026
10.0.0 140 4/2/2026
9.6.0 167 3/18/2026
9.5.0 261 1/26/2026
9.4.0 411 12/22/2025
9.3.1-preview.3 271 12/18/2025
9.3.1-preview.1 182 11/25/2025
9.3.0 897 11/10/2025
9.2.0 284 9/24/2025
9.1.1-preview.5 237 8/8/2025
9.1.1-preview.4 144 6/27/2025
8.3.1-preview.1 155 12/24/2025
8.3.0 266 12/23/2025
8.2.0 294 9/24/2025
Loading failed