mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-05-09 01:54:30 +08:00
- 修复 legacy bridge 测试装配与清理流程,改用 InternalsVisibleTo 和显式 handler 注册,补齐共享计数器重置与生命周期说明 - 优化 CommandExecutor、QueryExecutor 与相关模块的 runtime 契约,补充 XML 文档、nullable 注解和显式依赖解析 - 更新 legacy 异步 bridge 的取消语义、兼容文档回退边界以及 cqrs-rewrite active tracking/trace
26 lines
917 B
C#
26 lines
917 B
C#
// Copyright (c) 2025-2026 GeWuYou
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
using CoreCommand = GFramework.Core.Abstractions.Command;
|
|
using GFramework.Cqrs.Abstractions.Cqrs;
|
|
|
|
namespace GFramework.Core.Cqrs;
|
|
|
|
/// <summary>
|
|
/// 包装 legacy 无返回值命令,使其能够通过自有 CQRS runtime 调度。
|
|
/// </summary>
|
|
/// <param name="command">当前 bridge request 代理的 legacy 命令实例。</param>
|
|
internal sealed class LegacyCommandDispatchRequest(CoreCommand.ICommand command)
|
|
: LegacyCqrsDispatchRequestBase(ValidateCommand(command)), IRequest<Unit>
|
|
{
|
|
/// <summary>
|
|
/// 获取当前 bridge request 代理的命令实例。
|
|
/// </summary>
|
|
public CoreCommand.ICommand Command { get; } = command;
|
|
|
|
private static CoreCommand.ICommand ValidateCommand(CoreCommand.ICommand command)
|
|
{
|
|
return command ?? throw new ArgumentNullException(nameof(command));
|
|
}
|
|
}
|