/// <summary> /// Adds the given <paramref name="binder"/> to this Try's call sequence. /// </summary> public AsyncTry <U> Then <U>(Func <U> binder) { TryThrowHelper.VerifyBinderNotNull(binder); var frame = new AsyncTryFrame(TryFrameType.Action, async x => binder(), null); return(new AsyncTry <U>(Frames.Add(frame))); }
/// <summary> /// Adds the given <paramref name="binder"/> to this Try's call sequence. /// </summary> public AsyncTry <U> ThenAsync <U>(Func <Task <U> > binder) { TryThrowHelper.VerifyBinderNotNull(binder); var frame = new AsyncTryFrame(TryFrameType.Action, async x => await binder().ConfigureAwait(false), null); return(new AsyncTry <U>(Frames.Add(frame))); }
internal AsyncTry(Func <Task <T> > action) { var frame = new AsyncTryFrame(TryFrameType.Action, async _ => await action().ConfigureAwait(false), null); _frames = AsyncTryFrames.Empty.Add(frame); }