Cross.CQRS 11.2.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Cross.CQRS --version 11.2.0
                    
NuGet\Install-Package Cross.CQRS -Version 11.2.0
                    
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="Cross.CQRS" Version="11.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Cross.CQRS" Version="11.2.0" />
                    
Directory.Packages.props
<PackageReference Include="Cross.CQRS" />
                    
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 Cross.CQRS --version 11.2.0
                    
#r "nuget: Cross.CQRS, 11.2.0"
                    
#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 Cross.CQRS@11.2.0
                    
#: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=Cross.CQRS&version=11.2.0
                    
Install as a Cake Addin
#tool nuget:?package=Cross.CQRS&version=11.2.0
                    
Install as a Cake Tool

License GitHub Release Date NuGetVersion NugetDownloads Coverage issues .NET PR

Size GitHub contributors GitHub commits since latest release (by date) Activity Activity Activity

Cross.CQRS

Simple .NET MediatR base Query, Command, Event, Validation and Filter.

Event Queue, Validation and Filter behaviors written on C#.

Main Features:

  • Queries, and QueryHandlers.

    Implemented base patterns to work with Queries. The Queries used just to get any data.

  • Commands and CommandHandlers.

    Implemented base patterns to work with Commands. The Commands used to modify entities.

  • CommandEvents, CommandEventHandlers, CommandEventWriter, CommandEventReader and CommandEventQueueProcessBehavior.

    Implemented base patterns to create CommandEvents, approach how to write a new CommandEvents from the Commands, consuming patterns and behavior to handle it.

    The main idea is to do some actions after the Commands have to be finished, to avoid cases when one Command call another one.

    Added possibility to exclude the processing of some CommandEvents from Command transaction (even on throw Exception).

  • Filters.

    Here included filter behavior based on RequestFilter and ResultFilter.

    The RequestFilter allow to filter Queries and Commands requests before their execution.

    The ResultFilter allow to filter Queries and Commands results after their execution.

  • Validation.

    Here included validation behavior based on FluentValidation, that allow to validate Queries and Command before their execution.

  • .NET frameworks and Source Linking.

    Supported frameworks: .NET Standard 2.1, .NET 6, .NET 7, .NET 8, .NET 9, .NET 10 (TFM-specific versions of Microsoft.Extensions.* are referenced in the package).

    Source linking enabled and symbol package is published to nuget symbols server, making debugging easier.

  • Licensing (optional JWT).

    You can set LicenseKey on CqrsServiceConfiguration to a Peshkov license JWT. Validation runs at host start (LicenseHostedValidator) and on every MediatR request via LicenseCheckBehavior / CheckLicense (for ILicenseProductInfo with Product of "Cross.CQRS" or "Cross.CQRS.EF"). License keys: peshkov.biz.

Install NuGet package

Install the Cross.CQRS NuGet package into your ASP.NET Core project:

Install-Package Cross.CQRS

or

dotnet add package Cross.CQRS

Either commands, from Package Manager Console or .NET Core CLI, will download and install Cross.CQRS and all required dependencies.

Registering with IServiceCollection

Cross.CQRS supports Microsoft.Extensions.DependencyInjection.Abstractions directly. To register Cross.CQRS services and handlers, use the configuration overload:

services.AddCQRS(cfg =>
{
    cfg.RegisterFromAssemblies(typeof(Startup).Assembly);
});

or with RegisterFromAssemblyContaining:

services.AddCQRS(cfg =>
{
    cfg.RegisterFromAssemblyContaining<Startup>();
});

Multiple assemblies:

services.AddCQRS(cfg =>
{
    cfg.RegisterFromAssemblies(typeof(Startup).Assembly, typeof(Other).Assembly);
});

With license key:

services.AddCQRS(cfg =>
{
    cfg.RegisterFromAssemblyContaining<Startup>();
    cfg.LicenseKey = "<license key here>";
});

