/// <summary> /// Runs all <see cref="IMessageInterceptor" /> in the collection on the input, in reverse order /// </summary> /// <param name="input">The input.</param> /// <param name="graph">The graph.</param> /// <param name="headers">the message headers</param> /// <returns></returns> public byte[] BytesToMessage(byte[] input, MessageInterceptorsGraph graph, IReadOnlyDictionary <string, object> headers) { if (!graph.Types.Any()) //an empty graph means no interceptors where used { return(input); } var temp = graph.Types.Reverse(); return(temp.Select(GetInterceptor).Aggregate(input, (current, interceptor) => interceptor.BytesToMessage(current, headers))); }
/// <summary> /// Runs all <see cref="IMessageInterceptor" /> in the collection on the input, in reverse order /// </summary> /// <param name="input">The input.</param> /// <param name="graph">The graph.</param> /// <returns></returns> public byte[] BytesToMessage(byte[] input, MessageInterceptorsGraph graph) { if (!graph.Types.Any()) //an empty graph means no interceptors where used { return(input); } var temp = graph.Types.Reverse(); return(temp.Select(GetInterceptor).Aggregate(input, (current, interceptor) => interceptor.BytesToMessage(current))); }