public LoggingBehaviour(IElkLogger <TRequest> logger, ICurrentUserService currentUserService, IReferenceNumberService referenceNumberService, IAllHeadersPerRequest allHeadersPerRequest) { _logger = logger; _currentUserService = currentUserService; _referenceNumberService = referenceNumberService; _allHeadersPerRequest = allHeadersPerRequest; }
public PerformanceBehaviour( IElkLogger <TRequest> logger, ICurrentUserService currentUserService, IReferenceNumberService referenceNumberService) { _timer = new Stopwatch(); _referenceNumberService = referenceNumberService; _logger = logger; _currentUserService = currentUserService; }
public PushRequestLogic( IRabbitProducers rabbitProducers, IOptions <Dictionary <string, QueueConfiguration> > queueConfiguration, IReferenceNumberService referenceNumber = null, IAllHeadersPerRequest allHeaders = null) { _rabbitProducers = rabbitProducers; _referenceNumber = referenceNumber; _queueConfiguration = queueConfiguration.Value; _allHeaders = allHeaders; }
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; }
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; }
public SubmissionHandlerStrategy(IEnumerable <ISubmissionHandler> handlers, IFormRepository formRepository, IReferenceNumberService referenceNumberService) { _handlers = handlers; _formRepository = formRepository; _referenceNumberService = referenceNumberService; }
public CreateNotificationCommandHandler(ILUTNotificationRepository notificationRepository, IReferenceNumberService referenceNumberService) { _NotificationRepository = notificationRepository; _ReferenceNumberService = referenceNumberService; }
public UnhandledExceptionBehaviour(IElkLogger <TRequest> logger, IReferenceNumberService referenceNumberService) { _referenceNumberService = referenceNumberService; _logger = logger; }