山东雷驰
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
981 B

3 months ago
using Kean.Domain.Stock.Commands;
using Kean.Domain.Stock.Repositories;
using System.Threading;
using System.Threading.Tasks;
namespace Kean.Domain.Stock.CommandHandlers
{
/// <summary>
/// 命令处理程序
/// </summary>
public sealed class InterfaceRecordCommandHandler : CommandHandler<InterfaceRecordCommand>
{
private readonly IInterfaceRecordRepository _interfaceRecordRepository; // 存储仓库
/// <summary>
/// 依赖注入
/// </summary>
public InterfaceRecordCommandHandler(
IInterfaceRecordRepository interfaceRecordRepository)
{
_interfaceRecordRepository = interfaceRecordRepository;
}
/// <summary>
/// 处理程序
/// </summary>
public override async Task Handle(InterfaceRecordCommand command, CancellationToken cancellationToken)
{
await _interfaceRecordRepository.Append(command);
}
}
}