Josupeit.Practices.Commands.Abstractions 1.0.6

Prefix Reserved
dotnet add package Josupeit.Practices.Commands.Abstractions --version 1.0.6
                    
NuGet\Install-Package Josupeit.Practices.Commands.Abstractions -Version 1.0.6
                    
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="Josupeit.Practices.Commands.Abstractions" Version="1.0.6" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Josupeit.Practices.Commands.Abstractions" Version="1.0.6" />
                    
Directory.Packages.props
<PackageReference Include="Josupeit.Practices.Commands.Abstractions" />
                    
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 Josupeit.Practices.Commands.Abstractions --version 1.0.6
                    
#r "nuget: Josupeit.Practices.Commands.Abstractions, 1.0.6"
                    
#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 Josupeit.Practices.Commands.Abstractions@1.0.6
                    
#: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=Josupeit.Practices.Commands.Abstractions&version=1.0.6
                    
Install as a Cake Addin
#tool nuget:?package=Josupeit.Practices.Commands.Abstractions&version=1.0.6
                    
Install as a Cake Tool

Josupeit.Practices.Commands.Abstractions

When you apply the CQRS pattern you quickly end up repeating the same small set of method signatures — Execute, ExecuteAsync, Execute(input), and so on — across dozens of command and query types. This package captures those contracts as a family of interfaces so that every command or query in your application speaks the same language, regardless of where it comes from or how it is implemented.

A deliberate design choice here is that every interface exposes both a synchronous and an asynchronous execution path. That way a caller never has to care whether the concrete implementation is sync or async underneath.

dotnet add package Josupeit.Practices.Commands.Abstractions

Interfaces

The interfaces are organized along two axes: whether the operation takes an input parameter, and whether it returns a result.

Interface Input Output Notes
ICommand Side-effecting, no return value
ICommand<TInput> TInput
ICommandWithOutput<TOutput> TOutput
ICommandWithOutput<TInput, TOutput> TInput TOutput
IQuery<TOutput> TOutput Pure — implementations must not produce observable side effects
IQuery<TInput, TOutput> TInput TOutput Pure

The distinction between ICommandWithOutput and IQuery is intentional. A command with output is still allowed to modify state; a query is not. The IQuery methods are annotated with [Pure] to make this contract explicit.

Every interface provides three overloads per direction:

void Execute();                                    // synchronous
Task ExecuteAsync();                               // asynchronous, no cancellation
Task ExecuteAsync(CancellationToken cancellationToken); // asynchronous, with cancellation

When to use this package directly

Reference Josupeit.Practices.Commands.Abstractions in libraries or shared application layers that need to work with commands and queries without depending on a specific implementation. For example, a pipeline or mediator component that dispatches commands only needs to know about ICommand<TInput>, not about any concrete base class.

public interface ICommandDispatcher
{
    Task DispatchAsync<TInput>(ICommand<TInput> command, TInput input, CancellationToken cancellationToken);
}

For the concrete base classes that implement these interfaces — and that bridge the sync and async paths automatically — install Josupeit.Practices.Commands instead.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Josupeit.Practices.Commands.Abstractions:

Package Downloads
Josupeit.Practices.Commands

CQRS command and query base classes. Implement only one execution path — sync or async — and the other is bridged automatically. Detects and reports unintended mutual recursion.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.6 155 3/10/2026

- Fixes invalid NuGet dependency version ranges that prevented package push