GFramework/GFramework.Core/Command/AbstractAsyncCommand.cs
GeWuYou 23489570bf fix(analyzers): 降低 Core、Cqrs、Godot 与生成器的构建警告
- 清理 GFramework.Core 与 GFramework.Cqrs 中的大量低风险 Meziantou 警告

- 修复 GFramework.Godot 运行时中的 ConfigureAwait、StringComparison 与参数校验告警

- 调整 Core SourceGenerators 中的字符串比较、文件命名与局部长方法问题

- 拆分部分配置与缓存辅助类型文件以消除 file/type mismatch 告警

- 更新 warning reduction 跟踪与执行记录,保留下一批结构性告警的恢复点
2026-04-18 16:47:44 +08:00

29 lines
945 B
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using GFramework.Core.Abstractions.Command;
using GFramework.Core.Rule;
namespace GFramework.Core.Command;
/// <summary>
/// 异步命令的抽象基类实现了IAsyncCommand接口
/// 提供异步命令执行的基础框架和上下文感知功能
/// </summary>
public abstract class AbstractAsyncCommand : ContextAwareBase, IAsyncCommand
{
/// <summary>
/// 执行异步命令的实现方法
/// 该方法通过调用受保护的抽象方法OnExecuteAsync来执行具体的命令逻辑
/// </summary>
/// <returns>表示异步操作的任务</returns>
async Task IAsyncCommand.ExecuteAsync()
{
await OnExecuteAsync().ConfigureAwait(false);
}
/// <summary>
/// 子类必须实现的异步执行方法
/// 包含具体的命令执行逻辑
/// </summary>
/// <returns>表示异步操作的任务</returns>
protected abstract Task OnExecuteAsync();
}