Mohd2sh.CleanArchitecture.Core.Application 1.0.1

dotnet add package Mohd2sh.CleanArchitecture.Core.Application --version 1.0.1
                    
NuGet\Install-Package Mohd2sh.CleanArchitecture.Core.Application -Version 1.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Mohd2sh.CleanArchitecture.Core.Application" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Mohd2sh.CleanArchitecture.Core.Application" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="Mohd2sh.CleanArchitecture.Core.Application" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Mohd2sh.CleanArchitecture.Core.Application --version 1.0.1
                    
#r "nuget: Mohd2sh.CleanArchitecture.Core.Application, 1.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Mohd2sh.CleanArchitecture.Core.Application@1.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Mohd2sh.CleanArchitecture.Core.Application&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=Mohd2sh.CleanArchitecture.Core.Application&version=1.0.1
                    
Install as a Cake Tool

CleanArchitecture.Core.Application

Core application layer abstractions, CQRS interfaces, and handler registration extensions for Clean Architecture.

Purpose

This package provides CQRS abstractions (commands, queries, mediator) and dependency injection extensions for automatic handler discovery and registration.

Installation

dotnet add package Mohd2sh.CleanArchitecture.Core.Application

Usage

Register Handlers

services.AddApplicationHandlers(typeof(YourApplication.ServiceCollectionExtensions).Assembly);

Command

public record CreateProductCommand(string Name) : ICommand<Result<Guid>>;

public class CreateProductCommandHandler : ICommandHandler<CreateProductCommand, Result<Guid>>
{
    public Task<Result<Guid>> Handle(CreateProductCommand request, CancellationToken cancellationToken)
    {
        // Implementation
    }
}

Query

public record GetProductQuery(Guid Id) : IQuery<Result<ProductDto>>;

public class GetProductQueryHandler : IQueryHandler<GetProductQuery, Result<ProductDto>>
{
    public Task<Result<ProductDto>> Handle(GetProductQuery request, CancellationToken cancellationToken)
    {
        // Implementation
    }
}

Domain Event Handler

public class OrderCreatedEventHandler : IDomainEventHandler<OrderCreatedEvent>
{
    public Task Handle(OrderCreatedEvent @event, CancellationToken cancellationToken)
    {
        // Implementation
    }
}

Integration Event Handler

public class OrderCompletedEventHandler : IIntegrationEventHandler<OrderCompletedEvent>
{
    public Task Handle(OrderCompletedEvent @event, CancellationToken cancellationToken)
    {
        // Implementation
    }
}

Key Components

  • ICommand<TResult> - Command interface
  • IQuery<TResult> - Query interface
  • IMediator - Mediator interface for sending commands and queries
  • ICommandHandler<TCommand, TResult> - Command handler interface
  • IQueryHandler<TQuery, TResult> - Query handler interface
  • IDomainEventHandler<TEvent> - Domain event handler interface
  • IIntegrationEventHandler<TEvent> - Integration event handler interface

Repository

GitHub: https://github.com/mohd2sh/CleanArchitecture-DDD-CQRS

License

MIT

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on Mohd2sh.CleanArchitecture.Core.Application:

Package Downloads
Mohd2sh.CleanArchitecture.Core.Infrastructure

Core infrastructure implementations including custom mediator, event dispatchers, and dependency injection extensions for Clean Architecture. Provides ready-to-use implementations of IMediator, IDomainEventDispatcher, IIntegrationEventDispatcher with DI registration extensions.

Mohd2sh.CleanArchitecture.Core.ArchitectureTests

Reusable architecture test base classes for Clean Architecture and DDD validation. Provides base test classes that consumers can inherit to enforce architectural rules and boundaries.

Mohd2sh.CleanArchitecture.Core.Infrastructure.Persistence

Core infrastructure Persistence including ef core base, ef transaction, unit of work, and ef criteria.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 368 11/30/2025
1.0.0 262 11/10/2025
1.0.0-alpha.6 154 11/10/2025