VOOZH about

URL: https://www.nuget.org/packages/PANiXiDA.Core.Application/

⇱ NuGet Gallery | PANiXiDA.Core.Application 2.0.2




👁 Image
PANiXiDA.Core.Application 2.0.2

dotnet add package PANiXiDA.Core.Application --version 2.0.2
 
 
NuGet\Install-Package PANiXiDA.Core.Application -Version 2.0.2
 
 
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="PANiXiDA.Core.Application" Version="2.0.2" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="PANiXiDA.Core.Application" Version="2.0.2" />
 
Directory.Packages.props
<PackageReference Include="PANiXiDA.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 PANiXiDA.Core.Application --version 2.0.2
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: PANiXiDA.Core.Application, 2.0.2"
 
 
#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 PANiXiDA.Core.Application@2.0.2
 
 
#: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=PANiXiDA.Core.Application&version=2.0.2
 
Install as a Cake Addin
#tool nuget:?package=PANiXiDA.Core.Application&version=2.0.2
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

PANiXiDA.Core.Application

PANiXiDA.Core.Application is a .NET library with application-layer abstractions for Clean Architecture, CQRS, and DDD-based services.

It defines contracts and small reusable building blocks for commands, queries, request behaviors, domain event publishing, unit-of-work orchestration, repositories, aggregate tracking, and read-side paging helpers. The package intentionally does not provide a concrete mediator, database provider, dependency injection module, or transport-specific implementation.

Status

👁 CI
👁 NuGet
👁 NuGet downloads
👁 Target Framework

Features

  • CQRS request contracts: ICommand<TResult>, IQuery<TResult>, and IRequest<TResult>.
  • Mediator contracts for command/query dispatch and handler implementation.
  • Pipeline behavior contracts for before, after, and finally request stages, including before-stage success/failure results.
  • Built-in behaviors for FluentValidation request validation, transaction start, commit, cleanup, and domain event publishing.
  • FluentValidation extension for converting failed domain factory Result<T> values into property validation failures.
  • Event bus and event handler abstractions for DomainEvent integration.
  • Unit of work, repository, and aggregate tracker abstractions for DDD persistence boundaries.
  • Read-side helper models for page-based pagination, cursor pagination, sorting, and filtering.

Requirements

  • .NET 10 SDK
  • Nullable reference types enabled in consuming projects is recommended

Installation

<ItemGroup>
 <PackageReference Include="PANiXiDA.Core.Application" Version="2.0.0" />
</ItemGroup>

Basic Usage

Command Contract

using PANiXiDA.Core.Application.Messaging.Mediator.Contracts;
using PANiXiDA.Core.Application.Messaging.Mediator.Handlers;
using PANiXiDA.Core.ResultPattern;

public sealed record PingCommand : ICommand<Result>;

public sealed class PingCommandHandler : ICommandHandler<PingCommand, Result>
{
 public Task<Result> HandleAsync(
 PingCommand command,
 CancellationToken cancellationToken)
 {
 return Task.FromResult(Result.Success());
 }
}

Query Contract

using PANiXiDA.Core.Application.Messaging.Mediator.Contracts;
using PANiXiDA.Core.Application.Messaging.Mediator.Handlers;
using PANiXiDA.Core.ResultPattern;

public sealed record GetNameQuery(Guid Id) : IQuery<Result<string>>;

public sealed class GetNameQueryHandler : IQueryHandler<GetNameQuery, Result<string>>
{
 public Task<Result<string>> HandleAsync(
 GetNameQuery query,
 CancellationToken cancellationToken)
 {
 return Task.FromResult(Result.Success("PANiXiDA"));
 }
}

Page-Based Query Result

using PANiXiDA.Core.Application.Querying.Pagination;

var result = PaginationResult<string>.Create(
 items: ["first", "second"],
 pageNumber: 1,
 pageSize: 10,
 totalCount: 2);

var hasNextPage = result.HasNextPage;

Cursor-Based Query Result

using PANiXiDA.Core.Application.Querying.Cursor;

var result = CursorPaginationResult<string>.Create(
 items: ["first", "second"],
 limit: 10,
 nextCursor: "cursor-2",
 hasNextPage: true);

Request Behaviors

The package includes reusable mediator behavior implementations for request validation, command transaction orchestration, and domain event publication:

  • ValidationBehavior<TRequest, TResult> validates requests with registered FluentValidation IValidator<TRequest> implementations and returns a failed Result before the handler runs when validation fails.
  • BeginTransactionBehavior<TCommand, TResult> starts a transaction before a command handler runs.
  • PublishDomainEventsBehavior<TRequest, TResult> publishes domain events collected from tracked aggregate roots after a successful request result and clears tracked events after a failed result or completed successful publication.
  • CommitTransactionBehavior<TCommand, TResult> commits the active transaction after a successful command result.
  • CleanupTransactionBehavior<TCommand, TResult> rolls back failed command transactions and disposes transaction resources.

