Skip to content

feat(architecture): 添加批量获取组件实例的功能#69

Merged
GeWuYou merged 2 commits into
mainfrom
feat/architecture-batch-component-retrieval
Mar 5, 2026
Merged

feat(architecture): 添加批量获取组件实例的功能#69
GeWuYou merged 2 commits into
mainfrom
feat/architecture-batch-component-retrieval

Conversation

@GeWuYou

@GeWuYou GeWuYou commented Mar 4, 2026

Copy link
Copy Markdown
Owner
  • 在 ArchitectureContext 中添加 GetServices、GetSystems、GetModels 和 GetUtilities 方法
  • 扩展 IArchitectureContext 接口以支持批量获取各类组件实例
  • 在测试类中实现相应的批量获取功能
  • 将原有的 ContextAwareExtensions 拆分为多个专门的扩展类文件
  • 新增 ContextAwareCommandExtensions、ContextAwareEnvironmentExtensions 和 ContextAwareEventExtensions 等扩展类
  • 提供了更完善的架构上下文组件访问能力

Summary by Sourcery

扩展架构上下文和上下文感知 API,以支持批量组件检索,并为服务、环境、事件、命令、查询和中介请求提供更细粒度的扩展点。

新特性:

  • 在架构上下文及其抽象接口中添加用于批量检索服务、系统、模型和工具的批量获取方法。
  • 引入专用的、面向上下文的扩展类,用于服务、环境、事件、命令、查询和中介交互,以提升上下文使用的人机工程性。

测试:

  • 添加单元测试,以覆盖通过上下文感知扩展进行服务、系统、模型和工具的单个和批量检索。
  • 添加单元测试,以验证上下文感知的环境访问辅助方法。
  • 添加单元测试,以验证上下文感知的事件发送、注册和取消注册行为。
Original summary in English

Summary by Sourcery

Extend architecture context and context-aware APIs to support bulk component retrieval and more granular extension points for services, environment, events, commands, queries, and mediator requests.

New Features:

  • Add batch retrieval methods for services, systems, models, and utilities to the architecture context and its abstraction interface.
  • Introduce dedicated context-aware extension classes for services, environment, events, commands, queries, and mediator interactions to improve context usage ergonomics.

Tests:

  • Add unit tests covering single and batch retrieval of services, systems, models, and utilities via context-aware extensions.
  • Add unit tests validating context-aware environment access helpers.
  • Add unit tests validating context-aware event sending, registration, and unregistration behaviors.

- 在 ArchitectureContext 中添加 GetServices、GetSystems、GetModels 和 GetUtilities 方法
- 扩展 IArchitectureContext 接口以支持批量获取各类组件实例
- 在测试类中实现相应的批量获取功能
- 将原有的 ContextAwareExtensions 拆分为多个专门的扩展类文件
- 新增 ContextAwareCommandExtensions、ContextAwareEnvironmentExtensions 和 ContextAwareEventExtensions 等扩展类
- 提供了更完善的架构上下文组件访问能力
@sourcery-ai

sourcery-ai Bot commented Mar 4, 2026

Copy link
Copy Markdown

Reviewer's Guide

为架构上下文组件(服务、系统、模型、工具)引入批量检索 API,并将原有的上下文感知扩展方法重构为聚焦的扩展类,分别为服务、环境访问和事件处理提供专用的单元测试。

通过 ContextAwareServiceExtensions.GetServices 进行批量检索的时序图

sequenceDiagram
    actor Client
    participant ContextAwareObject
    participant ContextAwareServiceExtensions
    participant IArchitectureContext
    participant ArchitectureContext
    participant IContainer

    Client->>ContextAwareObject: Call GetServices~TestService~()
    ContextAwareObject->>ContextAwareServiceExtensions: GetServices~TestService~(this)
    ContextAwareServiceExtensions->>ContextAwareObject: GetContext()
    ContextAwareObject-->>ContextAwareServiceExtensions: IArchitectureContext
    ContextAwareServiceExtensions->>IArchitectureContext: GetServices~TestService~()
    IArchitectureContext->>ArchitectureContext: GetServices~TestService~()
    ArchitectureContext->>IContainer: GetAll~TestService~()
    IContainer-->>ArchitectureContext: IReadOnlyList~TestService~
    ArchitectureContext-->>IArchitectureContext: IReadOnlyList~TestService~
    IArchitectureContext-->>ContextAwareServiceExtensions: IReadOnlyList~TestService~
    ContextAwareServiceExtensions-->>ContextAwareObject: IReadOnlyList~TestService~
    ContextAwareObject-->>Client: IReadOnlyList~TestService~
Loading

通过 ContextAwareEventExtensions 进行事件发送与处理器注册的时序图

sequenceDiagram
    actor Client
    participant ContextAwareObject
    participant ContextAwareEventExtensions
    participant IArchitectureContext
    participant ArchitectureContext
    participant IEventBus

    Client->>ContextAwareObject: RegisterEvent~TestEvent~(handler)
    ContextAwareObject->>ContextAwareEventExtensions: RegisterEvent~TestEvent~(this, handler)
    ContextAwareEventExtensions->>ContextAwareObject: GetContext()
    ContextAwareObject-->>ContextAwareEventExtensions: IArchitectureContext
    ContextAwareEventExtensions->>IArchitectureContext: RegisterEvent~TestEvent~(handler)
    IArchitectureContext->>ArchitectureContext: RegisterEvent~TestEvent~(handler)
    ArchitectureContext->>IEventBus: Register~TestEvent~(handler)
    IEventBus-->>ArchitectureContext: IUnRegister
    ArchitectureContext-->>IArchitectureContext: IUnRegister
    IArchitectureContext-->>ContextAwareEventExtensions: IUnRegister
    ContextAwareEventExtensions-->>ContextAwareObject: IUnRegister
    ContextAwareObject-->>Client: IUnRegister

    Client->>ContextAwareObject: SendEvent(new TestEvent)
    ContextAwareObject->>ContextAwareEventExtensions: SendEvent~TestEvent~(this, event)
    ContextAwareEventExtensions->>ContextAwareObject: GetContext()
    ContextAwareObject-->>ContextAwareEventExtensions: IArchitectureContext
    ContextAwareEventExtensions->>IArchitectureContext: SendEvent~TestEvent~(event)
    IArchitectureContext->>ArchitectureContext: SendEvent~TestEvent~(event)
    ArchitectureContext->>IEventBus: Publish~TestEvent~(event)
    IEventBus-->>ArchitectureContext: Dispatch to handler
    ArchitectureContext-->>IArchitectureContext: return
    IArchitectureContext-->>ContextAwareEventExtensions: return
    ContextAwareEventExtensions-->>ContextAwareObject: return
    ContextAwareObject-->>Client: return
