Skip to content

Unleash the power of Domain-Driven Design (DDD) in your .NET applications with `Domain`! This library simplifies DDD, enabling you to focus on crafting robust business logic.

License

Notifications You must be signed in to change notification settings

wangkanai/foundation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Wangkanai Domain-Driven-Design

A Comprehensive Domain-Driven Design Framework for .NET

.NET Quality Gate Status

Open Collective Patreon GitHub

Welcome to the Wangkanai Domain-Driven-Design Foundation repository - a robust framework providing essential building blocks for implementing Domain-Driven Design (DDD) patterns in .NET applications. This foundation library offers core domain modeling capabilities, comprehensive auditing features, and Entity Framework Core integrations to accelerate enterprise application development.

πŸ“¦ Modules

This repository produces three NuGet packages:

Wangkanai.Foundation

Package Release Pre-Release
Wangkanai.Foundation.Domain NuGet Version NuGet Pre Release
Wangkanai.Foundation.Application NuGet Version NuGet Pre Release
Wangkanai.Foundation.Infrastructure NuGet Version NuGet Pre Release

Core domain-driven design patterns and fundamental building blocks for implementing DDD in .NET applications. This module provides the essential abstractions and base implementations for creating rich domain models.

Features:

  • Entity Base Classes: Strongly-typed entities with generic ID support, optimized EF proxy handling, and performance caching
  • Value Objects: Immutable value objects with structural equality, cache key generation, and optimized equality comparison
  • Aggregate Roots: Support for aggregate boundaries with typed ID constraints (Int, Guid, String, Long, Byte)
  • Domain Events: Event-driven architecture with versioning, timestamps, and event suppression capabilities
  • Repository Pattern: Generic sync/async repository interfaces with Unit of Work pattern support
  • Result Pattern: Railway-oriented programming for error handling with typed success/failure results
  • Domain Exceptions: Structured exception hierarchy for domain-specific errors
  • Cache Key Management: Advanced cache key generation with type-based and composite key support
  • Change Tracking: Entity state tracking with entry state management (Unchanged, Modified, Added, Deleted)
  • Performance Optimizations: Built-in performance monitoring and type caching for improved runtime efficiency

Wangkanai.Audit

Package Release Pre-Release
Wangkanai.Audit.Domain NuGet Version NuGet Pre Release
Wangkanai.Audit.Application NuGet Version NuGet Pre Release
Wangkanai.Audit.Infrastructure NuGet Version NuGet Pre Release

Comprehensive auditing module for maintaining complete audit trails and change history in your domain models. Seamlessly integrates with the Foundation module to provide automatic tracking capabilities.

Features:

  • Audit Trail Entity: Comprehensive trail tracking with user, timestamp, and change details
  • Auditable Entity Base Classes: Pre-built entities with Created, Updated, Deleted timestamps
  • User Auditable Entities: Track CreatedBy, UpdatedBy, DeletedBy user information
  • Trail Type Enumeration: Categorize changes as Create, Update, Delete, or None
  • JSON Value Storage: Efficient storage of old/new values in optimized JSON format
  • Field-Level Change Tracking: Monitor and record specific column modifications
  • Trail Store Repository: Queryable store for managing and retrieving audit records
  • Entity Configuration Builders: Fluent API for configuring audit behavior
  • Soft Delete Support: Track deletions with timestamp and user information
  • Row Version Support: Optimistic concurrency control with version tracking

Wangkanai.EntityFramework

Package Release Pre-Release
Wangkanai.EntityFramework NuGet Version NuGet Pre Release
Wangkanai.EntityFramework.Postgres NuGet Version NuGet Pre Release
Wangkanai.EntityFramework.SqlServer NuGet Version NuGet Pre Release
Wangkanai.EntityFramework.MySql NuGet Version NuGet Pre Release
Wangkanai.EntityFramework.Sqlite NuGet Version NuGet Pre Release

Entity Framework Core integration module that bridges DDD patterns with EF Core's powerful ORM capabilities. Provides utilities and extensions for seamless database operations while maintaining domain model purity.

Features:

  • Database Management Extensions: CreateDatabase, MigrateDatabase with async support
  • Value Generators: DateTime and DateTimeOffset generators for automatic timestamps
  • Database Provider Support: Specialized extensions for Postgres, SqlServer, MySql, Sqlite
  • PostgreSQL Features: JSONB support, array types, full-text search, partitioning, real-time notifications
  • SQL Server Features: Temporal tables, columnstore indexes, memory-optimized tables, change tracking
  • MySQL Features: JSON support, replication configuration, partitioning, query optimization
  • SQLite Features: JSON1 extension, full-text search, spatial data, version management
  • Bulk Operations: Efficient bulk insert/update/delete across all providers
  • Index Optimization: Provider-specific index configurations and strategies
  • Connection Management: Advanced connection pooling and configuration options

🀝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests for new functionality
  5. Ensure all tests pass
  6. Submit a pull request

πŸ“‹ Requirements

  • .NET 9.0 or later
  • Entity Framework Core 9.0 or later (for EF-related packages)

πŸ“„ License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

πŸ’ Support

If this project has helped you, please consider:

πŸ“š Documentation

For detailed documentation, examples, and API references, visit our Documentation.


Built with ❀️ by Sarin Na Wangkanai and the community.

About

Unleash the power of Domain-Driven Design (DDD) in your .NET applications with `Domain`! This library simplifies DDD, enabling you to focus on crafting robust business logic.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

  •  

Packages

No packages published

Contributors 3

  •  
  •  
  •