コード例 #1
0
    public async Task HandleAsync <TCommand>(TCommand command, CancellationToken cancellationToken)
        where TCommand : ICommand
    {
        var service = _serviceProvider.GetRequiredService <ICommandHandler <TCommand> >();
        await service.HandleAsync(command, cancellationToken);

        await _persistenceManager.SaveChangesAsync(cancellationToken);
    }