Loading

更新后的 IArchitectureContext 批量检索 API 类图

classDiagram
    class IArchitectureContext {
        +TService GetService~TService~()
        +IReadOnlyList~TService~ GetServices~TService~()
        +TSystem GetSystem~TSystem~()
        +IReadOnlyList~TSystem~ GetSystems~TSystem~()
        +TModel GetModel~TModel~()
        +IReadOnlyList~TModel~ GetModels~TModel~()
        +TUtility GetUtility~TUtility~()
        +IReadOnlyList~TUtility~ GetUtilities~TUtility~()
        +void SendEvent~TEvent~()
        +void SendEvent~TEvent~(TEvent e)
        +IUnRegister RegisterEvent~TEvent~(Action~TEvent~ handler)
        +void UnRegisterEvent~TEvent~(Action~TEvent~ handler)
        +IEnvironment GetEnvironment()
        +ValueTask~TResponse~ SendRequestAsync~TResponse~(IRequest~TResponse~ request, CancellationToken cancellationToken)
        +TResponse SendRequest~TResponse~(IRequest~TResponse~ request)
        +ValueTask PublishAsync~TNotification~(TNotification notification, CancellationToken cancellationToken)
        +IAsyncEnumerable~TResponse~ CreateStream~TResponse~(IStreamRequest~TResponse~ request, CancellationToken cancellationToken)
        +ValueTask SendAsync~TCommand~(TCommand command, CancellationToken cancellationToken)
        +ValueTask~TResponse~ SendAsync~TResponse~(IRequest~TResponse~ command, CancellationToken cancellationToken)
        +TResponse SendCommand~TResponse~(Mediator_ICommand~TResponse~ command)
        +TResult SendCommand~TResult~(ICommand~TResult~ command)
        +void SendCommand(ICommand command)
        +ValueTask~TResponse~ SendCommandAsync~TResponse~(Mediator_ICommand~TResponse~ command, CancellationToken cancellationToken)
        +Task SendCommandAsync(IAsyncCommand command)
        +Task~TResult~ SendCommandAsync~TResult~(IAsyncCommand~TResult~ command)
        +TResponse SendQuery~TResponse~(Mediator_IQuery~TResponse~ query)
        +TResult SendQuery~TResult~(IQuery~TResult~ query)
        +ValueTask~TResponse~ SendQueryAsync~TResponse~(Mediator_IQuery~TResponse~ query, CancellationToken cancellationToken)
        +Task~TResult~ SendQueryAsync~TResult~(IAsyncQuery~TResult~ query)
    }

    class ArchitectureContext {
        -IContainer _container
        +ArchitectureContext(IContainer container)
        +TService GetService~TService~()
        +IReadOnlyList~TService~ GetServices~TService~()
        +TSystem GetSystem~TSystem~()
        +IReadOnlyList~TSystem~ GetSystems~TSystem~()
        +TModel GetModel~TModel~()
        +IReadOnlyList~TModel~ GetModels~TModel~()
        +TUtility GetUtility~TUtility~()
        +IReadOnlyList~TUtility~ GetUtilities~TUtility~()
        +void SendEvent~TEvent~()
        +void SendEvent~TEvent~(TEvent e)
        +IUnRegister RegisterEvent~TEvent~(Action~TEvent~ handler)
        +void UnRegisterEvent~TEvent~(Action~TEvent~ handler)
        +IEnvironment GetEnvironment()
        +ValueTask~TResponse~ SendRequestAsync~TResponse~(IRequest~TResponse~ request, CancellationToken cancellationToken)
        +TResponse SendRequest~TResponse~(IRequest~TResponse~ request)
        +ValueTask PublishAsync~TNotification~(TNotification notification, CancellationToken cancellationToken)
        +IAsyncEnumerable~TResponse~ CreateStream~TResponse~(IStreamRequest~TResponse~ request, CancellationToken cancellationToken)
        +ValueTask SendAsync~TCommand~(TCommand command, CancellationToken cancellationToken)
        +ValueTask~TResponse~ SendAsync~TResponse~(IRequest~TResponse~ command, CancellationToken cancellationToken)
        +TResponse SendCommand~TResponse~(Mediator_ICommand~TResponse~ command)
        +TResult SendCommand~TResult~(ICommand~TResult~ command)
        +void SendCommand(ICommand command)
        +ValueTask~TResponse~ SendCommandAsync~TResponse~(Mediator_ICommand~TResponse~ command, CancellationToken cancellationToken)
        +Task SendCommandAsync(IAsyncCommand command)
        +Task~TResult~ SendCommandAsync~TResult~(IAsyncCommand~TResult~ command)
        +TResponse SendQuery~TResponse~(Mediator_IQuery~TResponse~ query)
        +TResult SendQuery~TResult~(IQuery~TResult~ query)
        +ValueTask~TResponse~ SendQueryAsync~TResponse~(Mediator_IQuery~TResponse~ query, CancellationToken cancellationToken)
        +Task~TResult~ SendQueryAsync~TResult~(IAsyncQuery~TResult~ query)
    }

    class TestArchitectureContext {
        -IContainer _container
        +TService GetService~TService~()
        +IReadOnlyList~TService~ GetServices~TService~()
        +TSystem GetSystem~TSystem~()
        +IReadOnlyList~TSystem~ GetSystems~TSystem~()
        +TModel GetModel~TModel~()
        +IReadOnlyList~TModel~ GetModels~TModel~()
        +TUtility GetUtility~TUtility~()
        +IReadOnlyList~TUtility~ GetUtilities~TUtility~()
    }

    class TestArchitectureContextV3 {
        -IContainer _container
        +TService GetService~TService~()
        +IReadOnlyList~TService~ GetServices~TService~()
        +TSystem GetSystem~TSystem~()
        +IReadOnlyList~TSystem~ GetSystems~TSystem~()
        +TModel GetModel~TModel~()
        +IReadOnlyList~TModel~ GetModels~TModel~()
        +TUtility GetUtility~TUtility~()
        +IReadOnlyList~TUtility~ GetUtilities~TUtility~()
    }

    class IContainer {
        +T Get~T~()
        +IReadOnlyList~T~ GetAll~T~()
        +void Register~T~(T instance)
        +void RegisterSystem(ISystem system)
        +void Freeze()
        +void Clear()
    }

    IArchitectureContext <|.. ArchitectureContext
    IArchitectureContext <|.. TestArchitectureContext
    IArchitectureContext <|.. TestArchitectureContextV3

    ArchitectureContext o-- IContainer
    TestArchitectureContext o-- IContainer
    TestArchitectureContextV3 o-- IContainer

    class ISystem
    class IModel
    class IUtility
    class IEnvironment
    class IUnRegister
    class IRequest~TResponse~
    class INotification
    class IStreamRequest~TResponse~
    class ICommand
    class ICommand~TResult~
    class IAsyncCommand
    class IAsyncCommand~TResult~
    class IQuery~TResult~
    class IAsyncQuery~TResult~
    class Mediator_ICommand~TResponse~
    class Mediator_IQuery~TResponse~

    ArchitectureContext ..> ISystem
    ArchitectureContext ..> IModel
    ArchitectureContext ..> IUtility
    ArchitectureContext ..> IEnvironment
    ArchitectureContext ..> IRequest~TResponse~
    ArchitectureContext ..> INotification
    ArchitectureContext ..> IStreamRequest~TResponse~
    ArchitectureContext ..> ICommand
    ArchitectureContext ..> ICommand~TResult~
    ArchitectureContext ..> IAsyncCommand
    ArchitectureContext ..> IAsyncCommand~TResult~
    ArchitectureContext ..> IQuery~TResult~
    ArchitectureContext ..> IAsyncQuery~TResult~
    ArchitectureContext ..> Mediator_ICommand~TResponse~
    ArchitectureContext ..> Mediator_IQuery~TResponse~
