Enum Enhancements

The core of Intellenum lies in its enhancements to standard C# enums. Understanding the motivations behind these enhancements, such as improved performance and type safety, is crucial. Learn about the features Intellenum provides, like:

Lookups

Examine the source generation techniques used to achieve performance gains for operations like FromName and FromValue.

Safety

Analyze the code analyzers that enforce correct enum usage, preventing potential errors.

Types

Explore the support for various underlying types beyond just integers, including custom types and their implications.

Source Generation

The heart of Intellenum’s functionality lies in its use of source generation. Delve into this concept to comprehend how code is generated at compile time, creating optimized enum implementations:

Implementation

Analyze the code in the Intellenum.Generators namespace to understand the logic behind generating enum code. Templates: Explore the various templates used for different underlying types, providing a blueprint for the generated code.

Analysis

Understand how the generator interacts with code analyzers, ensuring proper enum usage.

Configuration

Intellenum allows configuring enums for specific use cases. Understand how configuration is applied and how it affects the generated code:

Configuration

Explore the IntellenumDefaults attribute and its role in setting default behavior for all enums.

Configuration

Learn how individual enums can override global configuration, allowing fine-grained control.

Options

Examine the available configuration options, such as underlying types, conversions, and customizations.

Conversions

Intellenum supports conversions between enums and other data types. Learn how conversions are handled and the various conversion mechanisms available: TypeConverter: Understand the TypeConverter implementation, particularly its role in converting enum values to and from strings.

Frameworks

Explore the support for popular serialization frameworks like System.Text.Json and Newtonsoft.Json.

EFCore, Linq2Db

Learn how Intellenum integrates with these ORMs for seamless enum handling in database interactions.

Customizations

Intellenum allows for customizations to tailor enum behavior to specific needs. Explore the customization options and their applications:

Attributes

Learn how to define custom attributes for specific enum members, influencing their behavior during conversion or serialization.

for Different Frameworks

Understand how customizations are applied to different frameworks, such as System.Text.Json or Dapper.

Type Conversions

Explore how to implement custom type conversions for specialized scenarios beyond the built-in conversions.

Testing and Debugging

Thorough testing is essential for any software project. Explore the test suite provided for Intellenum and its components:

Testing

Analyze the unit tests in the Intellenum.Tests namespace to gain an understanding of the tested functionality.

Testing

Examine the integration tests in ConsumerTests for ensuring seamless interoperability with other libraries.