mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-05-09 01:54:30 +08:00
- 重构 Core 兼容命令查询入口,使 legacy SendCommand/SendQuery 通过内部 bridge request 复用统一 CQRS runtime - 新增 legacy bridge handler 与真实启动路径回归测试,验证默认架构初始化会自动接入统一 pipeline - 更新 Core 与 CQRS 文档及 cqrs-rewrite 跟踪,记录 Mediator 尚未吸收的能力差距与后续收口方向
23 lines
712 B
C#
23 lines
712 B
C#
// Copyright (c) 2025-2026 GeWuYou
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
using GFramework.Cqrs.Abstractions.Cqrs;
|
|
|
|
namespace GFramework.Core.Cqrs;
|
|
|
|
/// <summary>
|
|
/// 处理 legacy 无返回值命令的 bridge handler。
|
|
/// </summary>
|
|
internal sealed class LegacyCommandDispatchRequestHandler
|
|
: LegacyCqrsDispatchHandlerBase, IRequestHandler<LegacyCommandDispatchRequest, Unit>
|
|
{
|
|
/// <inheritdoc />
|
|
public ValueTask<Unit> Handle(LegacyCommandDispatchRequest request, CancellationToken cancellationToken)
|
|
{
|
|
ArgumentNullException.ThrowIfNull(request);
|
|
PrepareTarget(request.Command);
|
|
request.Command.Execute();
|
|
return ValueTask.FromResult(Unit.Value);
|
|
}
|
|
}
|