コード例 #1
0
        public async ValueTask OnMethodBeginAsync(ConsoleAppContext context)
        {
            var exceptions = new AggregateExceptionHolder();

            foreach (var item in interceptors)
            {
                try
                {
                    await item.OnMethodBeginAsync(context);
                }
                catch (Exception e)
                {
                    exceptions.Add(e);
                }
            }
            exceptions.ThrowIfExists();
        }
コード例 #2
0
        public async ValueTask OnEngineCompleteAsync(ConsoleAppContext context, string?errorMessageIfFailed, Exception?exceptionIfExists)
        {
            var exceptions = new AggregateExceptionHolder();

            foreach (var item in interceptors)
            {
                try
                {
                    await item.OnEngineCompleteAsync(context, errorMessageIfFailed, exceptionIfExists);
                }
                catch (Exception e)
                {
                    exceptions.Add(e);
                }
            }
            exceptions.ThrowIfExists();
        }
コード例 #3
0
        public async ValueTask OnEngineBeginAsync(IServiceProvider serviceProvider, ILogger <ConsoleAppEngine> logger)
        {
            var exceptions = new AggregateExceptionHolder();

            foreach (var item in interceptors)
            {
                try
                {
                    await item.OnEngineBeginAsync(serviceProvider, logger);
                }
                catch (Exception e)
                {
                    exceptions.Add(e);
                }
            }
            exceptions.ThrowIfExists();
        }