// Copyright (c) 2025-2026 GeWuYou
// SPDX-License-Identifier: Apache-2.0
using GFramework.Core.Abstractions.Architectures;
using GFramework.Core.Abstractions.Query;
using GFramework.Core.Rule;
namespace GFramework.Core.Tests.Query;
///
/// 为 提供可观察上下文注入的 legacy 查询。
///
internal sealed class ContextAwareLegacyQuery(int result) : ContextAwareBase, IQuery
{
///
/// 获取执行期间观察到的架构上下文。
///
public IArchitectureContext? ObservedContext { get; private set; }
///
public int Do()
{
ObservedContext = ((GFramework.Core.Abstractions.Rule.IContextAware)this).GetContext();
return result;
}
}