Loading

上下文感知扩展重构的类图

classDiagram
    class IContextAware {
        +void SetContext(IArchitectureContext context)
        +IArchitectureContext GetContext()
    }

    class ContextAwareBase {
        -IArchitectureContext _context
        +void SetContext(IArchitectureContext context)
        +IArchitectureContext GetContext()
    }

    IContextAware <|.. ContextAwareBase

    class ContextAwareServiceExtensions {
        <<static>>
        +TService GetService~TService~(IContextAware contextAware)
        +TSystem GetSystem~TSystem~(IContextAware contextAware)
        +TModel GetModel~TModel~(IContextAware contextAware)
        +TUtility GetUtility~TUtility~(IContextAware contextAware)
        +IReadOnlyList~TService~ GetServices~TService~(IContextAware contextAware)
        +IReadOnlyList~TSystem~ GetSystems~TSystem~(IContextAware contextAware)
        +IReadOnlyList~TModel~ GetModels~TModel~(IContextAware contextAware)
        +IReadOnlyList~TUtility~ GetUtilities~TUtility~(IContextAware contextAware)
    }

    class ContextAwareEnvironmentExtensions {
        <<static>>
        +T GetEnvironment~T~(IContextAware contextAware)
        +IEnvironment GetEnvironment(IContextAware contextAware)
    }

    class ContextAwareEventExtensions {
        <<static>>
        +void SendEvent~TEvent~(IContextAware contextAware)
        +void SendEvent~TEvent~(IContextAware contextAware, TEvent e)
        +IUnRegister RegisterEvent~TEvent~(IContextAware contextAware, Action~TEvent~ handler)
        +void UnRegisterEvent~TEvent~(IContextAware contextAware, Action~TEvent~ onEvent)
    }

    class ContextAwareMediatorExtensions {
        <<static>>
        +ValueTask~TResponse~ SendRequestAsync~TResponse~(IContextAware contextAware, IRequest~TResponse~ request, CancellationToken cancellationToken)
        +TResponse SendRequest~TResponse~(IContextAware contextAware, IRequest~TResponse~ request)
        +ValueTask PublishAsync~TNotification~(IContextAware contextAware, TNotification notification, CancellationToken cancellationToken)
        +IAsyncEnumerable~TResponse~ CreateStream~TResponse~(IContextAware contextAware, IStreamRequest~TResponse~ request, CancellationToken cancellationToken)
        +ValueTask SendAsync~TCommand~(IContextAware contextAware, TCommand command, CancellationToken cancellationToken)
        +ValueTask~TResponse~ SendAsync~TResponse~(IContextAware contextAware, IRequest~TResponse~ command, CancellationToken cancellationToken)
    }

    class ContextAwareCommandExtensions {
        <<static>>
        +TResponse SendCommand~TResponse~(IContextAware contextAware, Mediator_ICommand~TResponse~ command)
        +TResult SendCommand~TResult~(IContextAware contextAware, ICommand~TResult~ command)
        +void SendCommand(IContextAware contextAware, ICommand command)
        +ValueTask~TResponse~ SendCommandAsync~TResponse~(IContextAware contextAware, Mediator_ICommand~TResponse~ command, CancellationToken cancellationToken)
        +Task SendCommandAsync(IContextAware contextAware, IAsyncCommand command)
        +Task~TResult~ SendCommandAsync~TResult~(IContextAware contextAware, IAsyncCommand~TResult~ command)
    }

    class ContextAwareQueryExtensions {
        <<static>>
        +TResponse SendQuery~TResponse~(IContextAware contextAware, Mediator_IQuery~TResponse~ query)
        +TResult SendQuery~TResult~(IContextAware contextAware, IQuery~TResult~ query)
        +ValueTask~TResponse~ SendQueryAsync~TResponse~(IContextAware contextAware, Mediator_IQuery~TResponse~ query, CancellationToken cancellationToken)
        +Task~TResult~ SendQueryAsync~TResult~(IContextAware contextAware, IAsyncQuery~TResult~ query)
    }

    class IArchitectureContext
    class IEnvironment
    class IEventBus {
        +void Publish~TEvent~(TEvent e)
        +IUnRegister Register~TEvent~(Action~TEvent~ handler)
        +void UnRegister~TEvent~(Action~TEvent~ handler)
    }

    class EventBus {
        +void Publish~TEvent~(TEvent e)
        +IUnRegister Register~TEvent~(Action~TEvent~ handler)
        +void UnRegister~TEvent~(Action~TEvent~ handler)
    }

    class IUnRegister {
        +void UnRegister()
    }

    class IRequest~TResponse~
    class IStreamRequest~TResponse~
    class Mediator_ICommand~TResponse~
    class Mediator_IQuery~TResponse~
    class ICommand
    class ICommand~TResult~
    class IAsyncCommand
    class IAsyncCommand~TResult~
    class IQuery~TResult~
    class IAsyncQuery~TResult~

    ContextAwareServiceExtensions ..> IContextAware
    ContextAwareServiceExtensions ..> IArchitectureContext

    ContextAwareEnvironmentExtensions ..> IContextAware
    ContextAwareEnvironmentExtensions ..> IArchitectureContext
    ContextAwareEnvironmentExtensions ..> IEnvironment

    ContextAwareEventExtensions ..> IContextAware
    ContextAwareEventExtensions ..> IArchitectureContext
    ContextAwareEventExtensions ..> IUnRegister

    ContextAwareMediatorExtensions ..> IContextAware
    ContextAwareMediatorExtensions ..> IArchitectureContext

    ContextAwareCommandExtensions ..> IContextAware
    ContextAwareCommandExtensions ..> IArchitectureContext

    ContextAwareQueryExtensions ..> IContextAware
    ContextAwareQueryExtensions ..> IArchitectureContext

    EventBus ..|> IEventBus

    ContextAwareBase o-- IArchitectureContext
