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.
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.Local
For 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.Api
Hereβ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)
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.
π‘ Pro Tip: The SlimBus template provides a complete working example of all DKNet components working together. Use it as your starting point!