CQRSMicroservices.Framework.CommandBus.Dispatch C# (CSharp) Method

Dispatch() public method

public Dispatch ( Command command ) : System.Threading.Tasks.Task
command Command
return System.Threading.Tasks.Task
    public async Task Dispatch(Command command)
    {
      CommandHandler handler;
      if(_handlers.TryGetValue(command.GetType(), out handler))
      {
        await handler.Handle(command);
      }
      else
      {
        throw new NotImplementedException($"No handler for commandtype {command.GetType().FullName}");
      }
    }