コード例 #1
0
ファイル: MiddlewareExtensions.cs プロジェクト: virajs/Cronus
 /// <summary>
 /// Adds the next middleware in the execution chain
 /// </summary>
 /// <typeparam name="TContext">The context</typeparam>
 /// <typeparam name="TResult">The result</typeparam>
 /// <param name="self">The current middleware</param>
 /// <param name="action">The action which will be executed after the current middleware</param>
 /// <returns></returns>
 public static Middleware <TContext, TResult> Use <TContext, TResult>(this Middleware <TContext, TResult> self, Func <Execution <TContext>, TResult> action)
 {
     self.Use(new SimpleMiddleware <TContext, TResult>(action));
     return(self);
 }
コード例 #2
0
ファイル: MiddlewareExtensions.cs プロジェクト: virajs/Cronus
 /// <summary>
 /// Adds the next middleware in the execution chain
 /// </summary>
 /// <typeparam name="TContext">The context</typeparam>
 /// <param name="self">The current middleware</param>
 /// <param name="action">The action which will be executed after the current middleware</param>
 /// <returns></returns>
 public static Middleware <TContext> Use <TContext>(this Middleware <TContext> self, Action <Execution <TContext> > action)
 {
     self.Use(new SimpleMiddleware <TContext>(action));
     return(self);
 }