Created
November 29, 2013 20:26
-
-
Save beyond-code-github/7711463 to your computer and use it in GitHub Desktop.
Sub-pipeline example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if (routeData.Pipeline.Any()) | |
| { | |
| IAppBuilder branch = builder.New(); | |
| foreach (var middleware in routeData.Pipeline) | |
| { | |
| branch.Use(middleware); | |
| } | |
| branch.Use(typeof(RedirectMiddleware), this.next); | |
| var continuation = (Func<IDictionary<string, object>, Task>)branch.Build(typeof(Func<IDictionary<string, object>, Task>)); | |
| await continuation(environment); | |
| } | |
| else | |
| { | |
| await this.next(environment); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment