Example #1
0
    public async Task SendAsync(ICommand command, CancellationToken cancellationToken = default)
    {
        var mediationStrategy = new SingleAsyncHandlerMediationStrategy<ICommand>(cancellationToken);

        var findStrategy = new ActualTypeOrFirstAssignableTypeMessageResolveStrategy();

        await _messageMediator.Mediate(command, findStrategy, mediationStrategy);
    }
Example #2
0
    public Task <TQueryResult> QueryAsync <TQueryResult>(IQuery <TQueryResult> query,
                                                         CancellationToken cancellationToken = default)
    {
        var mediationStrategy =
            new SingleAsyncHandlerMediationStrategy <IQuery <TQueryResult>, TQueryResult>(cancellationToken);

        var findStrategy = new ActualTypeOrFirstAssignableTypeMessageResolveStrategy();

        return(_messageMediator.Mediate(query, findStrategy, mediationStrategy));
    }