Welcome to DKNet Framework! This guide will help you get started with the comprehensive .NET framework designed to enhance enterprise application development using Domain-Driven Design (DDD) principles.
- .NET 10.0 SDK or later
- Visual Studio 2022 (17.13+), Visual Studio Code, or JetBrains Rider
- SQL Server or SQL Server LocalDB (for EF Core features)
- Basic understanding of Domain-Driven Design concepts
Choose the packages you need based on your requirements:
# Core Framework Extensions
dotnet add package DKNet.Fw.Extensions
# Entity Framework Core Extensions (full suite)
dotnet add package DKNet.EfCore.Extensions
dotnet add package DKNet.EfCore.Repos
dotnet add package DKNet.EfCore.Hooks
# Messaging & CQRS
dotnet add package DKNet.SlimBus.Extensions
# Blob Storage Services
dotnet add package DKNet.Svc.BlobStorage.Abstractions
# Choose your storage provider:
dotnet add package DKNet.Svc.BlobStorage.AzureStorage
# OR
dotnet add package DKNet.Svc.BlobStorage.AwsS3
# OR
dotnet add package DKNet.Svc.BlobStorage.LocalFor a complete reference implementation, use the SlimBus API template:
# Clone the template
git clone https://github.com/baoduy/DKNet.git
cd DKNet/src/Templates/SlimBus.ApiEndpoints
# Restore and run
dotnet restore
dotnet run --project SlimBus.ApiHere's a minimal setup for a new project using DKNet:
using DKNet.Fw.Extensions;
using DKNet.EfCore.Extensions;
using Microsoft.EntityFrameworkCore;
var builder = WebApplication.CreateBuilder(args);
// Add DKNet services
builder.Services.AddDbContext<AppDbContext>(options =>
options.UseSqlServer(builder.Configuration.GetConnectionString("Default")));
builder.Services.AddDKNetRepositories<AppDbContext>();
var app = builder.Build();
// Configure pipeline
app.UseRouting();
app.MapControllers();
app.Run();DKNet follows the Onion Architecture pattern with clear separation of concerns:
🌐 Presentation Layer (API Controllers, UI)
↓
🎯 Application Layer (Services, CQRS Handlers)
↓
💼 Domain Layer (Entities, Business Logic)
↓
🗄️ Infrastructure Layer (Data Access, External Services)
DKNet leverages the latest C# 14 features for improved performance and developer experience:
- Params collections for flexible method parameters
- Enhanced pattern matching for cleaner business logic
- Primary constructors in domain entities for concise code
- Lock object improvements for better concurrency
- Choose Your Components - Review available packages
- Architecture Guide - Understand DDD/Onion patterns
- Configuration - Setup and configuration options
- Examples - Practical implementation examples
- API Reference - Detailed API documentation
Perfect for implementing clean architecture with command/query separation.
Implement event-driven architecture with built-in domain events.
Row-level security and data filtering based on user context.
Built-in support for tenant-aware applications.
- Start Small: Begin with core extensions and add components as needed
- Follow Patterns: Use the SlimBus template as a reference
- Test-Driven: Leverage TestContainers for integration tests
- Stay Current: Follow semantic versioning for updates
- Documentation: Complete Documentation
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Contributing: Contributing Guide
💡 Pro Tip: The SlimBus template provides a complete working example of all DKNet components working together. Use it as your starting point!