Domain Concepts

Learn how Vogen helps represent domain concepts (CustomerId, AccountBalance) as value objects.

Understanding

Focus on the use of [ValueObject] attribute to define value objects and their underlying types.

Value Object Implementation

Understand how Vogen automatically generates code for value objects.

Understanding

Dive into the generated code, focusing on the From method, equality operators, GetHashCode, ToString, and the lack of user-defined constructors.

Primitive Obsession

Learn about Primitive Obsession as a code smell and how Vogen helps address it.

Understanding

Understand the advantages of using value objects instead of primitives for representing domain concepts.

Validation

Explore how Vogen enforces value object validation and prevents invalid values.

Understanding

Analyze the Validate method, the Validation result type, and the ValueObjectValidationException.

Code Analysis and Error Handling

Learn how Vogen uses code analysis to detect and prevent issues related to value object creation and usage.

Understanding

Examine Vogen’s error codes (VOG008, VOG009, VOG010, VOG025) and the scenarios they cover.

Configuration

Understand how to customize Vogen’s behavior for individual value objects and globally.

Understanding

Learn about the ValueObject attribute’s parameters (conversions, exception type), the global VogenDefaults attribute, and the default settings.

Serialization and Type Conversion

Learn how Vogen integrates with various serialization frameworks and converts value objects.

Understanding

Focus on the Conversions enum, the default converters (System.Text.Json and TypeConverter), and how to register custom converters (e.g., for Dapper, Newtonsoft.Json).

Performance and Memory Usage

Understand the performance implications of using Vogen’s value objects compared to native types.

Understanding

Analyze the provided benchmark results and the minimal overhead associated with Vogen’s value objects.

Integration with Frameworks

Learn about Vogen’s compatibility with other frameworks and how to use it with them.

Understanding

Focus on the wiki’s integration pages for details on EFCore, Linq2DB, MongoDB, Orleans, and ServiceStack.Text.

Testing

Understand how Vogen’s code is tested and how to effectively test applications using Vogen’s value objects.

Understanding

Analyze the tests directory, focusing on unit tests for various aspects of the code, including generation, serialization, validation, and integration with frameworks.

Source Generator and Analyzer

Learn how Vogen works behind the scenes using source generators and code analyzers.