mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-03-22 10:34:30 +08:00
- 移除重复的SendCommand同步方法实现 - 统一Context变量命名规范,修复大小写不一致问题 - 调整方法顺序并重新组织代码结构 - 完善IAsyncCommand接口的XML文档注释 - 优化异步命令执行的实现逻辑
29 lines
850 B
C#
29 lines
850 B
C#
using System.Threading.Tasks;
|
|
using GFramework.Core.Abstractions.rule;
|
|
|
|
namespace GFramework.Core.Abstractions.command;
|
|
|
|
/// <summary>
|
|
/// 表示一个异步命令接口,该命令不返回结果
|
|
/// </summary>
|
|
public interface IAsyncCommand : IContextAware
|
|
{
|
|
/// <summary>
|
|
/// 异步执行命令
|
|
/// </summary>
|
|
/// <returns>表示异步操作的任务</returns>
|
|
Task ExecuteAsync();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 表示一个异步命令接口,该命令返回指定类型的结果
|
|
/// </summary>
|
|
/// <typeparam name="TResult">命令执行结果的类型</typeparam>
|
|
public interface IAsyncCommand<TResult> : IContextAware
|
|
{
|
|
/// <summary>
|
|
/// 异步执行命令并返回结果
|
|
/// </summary>
|
|
/// <returns>表示异步操作的任务,任务结果为命令执行的返回值</returns>
|
|
Task<TResult> ExecuteAsync();
|
|
} |