Loading

文件级变更

Change Details Files
为架构上下文及其抽象添加用于服务、系统、模型和工具的批量检索 API。
  • 扩展 IArchitectureContext,新增 GetServices、GetSystems、GetModels 和 GetUtilities 泛型方法,返回 IReadOnlyList<T>,并施加合适的约束。
  • 在 ArchitectureContext 中实现新的批量检索方法,通过委托给底层 IoC 容器的 GetAll<T> 实现。
  • 更新测试用架构上下文实现,使其通过容器的 GetAll<T> 支持新的批量检索方法。
GFramework.Core.Abstractions/architecture/IArchitectureContext.cs
GFramework.Core/architecture/ArchitectureContext.cs
GFramework.Core.Tests/architecture/GameContextTests.cs
GFramework.Core.Tests/architecture/ArchitectureServicesTests.cs
引入 ContextAware* 扩展类以替换之前单一的 ContextAwareExtensions,覆盖服务、环境、事件、命令、查询以及 Mediator 操作。
  • 创建 ContextAwareServiceExtensions,用于从 IContextAware 中进行服务、系统、模型和工具的单个及批量检索。
  • 创建 ContextAwareEnvironmentExtensions,用于从 IContextAware 访问 IEnvironment 及泛型环境类型。
  • 创建 ContextAwareEventExtensions,用于通过 IContextAware 发送事件以及注册/取消注册事件处理器。
  • 创建 ContextAwareCommandExtensions 和 ContextAwareQueryExtensions,用于封装基于 Mediator 和自定义抽象的命令与查询发送逻辑,面向 IContextAware。
  • 创建 ContextAwareMediatorExtensions,通过 IContextAware 暴露 Mediator 风格的请求、通知、流以及命令相关 API。
  • 移除旧的聚合式 ContextAwareExtensions 文件,改用新的、关注点更集中的扩展类。
GFramework.Core/extensions/ContextAwareServiceExtensions.cs
GFramework.Core/extensions/ContextAwareEnvironmentExtensions.cs
GFramework.Core/extensions/ContextAwareEventExtensions.cs
GFramework.Core/extensions/ContextAwareCommandExtensions.cs
GFramework.Core/extensions/ContextAwareQueryExtensions.cs
GFramework.Core/extensions/ContextAwareMediatorExtensions.cs
GFramework.Core/extensions/ContextAwareExtensions.cs
添加针对新上下文感知扩展行为的单元测试,覆盖服务、环境与事件。
  • 添加 ContextAwareServiceExtensionsTests,用于验证已注册服务、系统、模型和工具的单个及批量检索行为,包括空结果场景。
  • 添加 ContextAwareEnvironmentExtensionsTests,用于验证环境检索及泛型转换行为,包括类型不匹配情况。
  • 添加 ContextAwareEventExtensionsTests,用于验证事件发送、处理器注册/取消注册,以及通过事件总线传递事件负载的行为。
GFramework.Core.Tests/rule/ContextAwareServiceExtensionsTests.cs
GFramework.Core.Tests/rule/ContextAwareEnvironmentExtensionsTests.cs
GFramework.Core.Tests/rule/ContextAwareEventExtensionsTests.cs

提示与命令

与 Sourcery 交互

  • 触发新的代码审查: 在 Pull Request 中评论 @sourcery-ai review
  • 继续讨论: 直接回复 Sourcery 的审查评论。
  • 从审查评论生成 GitHub Issue: 在某条审查评论下回复,要求 Sourcery 从该评论创建 Issue。也可以直接回复 @sourcery-ai issue 以从该评论创建 Issue。
  • 生成 Pull Request 标题: 在 Pull Request 标题中任意位置写入 @sourcery-ai 即可随时生成标题。也可以在 Pull Request 中评论 @sourcery-ai title 来(重新)生成标题。
  • 生成 Pull Request 总结: 在 Pull Request 描述正文中任意位置写入 @sourcery-ai summary 即可在对应位置生成 PR 总结。也可以在 Pull Request 中评论 @sourcery-ai summary 来(重新)生成总结。
  • 生成审查者指南: 在 Pull Request 中评论 @sourcery-ai guide,即可随时(重新)生成审查者指南。
  • 一次性解决所有 Sourcery 评论: 在 Pull Request 中评论 @sourcery-ai resolve,将标记所有 Sourcery 评论为已解决。如果你已经处理完所有评论且不希望再看到它们,这会很有用。
  • 驳回所有 Sourcery 审查: 在 Pull Request 中评论 @sourcery-ai dismiss,即可驳回所有现有的 Sourcery 审查。特别适用于你希望从一次全新的审查开始的情况——别忘了随后再评论 @sourcery-ai review 来触发新的审查!

