Пример #1
0
 public static IEnumerable <IQueryHandlerWrapper <TQuery, TResult> > GetQueryHandlerWrappers <TQuery, TResult>(this IHandlerRegistry handlerRegistry)
     where TQuery : IQuery <TResult> => handlerRegistry.GetQueryHandlerWrappers(typeof(TQuery), typeof(TResult)).Cast <IQueryHandlerWrapper <TQuery, TResult> >();
Пример #2
0
 public ReflectedQueryHandlerWrappers(Type queryType, IHandlerRegistry handlerRegistry)
 {
     wrappers     = handlerRegistry.GetQueryHandlerWrappers(queryType, typeof(TResult));
     handleMethod = typeof(IQueryHandlerWrapper <,>).MakeGenericType(queryType, typeof(TResult))
                    .GetMethod(nameof(IQueryHandlerWrapper <IQuery <TResult>, TResult> .HandleAsync), BindingFlags.Public | BindingFlags.Instance);
 }