/// <summary>
 /// Specifies expression describing your interface lookup rules for handlers and messages.
 /// Defaults to <code><![CDATA[HandlerSample<IConsume<IMessage>>(h => h.Consume(null))]]></code>
 /// </summary>
 /// <typeparam name="THandler">The base type of the handler.</typeparam>
 /// <param name="handlerSampleExpression">The handler sample expression.</param>
 public void HandlerSample <THandler>(Expression <Action <THandler> > handlerSampleExpression)
 {
     if (handlerSampleExpression == null)
     {
         throw new ArgumentNullException("handlerSampleExpression");
     }
     _hint = MethodInvokerHint.FromConsumerSample(handlerSampleExpression);
 }
 public void Constrain(MethodInvokerHint hint)
 {
     WhereMessages(t => hint.MessageInterface.IsAssignableFrom(t));
     WhereConsumers(type => type.GetInterfaces().Where(i => i.IsGenericType)
                    .Any(i => i.GetGenericTypeDefinition() == hint.ConsumerTypeDefinition));
 }