A high-performance, type-safe .NET utility library for enum operations, solving limitations of System.Enum.
Enums.NET is a utility library for .NET that provides high-performance, type-safe operations for enums. It solves common pain points with `System.Enum`, such as inefficient flag handling, reflection overhead, and cumbersome attribute retrieval, offering extension methods for tasks like validation, formatting, and parsing.
.NET developers working extensively with enums, especially those needing efficient flag operations, custom attribute integration, or performance-critical enum handling in applications.
Developers choose Enums.NET for its significant performance gains over `System.Enum`, type-safe API, and comprehensive feature set—including advanced flag operations, custom validation, and seamless attribute support—without the boilerplate of manual reflection.
Enums.NET is a high-performance type-safe .NET enum utility library
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Utilizes caching and efficient algorithms to avoid reflection overhead, making operations significantly faster than System.Enum, as shown in the provided performance benchmarks.
Provides methods like HasAllFlags and HasAnyFlags for precise, unambiguous flag manipulation, addressing the inefficiencies and ambiguity of System.Enum.HasFlag.
Simplifies retrieval of custom attributes (e.g., DescriptionAttribute) on enum members without manual reflection, as demonstrated in the demo with SymbolAttribute and PrimaryEnumMemberAttribute.
Offers built-in validation for standard and flag enums, plus extensible custom validation via IEnumValidatorAttribute, allowing for complex rule enforcement like in the DayTypeValidator example.
Major updates like v5.0 and v4.0 removed features (e.g., Boolean enum support) and dropped support for older .NET targets, requiring code migration and potentially causing upgrade friction.
For certain targets, it adds dependencies like System.Runtime.CompilerServices.Unsafe, which can complicate maintenance and introduce compatibility issues in tightly controlled environments.
Features such as custom enum formats and validators require understanding of extension methods and attribute patterns, which might be complex for developers new to advanced enum usage.