DomainCraft 1.0.2
See the version list below for details.
dotnet add package DomainCraft --version 1.0.2
NuGet\Install-Package DomainCraft -Version 1.0.2
<PackageReference Include="DomainCraft" Version="1.0.2" />
paket add DomainCraft --version 1.0.2
#r "nuget: DomainCraft, 1.0.2"
// Install DomainCraft as a Cake Addin #addin nuget:?package=DomainCraft&version=1.0.2 // Install DomainCraft as a Cake Tool #tool nuget:?package=DomainCraft&version=1.0.2
DomainCraft
DomainCraft is a modular and extensible framework designed to simplify the implementation of Clean Architecture and Domain-Driven Design (DDD) in .NET applications. It provides ready-to-use utilities like Generic Repositories, Caching, Logging, Event Bus, Dependency Injection Helpers, and more.
📦 Installation
To install DomainCraft, use NuGet Package Manager:
Install-Package DomainCraft
Or via .NET CLI:
dotnet add package DomainCraft
🚀 Features
1️⃣ EF Core Generic Repository & Unit of Work
Provides a generic repository pattern with built-in Unit of Work.
services.AddDomainCraftEFCore();
✅ Includes:
- Generic Repository (
IRepository<T, TKey>
) - Unit of Work (
IUnitOfWork
) - Query Support (
IQueryable
,AsNoTracking
)
2️⃣ Caching with Redis
Provides distributed caching with Redis.
services.AddDomainCraftCaching(options =>
{
options.RedisConnectionString = "localhost:6379";
options.InstanceName = "MyAppCache";
});
✅ Features:
- Supports in-memory and Redis
- Configurable expiration & eviction policies
3️⃣ Logging Middleware (Serilog + Elasticsearch)
Automatically logs API requests & responses and sends them to Elasticsearch.
services.AddDomainCraftLogging(configuration);
✅ Features:
- Correlation ID support for tracing requests
- Structured logging using Serilog
- Integration with Elasticsearch
4️⃣ Event Bus (MassTransit + RabbitMQ)
Implements Event-Driven Architecture with MassTransit and RabbitMQ.
services.AddDomainCraftEventBus(options =>
{
options.Host = "rabbitmq://localhost";
options.Username = "guest";
options.Password = "guest";
});
✅ Features:
- Publish/Subscribe mechanism for microservices
- Retry Policies and Circuit Breaker with Polly
- Supports Multiple Consumers
📌 Publishing an Event:
await _eventBus.PublishAsync(new OrderCreatedEvent(orderId));
📌 Consuming an Event:
public class OrderCreatedConsumer : EventConsumer<OrderCreatedEvent>
{
public override async Task ConsumeAsync(OrderCreatedEvent message)
{
Console.WriteLine($"Processing order: {message.OrderId}");
}
}
🛠 Registering DomainCraft in Your Application
In Program.cs, register DomainCraft:
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddDomainCraft(builder.Configuration, options =>
{
options.UseCaching = true;
options.ConfigureCache = cacheOptions =>
{
cacheOptions.RedisConnectionString = "localhost:6379";
};
});
var app = builder.Build();
app.UseDomainCraftMiddlewares();
app.Run();
🔥 Contributing
We welcome contributions! Feel free to open an Issue or Pull Request.
⭐ License
DomainCraft is open-source under the MIT License.
🚀 Happy Coding!
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
-
net8.0
- DomainCraft.EFCore (>= 1.0.2)
- DomainCraft.EventBus (>= 1.0.0)
- DomainCraft.LoggingMiddleware (>= 1.0.0)
- DomainCraft.RedisCaching (>= 1.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.