コード例 #1
0
 public LoggingBehaviour(IElkLogger <TRequest> logger, ICurrentUserService currentUserService, IReferenceNumberService referenceNumberService, IAllHeadersPerRequest allHeadersPerRequest)
 {
     _logger                 = logger;
     _currentUserService     = currentUserService;
     _referenceNumberService = referenceNumberService;
     _allHeadersPerRequest   = allHeadersPerRequest;
 }
コード例 #2
0
 public PerformanceBehaviour(
     IElkLogger <TRequest> logger,
     ICurrentUserService currentUserService,
     IReferenceNumberService referenceNumberService)
 {
     _timer = new Stopwatch();
     _referenceNumberService = referenceNumberService;
     _logger             = logger;
     _currentUserService = currentUserService;
 }
コード例 #3
0
 public PushRequestLogic(
     IRabbitProducers rabbitProducers,
     IOptions <Dictionary <string, QueueConfiguration> > queueConfiguration,
     IReferenceNumberService referenceNumber = null,
     IAllHeadersPerRequest allHeaders        = null)
 {
     _rabbitProducers    = rabbitProducers;
     _referenceNumber    = referenceNumber;
     _queueConfiguration = queueConfiguration.Value;
     _allHeaders         = allHeaders;
 }
コード例 #4
0
        private void HandleValidationException(ExceptionContext context)
        {
            IReferenceNumberService referenceNumber = context?.HttpContext?.RequestServices?.GetService <IReferenceNumberService>();
            var exception = context.Exception as ASyncFramework.Application.Common.Exceptions.ValidationException;

            var details = new Result(false, ConvertDicToList(exception.Errors))
            {
                ReferenceNumber = referenceNumber?.ReferenceNumber
            };

            context.Result = new ObjectResult(details)
            {
                StatusCode = StatusCodes.Status422UnprocessableEntity
            };

            context.ExceptionHandled = true;
        }
コード例 #5
0
        private void HandleUnknownException(ExceptionContext context)
        {
            IReferenceNumberService referenceNumber = context?.HttpContext?.RequestServices?.GetService <IReferenceNumberService>();

            var exceptionString = Newtonsoft.Json.JsonConvert.SerializeObject(context.Exception);
            var details         = new Result(false, new List <string> {
                "An error occurred while processing your request.", exceptionString
            })
            {
                ReferenceNumber = referenceNumber?.ReferenceNumber
            };

            context.Result = new ObjectResult(details)
            {
                StatusCode = StatusCodes.Status500InternalServerError
            };

            context.ExceptionHandled = true;
        }
コード例 #6
0
 public SubmissionHandlerStrategy(IEnumerable <ISubmissionHandler> handlers, IFormRepository formRepository, IReferenceNumberService referenceNumberService)
 {
     _handlers               = handlers;
     _formRepository         = formRepository;
     _referenceNumberService = referenceNumberService;
 }
コード例 #7
0
 public CreateNotificationCommandHandler(ILUTNotificationRepository notificationRepository, IReferenceNumberService referenceNumberService)
 {
     _NotificationRepository = notificationRepository;
     _ReferenceNumberService = referenceNumberService;
 }
コード例 #8
0
 public UnhandledExceptionBehaviour(IElkLogger <TRequest> logger, IReferenceNumberService referenceNumberService)
 {
     _referenceNumberService = referenceNumberService;
     _logger = logger;
 }