A Pen by Captain Anonymous on CodePen.
This file contains 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
var Provider = new RequestLifetimeScopeProvider(AutofacContainer.RootScope.Value, null); | |
AutofacServiceStackAdapter.ScopeProvider = Provider; |
Forked from Captain Anonymous's Pen bNPbwE.
A Pen by Brandon Smith on CodePen.
This file contains 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
public static Task<TNewResult> ContinueWithTask<TContinue, TNewResult>(this Task<TContinue> task, Func<Task<TContinue>, Task<TNewResult>> Continuation, CancellationToken CancellationToken) | |
{ | |
var Completion = new TaskCompletionSource<TNewResult>(); | |
task.ContinueWith(t => | |
{ | |
if (CancellationToken.IsCancellationRequested) | |
{ | |
Completion.SetCanceled(); | |
return; | |
} |