A consuming mediator implementation should register these behaviors in a deterministic order. A typical command pipeline is:

before: ValidationBehavior
before: BeginTransactionBehavior
handler: ICommandHandler<TCommand, TResult>
after: PublishDomainEventsBehavior
after: CommitTransactionBehavior
finally: CleanupTransactionBehavior

The exact registration mechanism depends on the mediator or composition root used by the consuming application. A consuming mediator should continue to the handler when a before behavior returns Result.Success(). When a before behavior returns a failed Result, the mediator should stop the pipeline and return a failed request TResult with the same errors.

Domain Value Validation

MustBeValidDomainValue adds a FluentValidation rule that calls a domain value factory returning Result<T>. When the factory fails, each result error message is added as a validation failure for the current property.

using FluentValidation;
using PANiXiDA.Core.Application.Validation;
using PANiXiDA.Core.ResultPattern;

public sealed record CreateUserCommand(string Email);

public sealed class CreateUserCommandValidator : AbstractValidator<CreateUserCommand>
{
 public CreateUserCommandValidator()
 {
 RuleFor(command => command.Email)
 .MustBeValidDomainValue(Email.Create);
 }
}

public sealed record Email(string Value)
{
 public static Result<Email> Create(string value)
 {
 if (string.IsNullOrWhiteSpace(value))
 {
 return Result.Failure<Email>(Error.Validation("Email is required."));
 }

 return Result.Success(new Email(value));
 }
}

API Overview

Messaging

  • IMediator dispatches commands and queries.
  • ICommandHandler<TCommand, TResult> handles state-changing requests.
  • IQueryHandler<TQuery, TResult> handles read-only requests.
  • IBeforeRequestBehavior<TRequest, TResult> runs before a handler and returns Result.Success() to continue request processing, or a failed Result to stop it.
  • IAfterRequestBehavior<TRequest, TResult> runs after a handler returns a result and is defined in the mediator behavior abstractions namespace.
  • IFinallyRequestBehavior<TRequest, TResult> runs after request processing completes or fails and is defined in the mediator behavior abstractions namespace.

Validation

  • MustBeValidDomainValue validates a property through a domain factory that returns Result<T> and maps failed result errors to FluentValidation failures.

Domain Events

  • IEventBus publishes domain events.
  • IEventHandler<TEvent> handles a specific domain event type.
  • IAggregateTracker tracks aggregate roots touched during a request so their domain events can be published and cleared.

Persistence

  • IUnitOfWork defines persistence and transaction operations.
  • IRepository<TId, TAggregateRoot> defines basic aggregate persistence operations.
  • IReadRepository<TId> defines read-only existence checks.

Querying Models

  • PaginationParameters calculates Skip and Take for page-based reads.
  • PaginationResult<TItem> returns page metadata and items.
  • CursorPaginationParameters represents cursor pagination input.
  • CursorPaginationResult<TItem> returns cursor pagination metadata and items.
  • SortParameters and SortOrder represent read sorting options.
  • FilterParameters is the base type for custom read filter records.

Configuration

The package does not require runtime configuration. Consumers provide concrete implementations for mediator dispatch, persistence, event bus delivery, aggregate tracking, and dependency injection registration.

Development

Restore

dotnet restore

Format

dotnet format

Build

dotnet build --configuration Release

Test

dotnet test --configuration Release

Pack

dotnet pack --configuration Release

Project Structure

.
├── src/
│ └── PANiXiDA.Core.Application/
├── tests/
│ └── PANiXiDA.Core.Application.UnitTests/
├── Directory.Build.props
├── Directory.Build.targets
├── Directory.Packages.props
├── global.json
├── version.json
├── icon.png
├── LICENSE
└── README.md

License

This project is licensed under the Apache-2.0 license. See the file for details.

Product Versions Compatible and additional computed target framework versions.
.NET net10.0 net10.0 is compatible.  net10.0-android net10.0-android was computed.  net10.0-browser net10.0-browser was computed.  net10.0-ios net10.0-ios was computed.  net10.0-maccatalyst net10.0-maccatalyst was computed.  net10.0-macos net10.0-macos was computed.  net10.0-tvos net10.0-tvos was computed.  net10.0-windows 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 (2)

Showing the top 2 NuGet packages that depend on PANiXiDA.Core.Application:

Package Downloads
PANiXiDA.Core.Infrastructure.Persistence.Ef

Core infrastructure abstractions and utilities for Entity Framework Core persistence adapters.

PANiXiDA.Core.Infrastructure.Messaging.Wolverine

Wolverine-based messaging infrastructure adapter for PANiXiDA.Core applications, providing mediator, command, query and event publishing integration.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.2 49 6/16/2026
2.0.1 77 6/16/2026
1.0.3 175 6/12/2026
1.0.2 149 5/10/2026