Chatilay.Cqrs 0.1.0-preview.1

This is a prerelease version of Chatilay.Cqrs.
dotnet add package Chatilay.Cqrs --version 0.1.0-preview.1
                    
NuGet\Install-Package Chatilay.Cqrs -Version 0.1.0-preview.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="Chatilay.Cqrs" Version="0.1.0-preview.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Chatilay.Cqrs" Version="0.1.0-preview.1" />
                    
Directory.Packages.props
<PackageReference Include="Chatilay.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 Chatilay.Cqrs --version 0.1.0-preview.1
                    
#r "nuget: Chatilay.Cqrs, 0.1.0-preview.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 Chatilay.Cqrs@0.1.0-preview.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=Chatilay.Cqrs&version=0.1.0-preview.1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Chatilay.Cqrs&version=0.1.0-preview.1&prerelease
                    
Install as a Cake Tool

Chatilay.Cqrs

CI NuGet

Tek bir ICommandQueryRequest soyutlaması üzerine kurulu, reflection maliyeti cache'lenmiş hafif CQRS / mediator altyapısı. ICommand / IQuery ayrımı yoktur.

Kurulum

dotnet add package Chatilay.Cqrs

Kayıt

builder.Services.AddChatilayCqrs(typeof(Program).Assembly);

veya

builder.Services.AddChatilayCqrs(options =>
{
    options.RegisterServicesFromAssemblyContaining<Program>();
    options.HandlerLifetime = ServiceLifetime.Scoped;
    options.SenderLifetime = ServiceLifetime.Scoped;
});

Dönüş değeri olan istek

public sealed record GetUserQuery(int Id) : ICommandQueryRequest<UserDto>;

public sealed class GetUserQueryHandler : ICommandQueryHandler<GetUserQuery, UserDto>
{
    public Task<UserDto> Handle(GetUserQuery request, CancellationToken cancellationToken)
        => Task.FromResult(new UserDto(request.Id));
}

var user = await sender.Send(new GetUserQuery(1), cancellationToken);

Dönüş değeri olmayan istek

public sealed record DeleteUserCommand(int Id) : ICommandQueryRequest;

public sealed class DeleteUserCommandHandler : ICommandQueryHandler<DeleteUserCommand>
{
    public Task HandleAsync(DeleteUserCommand request, CancellationToken cancellationToken)
        => Task.CompletedTask;
}

await sender.Send(new DeleteUserCommand(1), cancellationToken);

Event

public sealed record UserCreatedEvent(int Id) : IEvent;

public sealed class AuditHandler : IEventHandler<UserCreatedEvent>
{
    public Task Handle(UserCreatedEvent @event, CancellationToken cancellationToken)
        => Task.CompletedTask;
}

await sender.Publish(new UserCreatedEvent(1), cancellationToken);

Publish handler'ları runtime tipine göre çözer ve sırayla çalıştırır.

API yüzeyi

Tip Açıklama
ICommandQueryRequest<TResponse> Dönüş değeri olan istek
ICommandQueryRequest ICommandQueryRequest<Unit> kısayolu
ICommandQueryHandler<TRequest, TResponse> İstek handler'ı
ICommandQueryHandler<TRequest> Void handler kısayolu (HandleAsync)
IEvent / IEventHandler<TEvent> Event ve handler'ı
ISender Send / Publish
Unit Void karşılığı

Depo yapısı

Chatilay.Cqrs/
├── Directory.Build.props
├── LICENSE
├── README.md
├── artifacts/                     # tüm build çıktısı (UseArtifactsOutput)
├── src/Chatilay.Cqrs/
└── tests/Chatilay.Cqrs.Tests/

Kaynaktan derleme

dotnet test -c Release
dotnet pack -c Release

Çıktı:

artifacts/bin/Chatilay.Cqrs/release/Chatilay.Cqrs.dll
artifacts/package/release/Chatilay.Cqrs.<version>.nupkg

Sürüm çıkarma

Directory.Build.props içindeki <Version> güncellenir, ardından tag push edilir:

git tag v0.1.0-preview.1
git push origin v0.1.0-preview.1

.github/workflows/publish.yml testleri çalıştırır, paketi üretir ve NUGET_API_KEY secret'ı ile nuget.org'a push eder.

Lisans

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

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0-preview.1 243 8/29/2026