public BusBuilder SubscribeToCommand <TCommand>() where TCommand : ICommand { var handler = (ICommandHandler <TCommand>)_webHost.Services .GetService(typeof(ICommandHandler <TCommand>)); // we'll invoke a special extension method, and let's just say we'll create // an extension method called WithCommandHandlerAsync, and provide our handler like this _bus.WithCommandHanlderAsync(handler); return(this); }