mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-05-07 17:21:16 +08:00
31 lines
911 B
C#
31 lines
911 B
C#
// Copyright (c) 2025-2026 GeWuYou
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
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();
|
|
} |