自定义你的体验

访问你的 控制面板 以:

  • 启用或禁用诸如 Sourcery 自动生成的 Pull Request 总结、审查者指南等审查功能。
  • 更改审查语言。
  • 添加、删除或编辑自定义审查指令。
  • 调整其他审查相关设置。

获取帮助

Original review guide in English

Reviewer's Guide

Introduce batch retrieval APIs for architecture context components (services, systems, models, utilities), and refactor context-aware extension methods into focused extension classes with dedicated unit tests for services, environment access, and event handling.

Sequence diagram for batch retrieval via ContextAwareServiceExtensions.GetServices

sequenceDiagram
    actor Client
    participant ContextAwareObject
    participant ContextAwareServiceExtensions
    participant IArchitectureContext
    participant ArchitectureContext
    participant IContainer

    Client->>ContextAwareObject: Call GetServices~TestService~()
    ContextAwareObject->>ContextAwareServiceExtensions: GetServices~TestService~(this)
    ContextAwareServiceExtensions->>ContextAwareObject: GetContext()
    ContextAwareObject-->>ContextAwareServiceExtensions: IArchitectureContext
    ContextAwareServiceExtensions->>IArchitectureContext: GetServices~TestService~()
    IArchitectureContext->>ArchitectureContext: GetServices~TestService~()
    ArchitectureContext->>IContainer: GetAll~TestService~()
    IContainer-->>ArchitectureContext: IReadOnlyList~TestService~
    ArchitectureContext-->>IArchitectureContext: IReadOnlyList~TestService~
    IArchitectureContext-->>ContextAwareServiceExtensions: IReadOnlyList~TestService~
    ContextAwareServiceExtensions-->>ContextAwareObject: IReadOnlyList~TestService~
    ContextAwareObject-->>Client: IReadOnlyList~TestService~
Loading

Sequence diagram for event send and handler registration via ContextAwareEventExtensions

sequenceDiagram
    actor Client
    participant ContextAwareObject
    participant ContextAwareEventExtensions
    participant IArchitectureContext
    participant ArchitectureContext
    participant IEventBus

    Client->>ContextAwareObject: RegisterEvent~TestEvent~(handler)
    ContextAwareObject->>ContextAwareEventExtensions: RegisterEvent~TestEvent~(this, handler)
    ContextAwareEventExtensions->>ContextAwareObject: GetContext()
    ContextAwareObject-->>ContextAwareEventExtensions: IArchitectureContext
    ContextAwareEventExtensions->>IArchitectureContext: RegisterEvent~TestEvent~(handler)
    IArchitectureContext->>ArchitectureContext: RegisterEvent~TestEvent~(handler)
    ArchitectureContext->>IEventBus: Register~TestEvent~(handler)
    IEventBus-->>ArchitectureContext: IUnRegister
    ArchitectureContext-->>IArchitectureContext: IUnRegister
    IArchitectureContext-->>ContextAwareEventExtensions: IUnRegister
    ContextAwareEventExtensions-->>ContextAwareObject: IUnRegister
    ContextAwareObject-->>Client: IUnRegister

    Client->>ContextAwareObject: SendEvent(new TestEvent)
    ContextAwareObject->>ContextAwareEventExtensions: SendEvent~TestEvent~(this, event)
    ContextAwareEventExtensions->>ContextAwareObject: GetContext()
    ContextAwareObject-->>ContextAwareEventExtensions: IArchitectureContext
    ContextAwareEventExtensions->>IArchitectureContext: SendEvent~TestEvent~(event)
    IArchitectureContext->>ArchitectureContext: SendEvent~TestEvent~(event)
    ArchitectureContext->>IEventBus: Publish~TestEvent~(event)
    IEventBus-->>ArchitectureContext: Dispatch to handler
    ArchitectureContext-->>IArchitectureContext: return
    IArchitectureContext-->>ContextAwareEventExtensions: return
    ContextAwareEventExtensions-->>ContextAwareObject: return
    ContextAwareObject-->>Client: return
Loading

Class diagram for updated IArchitectureContext batch retrieval APIs

