예제 #1
0
 /// <inheritdoc />
 public void AppendStepsInto <TContext>(IPipeline <TContext> pipeline) where TContext : class
 {
     foreach (var stepType in GetStepTypes())
     {
         pipeline.Append(
             _serviceProvider.GetService <IStep <TContext> >(
                 stepType,
                 _ => new PoezdConfigurationException(
                     $"Can not find a step of type '{stepType.FullName}'. You should register this step type in your DI-container.")));
     }
 }
예제 #2
0
 /// <summary>
 ///  指定された処理を表すデリゲートを指定されたパイプラインの末尾に追加します。
 /// </summary>
 /// <typeparam name="TParam">追加する処理の引数の種類です。</typeparam>
 /// <typeparam name="TResult">追加する処理の戻り値の種類です。</typeparam>
 /// <param name="pipeline">登録先のパイプラインです。</param>
 /// <param name="processFunc">追加する処理です。</param>
 /// <returns>
 ///  <paramref name="pipeline"/>そのもの、または、
 ///  指定された処理が追加された新しい<paramref name="pipeline"/>のコピーです。
 /// </returns>
 /// <exception cref="System.ArgumentNullException" />
 public static IPipeline Append <TParam, TResult>(this IPipeline pipeline, ProcessFunc <TParam, TResult> processFunc)
 {
     if (pipeline == null)
     {
         throw new ArgumentNullException(nameof(pipeline));
     }
     if (processFunc == null)
     {
         throw new ArgumentNullException(nameof(processFunc));
     }
     return(pipeline.Append(new ProcessFuncWrapper <TParam, TResult>(processFunc)));
 }