public IAsyncMessageHandler <TMessage> CreateAsyncMessageHandler <TMessage>(IAsyncMessageHandler <TMessage> handler, AsyncMessageHandlerFilter <TMessage>[] filters) { var(globalLength, globalFilters) = options.GetGlobalAsyncMessageHandlerFilters(provider, typeof(TMessage)); var(handlerLength, handlerFilters) = filterProvider.GetAttributeFilters(handler.GetType(), provider); if (filters.Length != 0 || globalLength != 0 || handlerLength != 0) { handler = new FilterAttachedAsyncMessageHandler <TMessage>(handler, globalFilters.Concat(handlerFilters).Concat(filters).Cast <AsyncMessageHandlerFilter <TMessage> >()); } return(handler); }
public IAsyncRequestHandlerCore <TRequest, TResponse> CreateAsyncRequestHandler <TRequest, TResponse>(IAsyncRequestHandlerCore <TRequest, TResponse> handler) { var(globalLength, globalFilters) = options.GetGlobalAsyncRequestHandlerFilters(provider, typeof(TRequest), typeof(TResponse)); var(handlerLength, handlerFilters) = filterProvider.GetAttributeFilters(handler.GetType(), provider); if (globalLength != 0 || handlerLength != 0) { handler = new FilterAttachedAsyncRequestHandler <TRequest, TResponse>(handler, globalFilters.Concat(handlerFilters).Cast <AsyncRequestHandlerFilter <TRequest, TResponse> >()); } return(handler); }