A C# source generator that creates helper classes for enums, providing fast operations without reflection.
Supernova.Enum.Generators is a C# source generator that automatically creates extension classes for enums, providing fast helper methods for common operations like string conversion, validation, and metadata access. It solves the performance issues associated with using reflection for enum handling by generating compile-time code. This allows developers to work with enums more efficiently in their .NET applications.
C# developers who frequently work with enums and need high-performance operations without the overhead of reflection, particularly those building performance-sensitive applications or libraries.
Developers choose this library because it eliminates reflection-based enum operations, offering significant performance improvements while maintaining type safety. Its seamless integration via a simple attribute and automatic code generation provides a better developer experience compared to manual helper methods or slower reflection approaches.
A C# source generator to create an enumeration class from an enum type. With this package, you can work on enums very, very fast without using reflection.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Eliminates reflection overhead by generating compile-time methods like ToStringFast(), with benchmarks in the README showing significant speed improvements for common operations.
Automatically generates helper classes from enums decorated with [EnumGenerator], reducing manual coding effort and ensuring consistency across projects.
Provides a wide range of methods, including ToDisplayFast() and TryParseFast(), covering string conversion, validation, parsing, and metadata access as shown in the generated code examples.
All code is generated at compile time, catching errors early and avoiding runtime issues associated with reflection, enhancing reliability.
The README acknowledges that IDEs may not recognize generated code immediately, requiring restarts, which can disrupt development workflows and increase frustration.
Cannot handle enums that are created or altered at runtime, as generation occurs only during compilation, limiting flexibility for dynamic scenarios.
Relies heavily on the [Display] attribute for display names and descriptions; enums without this attribute may lack full functionality, forcing additional customization.