classDiagram
    class IArchitectureContext {
        +TService GetService~TService~()
        +IReadOnlyList~TService~ GetServices~TService~()
        +TSystem GetSystem~TSystem~()
        +IReadOnlyList~TSystem~ GetSystems~TSystem~()
        +TModel GetModel~TModel~()
        +IReadOnlyList~TModel~ GetModels~TModel~()
        +TUtility GetUtility~TUtility~()
        +IReadOnlyList~TUtility~ GetUtilities~TUtility~()
        +void SendEvent~TEvent~()
        +void SendEvent~TEvent~(TEvent e)
        +IUnRegister RegisterEvent~TEvent~(Action~TEvent~ handler)
        +void UnRegisterEvent~TEvent~(Action~TEvent~ handler)
        +IEnvironment GetEnvironment()
        +ValueTask~TResponse~ SendRequestAsync~TResponse~(IRequest~TResponse~ request, CancellationToken cancellationToken)
        +TResponse SendRequest~TResponse~(IRequest~TResponse~ request)
        +ValueTask PublishAsync~TNotification~(TNotification notification, CancellationToken cancellationToken)
        +IAsyncEnumerable~TResponse~ CreateStream~TResponse~(IStreamRequest~TResponse~ request, CancellationToken cancellationToken)
        +ValueTask SendAsync~TCommand~(TCommand command, CancellationToken cancellationToken)
        +ValueTask~TResponse~ SendAsync~TResponse~(IRequest~TResponse~ command, CancellationToken cancellationToken)
        +TResponse SendCommand~TResponse~(Mediator_ICommand~TResponse~ command)
        +TResult SendCommand~TResult~(ICommand~TResult~ command)
        +void SendCommand(ICommand command)
        +ValueTask~TResponse~ SendCommandAsync~TResponse~(Mediator_ICommand~TResponse~ command, CancellationToken cancellationToken)
        +Task SendCommandAsync(IAsyncCommand command)
        +Task~TResult~ SendCommandAsync~TResult~(IAsyncCommand~TResult~ command)
        +TResponse SendQuery~TResponse~(Mediator_IQuery~TResponse~ query)
        +TResult SendQuery~TResult~(IQuery~TResult~ query)
        +ValueTask~TResponse~ SendQueryAsync~TResponse~(Mediator_IQuery~TResponse~ query, CancellationToken cancellationToken)
        +Task~TResult~ SendQueryAsync~TResult~(IAsyncQuery~TResult~ query)
    }

    class ArchitectureContext {
        -IContainer _container
        +ArchitectureContext(IContainer container)
        +TService GetService~TService~()
        +IReadOnlyList~TService~ GetServices~TService~()
        +TSystem GetSystem~TSystem~()
        +IReadOnlyList~TSystem~ GetSystems~TSystem~()
        +TModel GetModel~TModel~()
        +IReadOnlyList~TModel~ GetModels~TModel~()
        +TUtility GetUtility~TUtility~()
        +IReadOnlyList~TUtility~ GetUtilities~TUtility~()
        +void SendEvent~TEvent~()
        +void SendEvent~TEvent~(TEvent e)
        +IUnRegister RegisterEvent~TEvent~(Action~TEvent~ handler)
        +void UnRegisterEvent~TEvent~(Action~TEvent~ handler)
        +IEnvironment GetEnvironment()
        +ValueTask~TResponse~ SendRequestAsync~TResponse~(IRequest~TResponse~ request, CancellationToken cancellationToken)
        +TResponse SendRequest~TResponse~(IRequest~TResponse~ request)
        +ValueTask PublishAsync~TNotification~(TNotification notification, CancellationToken cancellationToken)
        +IAsyncEnumerable~TResponse~ CreateStream~TResponse~(IStreamRequest~TResponse~ request, CancellationToken cancellationToken)
        +ValueTask SendAsync~TCommand~(TCommand command, CancellationToken cancellationToken)
        +ValueTask~TResponse~ SendAsync~TResponse~(IRequest~TResponse~ command, CancellationToken cancellationToken)
        +TResponse SendCommand~TResponse~(Mediator_ICommand~TResponse~ command)
        +TResult SendCommand~TResult~(ICommand~TResult~ command)
        +void SendCommand(ICommand command)
        +ValueTask~TResponse~ SendCommandAsync~TResponse~(Mediator_ICommand~TResponse~ command, CancellationToken cancellationToken)
        +Task SendCommandAsync(IAsyncCommand command)
        +Task~TResult~ SendCommandAsync~TResult~(IAsyncCommand~TResult~ command)
        +TResponse SendQuery~TResponse~(Mediator_IQuery~TResponse~ query)
        +TResult SendQuery~TResult~(IQuery~TResult~ query)
        +ValueTask~TResponse~ SendQueryAsync~TResponse~(Mediator_IQuery~TResponse~ query, CancellationToken cancellationToken)
        +Task~TResult~ SendQueryAsync~TResult~(IAsyncQuery~TResult~ query)
    }

    class TestArchitectureContext {
        -IContainer _container
        +TService GetService~TService~()
        +IReadOnlyList~TService~ GetServices~TService~()
        +TSystem GetSystem~TSystem~()
        +IReadOnlyList~TSystem~ GetSystems~TSystem~()
        +TModel GetModel~TModel~()
        +IReadOnlyList~TModel~ GetModels~TModel~()
        +TUtility GetUtility~TUtility~()
        +IReadOnlyList~TUtility~ GetUtilities~TUtility~()
    }

    class TestArchitectureContextV3 {
        -IContainer _container
        +TService GetService~TService~()
        +IReadOnlyList~TService~ GetServices~TService~()
        +TSystem GetSystem~TSystem~()
        +IReadOnlyList~TSystem~ GetSystems~TSystem~()
        +TModel GetModel~TModel~()
        +IReadOnlyList~TModel~ GetModels~TModel~()
        +TUtility GetUtility~TUtility~()
        +IReadOnlyList~TUtility~ GetUtilities~TUtility~()
    }

    class IContainer {
        +T Get~T~()
        +IReadOnlyList~T~ GetAll~T~()
        +void Register~T~(T instance)
        +void RegisterSystem(ISystem system)
        +void Freeze()
        +void Clear()
    }

    IArchitectureContext <|.. ArchitectureContext
    IArchitectureContext <|.. TestArchitectureContext
    IArchitectureContext <|.. TestArchitectureContextV3

    ArchitectureContext o-- IContainer
    TestArchitectureContext o-- IContainer
    TestArchitectureContextV3 o-- IContainer

    class ISystem
    class IModel
    class IUtility
    class IEnvironment
    class IUnRegister
    class IRequest~TResponse~
    class INotification
    class IStreamRequest~TResponse~
    class ICommand
    class ICommand~TResult~
    class IAsyncCommand
    class IAsyncCommand~TResult~
    class IQuery~TResult~
    class IAsyncQuery~TResult~
    class Mediator_ICommand~TResponse~
    class Mediator_IQuery~TResponse~

    ArchitectureContext ..> ISystem
    ArchitectureContext ..> IModel
    ArchitectureContext ..> IUtility
    ArchitectureContext ..> IEnvironment
    ArchitectureContext ..> IRequest~TResponse~
    ArchitectureContext ..> INotification
    ArchitectureContext ..> IStreamRequest~TResponse~
    ArchitectureContext ..> ICommand
    ArchitectureContext ..> ICommand~TResult~
    ArchitectureContext ..> IAsyncCommand
    ArchitectureContext ..> IAsyncCommand~TResult~
    ArchitectureContext ..> IQuery~TResult~
    ArchitectureContext ..> IAsyncQuery~TResult~
    ArchitectureContext ..> Mediator_ICommand~TResponse~
    ArchitectureContext ..> Mediator_IQuery~TResponse~
Loading

Class diagram for context-aware extension refactor

