Ejemplo n.º 1
0
        private IImmutableQueue <TimeSpan> SafeTimedCall(Action action)
        {
            var timingContext = new TimingContext(this.bundle.TimingVisibility);

            this.bundle.Errors.DoInContext(_ =>
            {
                timingContext.OpenAs(this.bundle.Visibility, action);
            });

            return(timingContext.EnqueueElapsed(this.callTimings));
        }
Ejemplo n.º 2
0
        public IBoilerplateContext <TResult> Get(Func <IBoilerplateContext, TResult> action)
        {
            return(VerifyContractIfPossible(this.Identity,
                                            () =>
            {
                var downgradedContext = DowngradeToInitial();

                var timingContext = new TimingContext(this.bundle.TimingVisibility);

                TResult result = default(TResult);
                this.bundle.Errors.DoInContext(_ =>
                {
                    timingContext.OpenAs(this.bundle.Visibility, () => result = action(downgradedContext));
                });

                var timings = timingContext.EnqueueElapsed(this.callTimings);

                return MergeCopy(result: result, callTimings: timings);
            }));
        }