Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
25 lines (21 sloc) 829 Bytes
using System.Threading.Tasks;
using DShop.Common.Types;
using DShop.Common.Messages;
namespace DShop.Common.Dispatchers
{
public class Dispatcher : IDispatcher
{
private readonly ICommandDispatcher _commandDispatcher;
private readonly IQueryDispatcher _queryDispatcher;
public Dispatcher(ICommandDispatcher commandDispatcher,
IQueryDispatcher queryDispatcher)
{
_commandDispatcher = commandDispatcher;
_queryDispatcher = queryDispatcher;
}
public async Task SendAsync<TCommand>(TCommand command) where TCommand : ICommand
=> await _commandDispatcher.SendAsync(command);
public async Task<TResult> QueryAsync<TResult>(IQuery<TResult> query)
=> await _queryDispatcher.QueryAsync<TResult>(query);
}
}