Example #1
0
 public static IQueryHandler <TQuery, TResult> GetQueryHandler <TQuery, TResult>(this IHandlerRegistry handlerRegistry)
     where TQuery : IQuery <TResult> => (IQueryHandler <TQuery, TResult>)handlerRegistry.GetQueryHandler(typeof(TQuery), typeof(TResult));
Example #2
0
 public ReflectedQueryHandler(Type queryType, IHandlerRegistry handlerRegistry)
 {
     handler      = handlerRegistry.GetQueryHandler(queryType, typeof(TResult));
     handleMethod = handler.GetType().GetMethod(nameof(IQueryHandler <IQuery <TResult>, TResult> .HandleAsync), BindingFlags.Public | BindingFlags.Instance);
 }