示例#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);
        }
示例#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;
        }