示例#1
0
        /// <summary>
        /// Adds the given <paramref name="binder"/> to this Try's call-sequence.
        /// </summary>
        public Try <U> Then <U>(Func <U> binder)
        {
            TryThrowHelper.VerifyBinderNotNull(binder);

            var frame = new SyncTryFrame(TryFrameType.Action, _ => binder(), null);

            return(new Try <U>(Frames.Add(frame)));
        }
示例#2
0
        internal Try(Func <T> action)
        {
            var frame = new SyncTryFrame(TryFrameType.Action, _ => action(), null);

            _frames = SyncTryFrames.Empty.Add(frame);
        }