Пример #1
0
        /// <summary>
        /// 创建查询链
        /// </summary>
        private QueryMiddleware <TArgs, TResult> BuildUp()
        {
            List <Tuple <Type, object[]> > reversedParams;

            lock (_middlewareParams)
                reversedParams = Enumerable.Reverse(_middlewareParams).ToList();

            QueryMiddleware <TArgs, TResult> lastMiddleware = null;

            foreach (var param in reversedParams)
            {
                lastMiddleware = (QueryMiddleware <TArgs, TResult>)ActivatorUtilities.CreateInstance(_serviceProvider, param.Item1, lastMiddleware, param.Item2);
            }
            return(lastMiddleware);
        }
Пример #2
0
 public QueryMiddleware(QueryMiddleware <TArgs, TResult> next)
 {
     Next = next;
 }