mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-03-22 10:34:30 +08:00
- 将 AbstractAsyncCommand 拆分为 AbstractAsyncCommand 和 AbstractAsyncCommandWithInput - 将 AbstractAsyncCommand<TInput, TResult> 移至新的 AbstractAsyncCommandWithResult 类 - 将 AbstractCommand 拆分为 AbstractCommand 和 AbstractCommandWithInput - 将 AbstractCommand<TInput, TResult> 移至新的 AbstractCommandWithResult 类 - 将 AbstractAsyncQuery 简化为不带输入参数的版本 - 将 AbstractQuery 简化为不带输入参数的版本 - 创建新的 AbstractAsyncQueryWithResult 类处理带输入参数的异步查询 - 创建新的 AbstractQueryWithResult 类处理带输入参数的同步查询
23 lines
644 B
C#
23 lines
644 B
C#
using GFramework.Core.Abstractions.command;
|
|
using GFramework.Core.rule;
|
|
|
|
namespace GFramework.Core.command;
|
|
|
|
/// <summary>
|
|
/// 抽象命令类,实现 ICommand 接口,为具体命令提供基础架构支持
|
|
/// </summary>
|
|
public abstract class AbstractCommand : ContextAwareBase, ICommand
|
|
{
|
|
/// <summary>
|
|
/// 执行命令的入口方法,实现 ICommand 接口的 Execute 方法
|
|
/// </summary>
|
|
void ICommand.Execute()
|
|
{
|
|
OnExecute();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 命令执行的抽象方法,由派生类实现具体的命令逻辑
|
|
/// </summary>
|
|
protected abstract void OnExecute();
|
|
} |