classDiagram
    class IContextAware {
        +void SetContext(IArchitectureContext context)
        +IArchitectureContext GetContext()
    }

    class ContextAwareBase {
        -IArchitectureContext _context
        +void SetContext(IArchitectureContext context)
        +IArchitectureContext GetContext()
    }

    IContextAware <|.. ContextAwareBase

    class ContextAwareServiceExtensions {
        <<static>>
        +TService GetService~TService~(IContextAware contextAware)
        +TSystem GetSystem~TSystem~(IContextAware contextAware)
        +TModel GetModel~TModel~(IContextAware contextAware)
        +TUtility GetUtility~TUtility~(IContextAware contextAware)
        +IReadOnlyList~TService~ GetServices~TService~(IContextAware contextAware)
        +IReadOnlyList~TSystem~ GetSystems~TSystem~(IContextAware contextAware)
        +IReadOnlyList~TModel~ GetModels~TModel~(IContextAware contextAware)
        +IReadOnlyList~TUtility~ GetUtilities~TUtility~(IContextAware contextAware)
    }

    class ContextAwareEnvironmentExtensions {
        <<static>>
        +T GetEnvironment~T~(IContextAware contextAware)
        +IEnvironment GetEnvironment(IContextAware contextAware)
    }

    class ContextAwareEventExtensions {
        <<static>>
        +void SendEvent~TEvent~(IContextAware contextAware)
        +void SendEvent~TEvent~(IContextAware contextAware, TEvent e)
        +IUnRegister RegisterEvent~TEvent~(IContextAware contextAware, Action~TEvent~ handler)
        +void UnRegisterEvent~TEvent~(IContextAware contextAware, Action~TEvent~ onEvent)
    }

    class ContextAwareMediatorExtensions {
        <<static>>
        +ValueTask~TResponse~ SendRequestAsync~TResponse~(IContextAware contextAware, IRequest~TResponse~ request, CancellationToken cancellationToken)
        +TResponse SendRequest~TResponse~(IContextAware contextAware, IRequest~TResponse~ request)
        +ValueTask PublishAsync~TNotification~(IContextAware contextAware, TNotification notification, CancellationToken cancellationToken)
        +IAsyncEnumerable~TResponse~ CreateStream~TResponse~(IContextAware contextAware, IStreamRequest~TResponse~ request, CancellationToken cancellationToken)
        +ValueTask SendAsync~TCommand~(IContextAware contextAware, TCommand command, CancellationToken cancellationToken)
        +ValueTask~TResponse~ SendAsync~TResponse~(IContextAware contextAware, IRequest~TResponse~ command, CancellationToken cancellationToken)
    }

    class ContextAwareCommandExtensions {
        <<static>>
        +TResponse SendCommand~TResponse~(IContextAware contextAware, Mediator_ICommand~TResponse~ command)
        +TResult SendCommand~TResult~(IContextAware contextAware, ICommand~TResult~ command)
        +void SendCommand(IContextAware contextAware, ICommand command)
        +ValueTask~TResponse~ SendCommandAsync~TResponse~(IContextAware contextAware, Mediator_ICommand~TResponse~ command, CancellationToken cancellationToken)
        +Task SendCommandAsync(IContextAware contextAware, IAsyncCommand command)
        +Task~TResult~ SendCommandAsync~TResult~(IContextAware contextAware, IAsyncCommand~TResult~ command)
    }

    class ContextAwareQueryExtensions {
        <<static>>
        +TResponse SendQuery~TResponse~(IContextAware contextAware, Mediator_IQuery~TResponse~ query)
        +TResult SendQuery~TResult~(IContextAware contextAware, IQuery~TResult~ query)
        +ValueTask~TResponse~ SendQueryAsync~TResponse~(IContextAware contextAware, Mediator_IQuery~TResponse~ query, CancellationToken cancellationToken)
        +Task~TResult~ SendQueryAsync~TResult~(IContextAware contextAware, IAsyncQuery~TResult~ query)
    }

    class IArchitectureContext
    class IEnvironment
    class IEventBus {
        +void Publish~TEvent~(TEvent e)
        +IUnRegister Register~TEvent~(Action~TEvent~ handler)
        +void UnRegister~TEvent~(Action~TEvent~ handler)
    }

    class EventBus {
        +void Publish~TEvent~(TEvent e)
        +IUnRegister Register~TEvent~(Action~TEvent~ handler)
        +void UnRegister~TEvent~(Action~TEvent~ handler)
    }

    class IUnRegister {
        +void UnRegister()
    }

    class IRequest~TResponse~
    class IStreamRequest~TResponse~
    class Mediator_ICommand~TResponse~
    class Mediator_IQuery~TResponse~
    class ICommand
    class ICommand~TResult~
    class IAsyncCommand
    class IAsyncCommand~TResult~
    class IQuery~TResult~
    class IAsyncQuery~TResult~

    ContextAwareServiceExtensions ..> IContextAware
    ContextAwareServiceExtensions ..> IArchitectureContext

    ContextAwareEnvironmentExtensions ..> IContextAware
    ContextAwareEnvironmentExtensions ..> IArchitectureContext
    ContextAwareEnvironmentExtensions ..> IEnvironment

    ContextAwareEventExtensions ..> IContextAware
    ContextAwareEventExtensions ..> IArchitectureContext
    ContextAwareEventExtensions ..> IUnRegister

    ContextAwareMediatorExtensions ..> IContextAware
    ContextAwareMediatorExtensions ..> IArchitectureContext

    ContextAwareCommandExtensions ..> IContextAware
    ContextAwareCommandExtensions ..> IArchitectureContext

    ContextAwareQueryExtensions ..> IContextAware
    ContextAwareQueryExtensions ..> IArchitectureContext

    EventBus ..|> IEventBus

    ContextAwareBase o-- IArchitectureContext
Loading

File-Level Changes

Change Details Files
Add batch retrieval APIs for services, systems, models, and utilities on the architecture context and its abstractions.
  • Extend IArchitectureContext with GetServices, GetSystems, GetModels, and GetUtilities generic methods returning IReadOnlyList with appropriate constraints.
  • Implement the new batch retrieval methods in ArchitectureContext by delegating to the underlying IoC container's GetAll.
  • Update test architecture context implementations to support the new batch retrieval methods using the container's GetAll.
