mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-03-22 19:03:29 +08:00
- 新增 ContextAwareExtensions 扩展类,提供便捷的上下文访问方法 - 为 IContextAware 接口添加 GetContext 方法以获取架构上下文 - 更新 ContextAwareBase 基类实现 GetContext 方法 - 改进源代码生成器的 Generate 方法参数结构 - 重构 ContextAwareGenerator 生成器实现接口方法自动实现 - 更新单元测试以验证新生成的上下文感知代码正确性
21 lines
672 B
C#
21 lines
672 B
C#
using GFramework.Core.Abstractions.architecture;
|
|
|
|
namespace GFramework.Core.Abstractions.rule;
|
|
|
|
/// <summary>
|
|
/// 上下文感知接口,用于为实现该接口的类提供设置和获取架构上下文的能力
|
|
/// </summary>
|
|
public interface IContextAware
|
|
{
|
|
/// <summary>
|
|
/// 设置架构上下文
|
|
/// </summary>
|
|
/// <param name="context">架构上下文对象,用于提供架构级别的服务和功能访问</param>
|
|
void SetContext(IArchitectureContext context);
|
|
|
|
/// <summary>
|
|
/// 获取架构上下文
|
|
/// </summary>
|
|
/// <returns>当前的架构上下文对象</returns>
|
|
IArchitectureContext GetContext();
|
|
} |