Maris.ComponentModel.Annotations 2.1.0-Beta3

Prefix Reserved
This is a prerelease version of Maris.ComponentModel.Annotations.
There is a newer version of this package available.
See the version list below for details.
dotnet add package Maris.ComponentModel.Annotations --version 2.1.0-Beta3
                    
NuGet\Install-Package Maris.ComponentModel.Annotations -Version 2.1.0-Beta3
                    
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="Maris.ComponentModel.Annotations" Version="2.1.0-Beta3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Maris.ComponentModel.Annotations" Version="2.1.0-Beta3" />
                    
Directory.Packages.props
<PackageReference Include="Maris.ComponentModel.Annotations" />
                    
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 Maris.ComponentModel.Annotations --version 2.1.0-Beta3
                    
#r "nuget: Maris.ComponentModel.Annotations, 2.1.0-Beta3"
                    
#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 Maris.ComponentModel.Annotations@2.1.0-Beta3
                    
#: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=Maris.ComponentModel.Annotations&version=2.1.0-Beta3&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Maris.ComponentModel.Annotations&version=2.1.0-Beta3&prerelease
                    
Install as a Cake Tool

Maris.ComponentModel.Annotations

Apache License v2 Maris.ComponentModel.Annotations Release date

日本語版

Maris.ComponentModel.Annotations provides additional functionality for System.ComponentModel.Annotations.

Install

Run the following command in Package Manager Console or Command Prompt to install Maris.ComponentModel.Annotations.

  • Package Manager Console
Install-Package Maris.ComponentModel.Annotations
  • Command Prompt
dotnet add package Maris.ComponentModel.Annotations

Usage

Retrieve display name of enumeration

You can retrieve the display name configured for each item of an enumeration. Display names for each enumeration value are set using DisplayAttribute. It is also possible to define display names in resource files.

using Maris.ComponentModel;

public enum Status
{
    [Display(Name = "Preparation is ready.")]
    Ready = 1,

    [Display(
        ResourceType = typeof(EnumExtensionsTestResources),
        Name = nameof(EnumExtensionsTestResources.InProgress))]
    InProgress = 2,

    Done = 3,
}

Console.WriteLine(Status.Ready.GetDisplayName());      // Output: Preparation is ready.
Console.WriteLine(Status.InProgress.GetDisplayName()); // Output: Work is in progress.
Console.WriteLine(Status.Done.GetDisplayName());       // Output: Done

Display names are retrieved using the GetDisplayName() extension method. By referencing the Maris.ComponentModel namespace, the GetDisplayName() method becomes available.

Dependencies

License

Apache License Version 2.0

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 is compatible.  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 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. 
.NET Framework net472 is compatible.  net48 was computed.  net481 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
2.1.0 521 12/22/2025
2.1.0-Beta3 285 12/19/2025
2.1.0-Beta2 312 12/16/2025