Cross.CQRS
11.2.0
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
<PackageReference Include="Cross.CQRS" Version="11.2.0" />
<PackageVersion Include="Cross.CQRS" Version="11.2.0" />
<PackageReference Include="Cross.CQRS" />
paket add Cross.CQRS --version 11.2.0
#r "nuget: Cross.CQRS, 11.2.0"
#:package Cross.CQRS@11.2.0
#addin nuget:?package=Cross.CQRS&version=11.2.0
#tool nuget:?package=Cross.CQRS&version=11.2.0
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
LicenseKeyonCqrsServiceConfigurationto a Peshkov license JWT. Validation runs at host start (LicenseHostedValidator) and on every MediatR request viaLicenseCheckBehavior/CheckLicense(forILicenseProductInfowithProductof"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— scopedIRequestHandler<,>andIRequestHandler<>implementations — scopedINotificationHandler<>implementations — scopedIStreamRequestHandler<>implementations — scopedIRequestExceptionHandler<,,>andIRequestExceptionAction<,>implementations — scoped
Additionally registered:
- FluentValidation validators scanned from all assemblies registered in
CqrsServiceConfiguration(same set as MediatR and filters) — scoped IResultFilter<,>andIRequestFilter<>— scopedIHandlerLocator— singletonLicenseAccessor,LicenseValidator, defaultILicenseProductInfo(LicenseProductInfo) — singletonLicenseHostedValidator(IHostedService) —CheckLicenseat host startICommandEventQueueand 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 implementationCommands ImplementationValidation behavior (based on FluentValidation)Events
| Product | Versions 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. |
-
.NETStandard 2.1
- FluentValidation (>= 11.12.0)
- FluentValidation.DependencyInjectionExtensions (>= 11.12.0)
- JetBrains.Annotations (>= 2021.2.0)
- MediatR (>= 11.1.0)
- MediatR.Extensions.Microsoft.DependencyInjection (>= 11.1.0)
- Microsoft.Extensions.Configuration (>= 8.0.0)
- Microsoft.Extensions.Hosting.Abstractions (>= 8.0.1)
- Microsoft.Extensions.Logging (>= 8.0.1)
- Microsoft.IdentityModel.JsonWebTokens (>= 8.17.0)
- Scrutor (>= 4.2.2)
-
net10.0
- FluentValidation (>= 11.12.0)
- FluentValidation.DependencyInjectionExtensions (>= 11.12.0)
- JetBrains.Annotations (>= 2021.2.0)
- MediatR (>= 11.1.0)
- MediatR.Extensions.Microsoft.DependencyInjection (>= 11.1.0)
- Microsoft.Extensions.Configuration (>= 10.0.5)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.5)
- Microsoft.Extensions.Logging (>= 10.0.5)
- Microsoft.IdentityModel.JsonWebTokens (>= 8.17.0)
- Scrutor (>= 4.2.2)
-
net6.0
- FluentValidation (>= 11.12.0)
- FluentValidation.DependencyInjectionExtensions (>= 11.12.0)
- JetBrains.Annotations (>= 2021.2.0)
- MediatR (>= 11.1.0)
- MediatR.Extensions.Microsoft.DependencyInjection (>= 11.1.0)
- Microsoft.Extensions.Configuration (>= 8.0.0)
- Microsoft.Extensions.Hosting.Abstractions (>= 8.0.1)
- Microsoft.Extensions.Logging (>= 8.0.1)
- Microsoft.IdentityModel.JsonWebTokens (>= 8.17.0)
- Scrutor (>= 4.2.2)
-
net7.0
- FluentValidation (>= 11.12.0)
- FluentValidation.DependencyInjectionExtensions (>= 11.12.0)
- JetBrains.Annotations (>= 2021.2.0)
- MediatR (>= 11.1.0)
- MediatR.Extensions.Microsoft.DependencyInjection (>= 11.1.0)
- Microsoft.Extensions.Configuration (>= 8.0.0)
- Microsoft.Extensions.Hosting.Abstractions (>= 8.0.1)
- Microsoft.Extensions.Logging (>= 8.0.1)
- Microsoft.IdentityModel.JsonWebTokens (>= 8.17.0)
- Scrutor (>= 4.2.2)
-
net8.0
- FluentValidation (>= 11.12.0)
- FluentValidation.DependencyInjectionExtensions (>= 11.12.0)
- JetBrains.Annotations (>= 2021.2.0)
- MediatR (>= 11.1.0)
- MediatR.Extensions.Microsoft.DependencyInjection (>= 11.1.0)
- Microsoft.Extensions.Configuration (>= 8.0.0)
- Microsoft.Extensions.Hosting.Abstractions (>= 8.0.1)
- Microsoft.Extensions.Logging (>= 8.0.1)
- Microsoft.IdentityModel.JsonWebTokens (>= 8.17.0)
- Scrutor (>= 4.2.2)
-
net9.0
- FluentValidation (>= 11.12.0)
- FluentValidation.DependencyInjectionExtensions (>= 11.12.0)
- JetBrains.Annotations (>= 2021.2.0)
- MediatR (>= 11.1.0)
- MediatR.Extensions.Microsoft.DependencyInjection (>= 11.1.0)
- Microsoft.Extensions.Configuration (>= 9.0.14)
- Microsoft.Extensions.Hosting.Abstractions (>= 9.0.14)
- Microsoft.Extensions.Logging (>= 9.0.14)
- Microsoft.IdentityModel.JsonWebTokens (>= 8.17.0)
- Scrutor (>= 4.2.2)
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 |
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