百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
E

Enums.NET

> 编程语言
开源

Enums.NET 是一款高性能的、类型安全的 .NET 枚举实用程序库。

1.8K stars0 点赞0 次浏览
访问官网GitHub

工具介绍

Enums.NET 是一款高性能的、类型安全的 .NET 枚举实用程序库。

v5.0 Changes

Removed Boolean enum support and dropped support for net45 and bumped it to net461 due to updating dependencies. Also dropped support for netstandard 1.x tfms for similar reasons. Added a net7 target which utilizes the built-in generic number interfaces. Also added an EnumValidatorAttribute base class since generic attributes are now supported.

v4.0 Changes

Removed NonGenericEnums, NonGenericFlagEnums, UnsafeEnums, and UnsafeFlagEnums classes which were deprecated in v3.0 and also removed all other deprecated methods in an effort to slim the library size down. It is recommended if upgrading from 2.x and below to update to 3.x first and follow the warnings to migrate any code that's using deprecated methods and classes. Also, a dependency on the System.Runtime.CompilerServices.Unsafe package was added for the .NET 4.5 target in order to remove a build dependency on Fody.

Enums.NET

Enums.NET is a high-performance type-safe .NET enum utility library which provides many operations as convenient extension methods. It is compatible with .NET Framework 4.6.1+ and .NET Standard 2.0+.

What's wrong with System.Enum

  1. Support for flag enums is limited to just the HasFlag method which isn't type-safe~, is inefficient,~ and is ambiguous as to whether it determines if the value has all or any of the specified flags. It's all by the way.
  2. Most of its methods use reflection on each call without any sort of caching causing poor performance.
  3. The pattern to associate extra data with an enum member using Attributes is not supported and instead requires users to manually retrieve the Attributes via reflection. This pattern is commonly used on enum members with the DescriptionAttribute, EnumMemberAttribute, and DisplayAttribute.

Enums.NET solves all of these issues and more.

Enums.NET Demo

…

Results from running the PerformanceTestConsole BenchmarkDotNet application.

Interface

See fuget for exploring the interface.

Credits

Inspired by Jon Skeet's Unconstrained Melody.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

C#csharpdotnetdotnet-coreenum

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言