Пример #1
0
        public async Task InvokeAsync(CFTFileContext context)
        {
            try
            {
                _logger.LogInformation(StartMessage);
                await ExecAsync(context);

                _logger.LogInformation(EndSuccessMessage);
            }
            catch (Exception e)
            {
                _logger.LogError(e, EndErrorMessage);
                throw;
            }

            try
            {
                await _next.Invoke(context);
            }
            catch (Exception e)
            {
                await NextExceptionExecAsync(e, context);

                throw;
            }
        }
Пример #2
0
 protected abstract Task NextExceptionExecAsync(Exception e, CFTFileContext context);
Пример #3
0
 protected abstract Task ExecAsync(CFTFileContext context);