CleanArchitecture.Core.Infrastructure
1.0.0-alpha.4
dotnet add package CleanArchitecture.Core.Infrastructure --version 1.0.0-alpha.4
NuGet\Install-Package CleanArchitecture.Core.Infrastructure -Version 1.0.0-alpha.4
<PackageReference Include="CleanArchitecture.Core.Infrastructure" Version="1.0.0-alpha.4" />
<PackageVersion Include="CleanArchitecture.Core.Infrastructure" Version="1.0.0-alpha.4" />
<PackageReference Include="CleanArchitecture.Core.Infrastructure" />
paket add CleanArchitecture.Core.Infrastructure --version 1.0.0-alpha.4
#r "nuget: CleanArchitecture.Core.Infrastructure, 1.0.0-alpha.4"
#:package CleanArchitecture.Core.Infrastructure@1.0.0-alpha.4
#addin nuget:?package=CleanArchitecture.Core.Infrastructure&version=1.0.0-alpha.4&prerelease
#tool nuget:?package=CleanArchitecture.Core.Infrastructure&version=1.0.0-alpha.4&prerelease
CleanArchitecture.Core.Infrastructure
Core infrastructure implementations including custom mediator, event dispatchers, and dependency injection extensions for Clean Architecture.
Purpose
This package provides ready-to-use implementations of IMediator, IDomainEventDispatcher, and IIntegrationEventDispatcher with dependency injection extensions. It works with CleanArchitecture.Core.Application to provide a complete CQRS and event-driven architecture foundation.
Installation
dotnet add package CleanArchitecture.Core.Infrastructure
Usage
Register Infrastructure Services
services.AddCoreInfrastructure();
Custom Configuration
services.AddCoreInfrastructure(options =>
{
options.RegisterConvention = true;
// or provide custom convention
options.CustomConvention = new CustomIntegrationEventConvention();
});
Use Mediator
public class ProductService
{
private readonly IMediator _mediator;
public ProductService(IMediator mediator)
{
_mediator = mediator;
}
public async Task<Result<Guid>> CreateProduct(string name)
{
var command = new CreateProductCommand(name);
return await _mediator.Send(command);
}
}
Use Event Dispatchers
public class OrderService
{
private readonly IDomainEventDispatcher _domainEventDispatcher;
private readonly IIntegrationEventDispatcher _integrationEventDispatcher;
public async Task CompleteOrder(Order order)
{
// Domain events are dispatched within transaction
await _domainEventDispatcher.PublishAsync(new OrderCompletedEvent(order.Id));
// Integration events are dispatched via outbox pattern
await _integrationEventDispatcher.PublishAsync(new OrderCompletedIntegrationEvent(order.Id));
}
}
Key Components
CustomMediator- Implementation of IMediatorDomainEventDispatcher- Implementation of IDomainEventDispatcherIntegrationEventDispatcher- Implementation of IIntegrationEventDispatcherDefaultIntegrationEventConvention- Default convention for discovering integration events
Dependencies
Requires CleanArchitecture.Core.Application and CleanArchitecture.Core.Domain.
Repository
GitHub: https://github.com/mohd2sh/CleanArchitecture-DDD-CQRS
License
MIT
| 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. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- CleanArchitecture.Core.Application (>= 1.0.0-alpha.4)
- CleanArchitecture.Core.Domain (>= 1.0.0-alpha.4)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0-alpha.4 | 152 | 11/10/2025 |
| 1.0.0-alpha.3 | 150 | 11/10/2025 |