Scratch working of registering Mediator QueryHandlers using the Query type interface, not their actual type. Why? Because the Query implementations could/should be view models that are Web specific however the contract doesn't care about any of the crap that may be on that type.
If we declare and implementation to have :
IQueryHandler<IQuery<CustomerSummary[]>, CustomerSummary[]>,
then when we call
public ActionResult Index(ClientListQuery query)
{
var customers = Mediator.Request(query);
return View(customers.Data);
}
it wont resolve because
typeof(ClientListQuery) != typeof(IQuery<CustomerSummary[]>)
however ClientListQuery DOES implement implements IQuery<CustomerSummary[]>.
This gist solves that issue (note will need to repeat for commands)