This registers (via MediatR with Scoped lifetime):

  • IMediator, ISender, IPublisher — scoped
  • IRequestHandler<,> and IRequestHandler<> implementations — scoped
  • INotificationHandler<> implementations — scoped
  • IStreamRequestHandler<> implementations — scoped
  • IRequestExceptionHandler<,,> and IRequestExceptionAction<,> implementations — scoped

Additionally registered:

  • FluentValidation validators scanned from all assemblies registered in CqrsServiceConfiguration (same set as MediatR and filters) — scoped
  • IResultFilter<,> and IRequestFilter<> — scoped
  • IHandlerLocator — singleton
  • LicenseAccessor, LicenseValidator, default ILicenseProductInfo (LicenseProductInfo) — singleton
  • LicenseHostedValidator (IHostedService) — CheckLicense at host start
  • ICommandEventQueue and its reader/writer — scoped
  • Pipeline behaviors (scoped): LicenseCheckBehavior (order -2), CommandEventQueueProcessBehavior, RequestFilterBehavior, ValidationBehavior, ResultFilterBehavior

The method returns CqrsRegistrationSyntax for fluent configuration (e.g. adding custom behaviors).

License keys are available at peshkov.biz.

Issues and Pull Request

Contribution is welcomed. See CONTRIBUTING.md. If you would like to provide a PR please add some testing.

Release history (newest first): docs/CHANGELOG.md. Breaking upgrades for NuGet consumers: docs/BREAKING.md.

How To's

Please use Wiki for documentation and usage examples.

Complete usage examples can be found in the test project

Note - test project is not a part of nuget package. You have to clone repository.

Roadmap:

  • Queries implementation
  • Commands Implementation
  • Validation behavior (based on FluentValidation)
  • Events
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  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 is compatible.  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 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 is compatible.  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 is compatible.  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 netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen 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.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Cross.CQRS:

Package Downloads
Cross.CQRS.EF

Simple .NET MediatR base EF Transactional Behavior for Cross.CQRS.

Cross.DataFilter

A lightweight .NET library designed to simplify data filtering, sorting, and pagination in Entity Framework Core applications. The library provides a robust set of tools for handling common data access patterns with a focus on performance and extensibility. Main Features: - **Advanced Pagination** - Efficient query pagination with skip/take operations - Support for both IQueryable and IEnumerable collections - Built-in page size and count tracking - **Dynamic Sorting** - Attribute-based sorting configuration - Multi-level property sorting - Case-insensitive string comparison - Support for complex object sorting - **AutoComplete Support** - Ready-to-use autocomplete query handlers - Built-in pagination for large datasets - Configurable ordering - Support for grouped results - **Flexible Architecture** - CQRS-friendly design - Integration with MediatR - Extensible query handlers - Support for custom filtering logic The library is particularly useful for building modern web applications that require efficient data handling with minimal boilerplate code.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
12.0.0 88 9/18/2026
12.0.0-preview.5 52 9/18/2026
11.2.1-dev.9 48 9/17/2026
11.2.0 116 9/17/2026
11.2.0-preview.20 55 9/17/2026
11.2.0-preview.3 54 9/17/2026
11.1.3-dev.8 45 9/17/2026
11.1.2 254 9/14/2026
11.1.2-preview.10 54 9/14/2026
11.1.2-preview.6 57 9/14/2026
11.1.2-dev.8 53 9/14/2026
11.1.1 90 9/13/2026
11.1.1-dev.69 54 9/13/2026
Loading failed

Cross.CQRS 11.0.0 — optional JWT licensing (LicenseCheckBehavior on every MediatR request), AddCQRS / CqrsServiceConfiguration (full-assembly FluentValidation scan), TFMs netstandard2.1 + net6–net10. AsyncRequestHandlerBase removed.

Changelog: https://github.com/denis-peshkov/Cross.CQRS/blob/master/docs/CHANGELOG.md
Breaking 10.1.x → 11.0.0: https://github.com/denis-peshkov/Cross.CQRS/blob/master/docs/BREAKING.md#from-101x-to-1100