Ejemplo n.º 1
0
        public static AsyncProcessDelegate GetMiddlewareChain(AsyncProcessToNextDelegate asyncProcessToNext, AsyncProcessDelegate asyncNext)
        {
            if ((object)asyncProcessToNext == null)
            {
                throw new ArgumentNullException(nameof(asyncProcessToNext));
            }

            if ((object)asyncNext == null)
            {
                throw new ArgumentNullException(nameof(asyncNext));
            }

            return(new AsyncProcessorClosure(asyncProcessToNext, asyncNext).TransformAsync);
        }
Ejemplo n.º 2
0
        private AsyncProcessorClosure(AsyncProcessToNextDelegate asyncProcessToNext, AsyncProcessDelegate asyncNext)
        {
            if ((object)asyncProcessToNext == null)
            {
                throw new ArgumentNullException(nameof(asyncProcessToNext));
            }

            if ((object)asyncNext == null)
            {
                throw new ArgumentNullException(nameof(asyncNext));
            }

            this.asyncProcessToNext = asyncProcessToNext;
            this.asyncNext          = asyncNext;
        }