mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-05-08 17:44:29 +08:00
- 重构 Core 兼容命令查询入口,使 legacy SendCommand/SendQuery 通过内部 bridge request 复用统一 CQRS runtime - 新增 legacy bridge handler 与真实启动路径回归测试,验证默认架构初始化会自动接入统一 pipeline - 更新 Core 与 CQRS 文档及 cqrs-rewrite 跟踪,记录 Mediator 尚未吸收的能力差距与后续收口方向
21 lines
735 B
C#
21 lines
735 B
C#
// Copyright (c) 2025-2026 GeWuYou
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
using GFramework.Cqrs.Abstractions.Cqrs;
|
|
|
|
namespace GFramework.Core.Cqrs;
|
|
|
|
/// <summary>
|
|
/// 包装 legacy 异步查询,使其能够通过自有 CQRS runtime 调度。
|
|
/// </summary>
|
|
internal sealed class LegacyAsyncQueryDispatchRequest(object target, Func<Task<object?>> executeAsync)
|
|
: LegacyCqrsDispatchRequestBase(target), IRequest<object?>
|
|
{
|
|
private readonly Func<Task<object?>> _executeAsync = executeAsync ?? throw new ArgumentNullException(nameof(executeAsync));
|
|
|
|
/// <summary>
|
|
/// 异步执行底层 legacy 查询并返回装箱后的结果。
|
|
/// </summary>
|
|
public Task<object?> ExecuteAsync() => _executeAsync();
|
|
}
|