GFramework.Core.Abstractions/architecture/IArchitectureContext.cs
GFramework.Core/architecture/ArchitectureContext.cs
GFramework.Core.Tests/architecture/GameContextTests.cs
GFramework.Core.Tests/architecture/ArchitectureServicesTests.cs
Introduce ContextAware* extension classes to replace the previous monolithic ContextAwareExtensions and cover services, environment, events, commands, queries, and mediator operations.
  • Create ContextAwareServiceExtensions for single and batch retrieval of services, systems, models, and utilities from IContextAware.
  • Create ContextAwareEnvironmentExtensions for accessing IEnvironment and typed environments from IContextAware.
  • Create ContextAwareEventExtensions for sending events and registering/unregistering event handlers via IContextAware.
  • Create ContextAwareCommandExtensions and ContextAwareQueryExtensions to wrap command and query sending (both Mediator-based and custom abstractions) for IContextAware.
  • Create ContextAwareMediatorExtensions to expose Mediator-style request, notification, stream, and command APIs through IContextAware.
  • Remove the old aggregated ContextAwareExtensions file in favor of the new, more focused extension classes.
GFramework.Core/extensions/ContextAwareServiceExtensions.cs
GFramework.Core/extensions/ContextAwareEnvironmentExtensions.cs
GFramework.Core/extensions/ContextAwareEventExtensions.cs
GFramework.Core/extensions/ContextAwareCommandExtensions.cs
GFramework.Core/extensions/ContextAwareQueryExtensions.cs
GFramework.Core/extensions/ContextAwareMediatorExtensions.cs
GFramework.Core/extensions/ContextAwareExtensions.cs
Add unit tests covering the new context-aware extension behaviors for services, environment, and events.
  • Add ContextAwareServiceExtensionsTests to verify single and batch retrieval of registered services, systems, models, and utilities, including empty results.
  • Add ContextAwareEnvironmentExtensionsTests to validate environment retrieval and generic casting behavior, including mismatch cases.
  • Add ContextAwareEventExtensionsTests to verify event sending, handler registration/unregistration, and event payload propagation via the event bus.
GFramework.Core.Tests/rule/ContextAwareServiceExtensionsTests.cs
GFramework.Core.Tests/rule/ContextAwareEnvironmentExtensionsTests.cs
GFramework.Core.Tests/rule/ContextAwareEventExtensionsTests.cs

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@deepsource-io

deepsource-io Bot commented Mar 4, 2026

Copy link
Copy Markdown

DeepSource Code Review

We reviewed changes in d88aa12...c1f50ba on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Code Review Summary

Analyzer Status Updated (UTC) Details
C# Mar 4, 2026 3:05p.m. Review ↗
Secrets Mar 4, 2026 3:05p.m. Review ↗

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - 我在这里给出了一些总体反馈:

  • 在同一个扩展类中同时使用 Mediator.ICommand/IQuery 和你自己的 Abstractions.command.ICommand/Abstractions.query.IQuery 有些让人困惑;可以考虑添加 using 别名,或者将 Mediator 专用的扩展拆分到单独的文件中,以便让调用位置和后续维护更清晰。
  • 在新的 ContextAware*Extensions 方法中,你多次通过 var context = contextAware.GetContext(); 获取上下文;你可以把这一逻辑提取到一个私有的小辅助方法中(例如 GetRequiredContext(this IContextAware)),以减少重复,并且明确 GetContext() 是否预期为非空。
给 AI Agents 的提示
Please address the comments from this code review:

## Overall Comments
- The coexistence of Mediator.ICommand/IQuery and your own Abstractions.command.ICommand/Abstractions.query.IQuery in the same extension classes is a bit confusing; consider adding using-aliases or splitting Mediator-specific extensions into separate files to make call sites and future maintenance clearer.
- In the new ContextAware*Extensions methods you repeatedly fetch the context via `var context = contextAware.GetContext();`; you could factor this into a small private helper (e.g. `GetRequiredContext(this IContextAware)`) to reduce duplication and make it explicit if `GetContext()` is expected to be non-null.

Sourcery 对开源项目免费——如果你觉得我们的评审对你有帮助,欢迎分享 ✨
帮我变得更有用!请在每条评论上点击 👍 或 👎,我会根据你的反馈改进之后的代码评审。
Original comment in English

Hey - I've left some high level feedback:

  • The coexistence of Mediator.ICommand/IQuery and your own Abstractions.command.ICommand/Abstractions.query.IQuery in the same extension classes is a bit confusing; consider adding using-aliases or splitting Mediator-specific extensions into separate files to make call sites and future maintenance clearer.
  • In the new ContextAware*Extensions methods you repeatedly fetch the context via var context = contextAware.GetContext();; you could factor this into a small private helper (e.g. GetRequiredContext(this IContextAware)) to reduce duplication and make it explicit if GetContext() is expected to be non-null.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The coexistence of Mediator.ICommand/IQuery and your own Abstractions.command.ICommand/Abstractions.query.IQuery in the same extension classes is a bit confusing; consider adding using-aliases or splitting Mediator-specific extensions into separate files to make call sites and future maintenance clearer.
- In the new ContextAware*Extensions methods you repeatedly fetch the context via `var context = contextAware.GetContext();`; you could factor this into a small private helper (e.g. `GetRequiredContext(this IContextAware)`) to reduce duplication and make it explicit if `GetContext()` is expected to be non-null.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

- 将原有的 ContextAwareCommandExtensions 中的 Mediator 相关方法分离到新的 ContextAwareMediatorCommandExtensions 类中
- 将原有的 ContextAwareQueryExtensions 中的 Mediator 相关方法分离到新的 ContextAwareMediatorQueryExtensions 类中
- 移除 ContextAwareCommandExtensions 中的异步命令方法 SendCommandAsync
- 移除 ContextAwareQueryExtensions 中的异步查询方法 SendQueryAsync
- 修复了 ContextAwareCommandExtensions 中的泛型类型参数引用问题
- 统一了代码格式和命名空间引用
- 保持了原有功能的向后兼容性
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant