refactor(core): 移除废弃的同步命令查询扩展方法并简化类型引用#81
Merged
Conversation
- 移除了 ContextAwareCommandExtensions 中废弃的 SendCommand 同步方法 - 移除了 ContextAwareQueryExtensions 中废弃的 SendQuery 同步方法 - 简化了 ICommand 和 IQuery 的类型引用,移除冗长的命名空间前缀 - 保持了异步命令和查询方法的功能完整性
审查者指南(在小型 PR 中折叠显示)审查者指南此 PR 删除了已弃用的、基于 Mediator 的同步命令/查询扩展方法,并简化了命令/查询抽象中类型引用的写法,同时保留了现有的异步 API 和未弃用的同步 API。 重构前:支持上下文感知命令/查询扩展的类图classDiagram
class IContextAware {
+GetContext() IContext
}
class IContext {
+SendCommand_TResponse(command Mediator_ICommand_TResponse) TResponse
+SendCommand_TResult(command Abstractions_command_ICommand_TResult) TResult
+SendCommand(command Abstractions_command_ICommand) void
+SendQuery_TResponse(query Mediator_IQuery_TResponse) TResponse
+SendQuery_TResult(query Abstractions_query_IQuery_TResult) TResult
}
class Mediator_ICommand_TResponse {
<<interface>>
}
class Mediator_IQuery_TResponse {
<<interface>>
}
class Abstractions_command_ICommand_TResult {
<<interface>>
}
class Abstractions_command_ICommand {
<<interface>>
}
class Abstractions_query_IQuery_TResult {
<<interface>>
}
class ContextAwareCommandExtensions {
+SendCommand_TResponse(contextAware IContextAware, command Mediator_ICommand_TResponse) TResponse
+SendCommand_TResult(contextAware IContextAware, command Abstractions_command_ICommand_TResult) TResult
+SendCommand(contextAware IContextAware, command Abstractions_command_ICommand) void
}
class ContextAwareQueryExtensions {
+SendQuery_TResponse(contextAware IContextAware, query Mediator_IQuery_TResponse) TResponse
+SendQuery_TResult(contextAware IContextAware, query Abstractions_query_IQuery_TResult) TResult
}
IContextAware --> IContext
ContextAwareCommandExtensions ..> IContextAware
ContextAwareCommandExtensions ..> Mediator_ICommand_TResponse
ContextAwareCommandExtensions ..> Abstractions_command_ICommand_TResult
ContextAwareCommandExtensions ..> Abstractions_command_ICommand
ContextAwareQueryExtensions ..> IContextAware
ContextAwareQueryExtensions ..> Mediator_IQuery_TResponse
ContextAwareQueryExtensions ..> Abstractions_query_IQuery_TResult
IContext ..> Mediator_ICommand_TResponse
IContext ..> Abstractions_command_ICommand_TResult
IContext ..> Abstractions_command_ICommand
IContext ..> Mediator_IQuery_TResponse
IContext ..> Abstractions_query_IQuery_TResult
重构后:支持上下文感知命令/查询扩展的更新类图classDiagram
class IContextAware {
+GetContext() IContext
}
class IContext {
+SendCommand_TResult(command ICommand_TResult) TResult
+SendCommand(command ICommand) void
+SendQuery_TResult(query IQuery_TResult) TResult
}
class ICommand_TResult {
<<interface>>
}
class ICommand {
<<interface>>
}
class IQuery_TResult {
<<interface>>
}
class ContextAwareCommandExtensions {
+SendCommand_TResult(contextAware IContextAware, command ICommand_TResult) TResult
+SendCommand(contextAware IContextAware, command ICommand) void
}
class ContextAwareQueryExtensions {
+SendQuery_TResult(contextAware IContextAware, query IQuery_TResult) TResult
}
IContextAware --> IContext
ContextAwareCommandExtensions ..> IContextAware
ContextAwareCommandExtensions ..> ICommand_TResult
ContextAwareCommandExtensions ..> ICommand
ContextAwareQueryExtensions ..> IContextAware
ContextAwareQueryExtensions ..> IQuery_TResult
IContext ..> ICommand_TResult
IContext ..> ICommand
IContext ..> IQuery_TResult
文件级变更
提示与命令与 Sourcery 交互
自定义你的使用体验打开你的 控制台/仪表盘 来:
获取帮助Original review guide in EnglishReviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR removes deprecated synchronous Mediator-based command/query extension methods and simplifies type references for command/query abstractions while preserving the existing async and non-deprecated sync APIs. Class diagram for context-aware command/query extensions before refactorclassDiagram
class IContextAware {
+GetContext() IContext
}
class IContext {
+SendCommand_TResponse(command Mediator_ICommand_TResponse) TResponse
+SendCommand_TResult(command Abstractions_command_ICommand_TResult) TResult
+SendCommand(command Abstractions_command_ICommand) void
+SendQuery_TResponse(query Mediator_IQuery_TResponse) TResponse
+SendQuery_TResult(query Abstractions_query_IQuery_TResult) TResult
}
class Mediator_ICommand_TResponse {
<<interface>>
}
class Mediator_IQuery_TResponse {
<<interface>>
}
class Abstractions_command_ICommand_TResult {
<<interface>>
}
class Abstractions_command_ICommand {
<<interface>>
}
class Abstractions_query_IQuery_TResult {
<<interface>>
}
class ContextAwareCommandExtensions {
+SendCommand_TResponse(contextAware IContextAware, command Mediator_ICommand_TResponse) TResponse
+SendCommand_TResult(contextAware IContextAware, command Abstractions_command_ICommand_TResult) TResult
+SendCommand(contextAware IContextAware, command Abstractions_command_ICommand) void
}
class ContextAwareQueryExtensions {
+SendQuery_TResponse(contextAware IContextAware, query Mediator_IQuery_TResponse) TResponse
+SendQuery_TResult(contextAware IContextAware, query Abstractions_query_IQuery_TResult) TResult
}
IContextAware --> IContext
ContextAwareCommandExtensions ..> IContextAware
ContextAwareCommandExtensions ..> Mediator_ICommand_TResponse
ContextAwareCommandExtensions ..> Abstractions_command_ICommand_TResult
ContextAwareCommandExtensions ..> Abstractions_command_ICommand
ContextAwareQueryExtensions ..> IContextAware
ContextAwareQueryExtensions ..> Mediator_IQuery_TResponse
ContextAwareQueryExtensions ..> Abstractions_query_IQuery_TResult
IContext ..> Mediator_ICommand_TResponse
IContext ..> Abstractions_command_ICommand_TResult
IContext ..> Abstractions_command_ICommand
IContext ..> Mediator_IQuery_TResponse
IContext ..> Abstractions_query_IQuery_TResult
Updated class diagram for context-aware command/query extensions after refactorclassDiagram
class IContextAware {
+GetContext() IContext
}
class IContext {
+SendCommand_TResult(command ICommand_TResult) TResult
+SendCommand(command ICommand) void
+SendQuery_TResult(query IQuery_TResult) TResult
}
class ICommand_TResult {
<<interface>>
}
class ICommand {
<<interface>>
}
class IQuery_TResult {
<<interface>>
}
class ContextAwareCommandExtensions {
+SendCommand_TResult(contextAware IContextAware, command ICommand_TResult) TResult
+SendCommand(contextAware IContextAware, command ICommand) void
}
class ContextAwareQueryExtensions {
+SendQuery_TResult(contextAware IContextAware, query IQuery_TResult) TResult
}
IContextAware --> IContext
ContextAwareCommandExtensions ..> IContextAware
ContextAwareCommandExtensions ..> ICommand_TResult
ContextAwareCommandExtensions ..> ICommand
ContextAwareQueryExtensions ..> IContextAware
ContextAwareQueryExtensions ..> IQuery_TResult
IContext ..> ICommand_TResult
IContext ..> ICommand
IContext ..> IQuery_TResult
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
|
Overall Grade |
Security Reliability Complexity Hygiene |
Code Review Summary
| Analyzer | Status | Updated (UTC) | Details |
|---|---|---|---|
| C# | Mar 5, 2026 2:47p.m. | Review ↗ | |
| Secrets | Mar 5, 2026 2:47p.m. | Review ↗ |
This was referenced Mar 15, 2026
This was referenced May 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary by Sourcery
移除已弃用的、支持上下文的 Mediator 同步命令/查询辅助方法,并简化命令/查询类型的使用。
增强内容:
SendCommand和SendQuery。ICommand和IQuery的引用。Original summary in English
Summary by Sourcery
Remove deprecated context-aware Mediator sync command/query helpers and simplify command/query type usage.
Enhancements: