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 尚未吸收的能力差距与后续收口方向
29 lines
865 B
C#
29 lines
865 B
C#
// Copyright (c) 2025-2026 GeWuYou
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
using GFramework.Core.Abstractions.Architectures;
|
|
using GFramework.Core.Abstractions.Command;
|
|
using GFramework.Core.Rule;
|
|
|
|
namespace GFramework.Core.Tests.Architectures;
|
|
|
|
/// <summary>
|
|
/// 用于验证 legacy 带返回值命令桥接时会沿用统一 runtime。
|
|
/// </summary>
|
|
public sealed class LegacyArchitectureBridgeCommandWithResult : ContextAwareBase, ICommand<int>
|
|
{
|
|
/// <summary>
|
|
/// 获取执行期间观察到的上下文实例。
|
|
/// </summary>
|
|
public IArchitectureContext? ObservedContext { get; private set; }
|
|
|
|
/// <summary>
|
|
/// 执行命令并返回测试结果。
|
|
/// </summary>
|
|
public int Execute()
|
|
{
|
|
ObservedContext = ((GFramework.Core.Abstractions.Rule.IContextAware)this).GetContext();
|
|
return 42;
|
|
}
|
|
}
|