Exemplo n.º 1
0
 public ApiExceptionMapper(ILogger <ApiExceptionMapper> logger,
                           IHostEnvironment environment,
                           IOptions <Shared.Options.AppSettings> appSettings,
                           ICorrelationService correlationService) : base()
 {
     _logger             = logger ?? throw new ArgumentException($"{GetType().Name}.Ctr parameter {nameof(logger)} cannot be null.");
     _environment        = environment ?? throw new ArgumentException($"{GetType().Name}.Ctr parameter {nameof(environment)} cannot be null.");
     _appSettings        = appSettings?.Value ?? throw new ArgumentException($"{this.GetType().Name}.Ctr parameter {nameof(appSettings)} cannot be null.");
     _correlationService = correlationService ?? throw new ArgumentException($"{GetType().Name}.Ctr parameter {nameof(environment)} cannot be null.");
 }
Exemplo n.º 2
0
 public CorrelationMiddleware(RequestDelegate next,
                              ILogger <CorrelationMiddleware> logger,
                              ICorrelationService correlationService,
                              IOptions <CorrelationOptions> options,
                              ICorrelationContextFormatter correlationContextFormatter)
 {
     _next                        = next ?? throw new ArgumentNullException(nameof(next), $"{nameof(next)} cannot be null.");
     _logger                      = logger ?? throw new ArgumentNullException(nameof(logger), $"{nameof(logger)} cannot be null.");
     _correlationService          = correlationService ?? throw new ArgumentNullException(nameof(correlationService));
     _options                     = options ?? throw new ArgumentNullException(nameof(options));
     _correlationContextFormatter = correlationContextFormatter ?? throw new ArgumentNullException(nameof(correlationContextFormatter));
 }
 public Middleware(
     RequestDelegate next,
     IGuidService guidService,
     ICorrelationService correlationService,
     ILoggingService <Middleware> loggingService
     )
 {
     _next               = next;
     _guidService        = guidService;
     _loggingService     = loggingService;
     _correlationService = correlationService;
 }
 public IntegrationTestService
 (
     ITRXReportService trxReportService,
     ICorrelationService correlationService,
     IGuidService guidService,
     IIntegreationTestDBService integreationTestDBService
 )
 {
     _trxReportService          = trxReportService;
     _correlationService        = correlationService;
     _guidService               = guidService;
     _integreationTestDBService = integreationTestDBService;
 }
Exemplo n.º 5
0
 public DurableRestService
 (
     IServiceProvider serviceProvider,
     IGuidService guidService,
     IDateTimeService dateTimeService,
     ICorrelationService correlationService,
     ILoggingService <DurableRestService> loggingService
 )
 {
     _correlationService = correlationService;
     _loggingService     = loggingService;
     _dateTimeService    = dateTimeService;
     _guidService        = guidService;
     _serviceProvider    = serviceProvider;
 }
 public MiddlewareService(
     RequestDelegate next,
     IServiceProvider serviceProvider,
     IDateTimeService dateTimeService,
     ITelemetryService telemetryService,
     IGuidService guidService,
     ICorrelationService correlationService,
     ILoggingService <MiddlewareService> loggingService
     )
 {
     _next               = next;
     _guidService        = guidService;
     _loggingService     = loggingService;
     _correlationService = correlationService;
     _serviceProvider    = serviceProvider;
     _dateTimeService    = dateTimeService;
     _telemetryService   = telemetryService;
 }
 public MiddlewareService(
     IServiceProvider serviceProvider,
     IDateTimeService dateTimeService,
     ITelemetryService telemetryService,
     IGuidService guidService,
     ICorrelationService correlationService,
     ILoggingService <MiddlewareService <T> > loggingService,
     IJWTService <T> jwtService
     )
 {
     _guidService        = guidService;
     _loggingService     = loggingService;
     _correlationService = correlationService;
     _serviceProvider    = serviceProvider;
     _dateTimeService    = dateTimeService;
     _telemetryService   = telemetryService;
     _jwtService         = jwtService;
 }
Exemplo n.º 8
0
        private async Task Request(ICorrelationService correlationService, IGuidService guidService, IDurableRestService durableRestService)
        {
            correlationService.CorrelationId = guidService.NewGuid().ToString();

            using var httpClient = new HttpClient
                  {
                      BaseAddress = new Uri("https://jsonplaceholder.typicode.com/")
                  };

            var httpRequestMessage = new HttpRequestMessage
            {
                Method     = HttpMethod.Get,
                RequestUri = new Uri("todos/1", UriKind.Relative)
            };

            var retrys           = 3;
            var timeoutInSeconds = 30;
            var restResponse     = await durableRestService.ExecuteAsync(httpClient, httpRequestMessage, retrys, timeoutInSeconds).ConfigureAwait(false);
        }
 public CorrelationIdHandler(ICorrelationService correlationService)
 {
     _correlationService = correlationService ?? throw new System.ArgumentNullException(nameof(correlationService));
 }
Exemplo n.º 10
0
 private async Task RequestUsingProxy(IJsonPlaceHolderProxyService jsonPlaceHolderProxyService, ICorrelationService correlationService, IGuidService guidService)
 {
     correlationService.CorrelationId = guidService.NewGuid().ToString();
     await jsonPlaceHolderProxyService.GetTodosAsync(new GetTodosRequest
     {
         Items = 2
     }).ConfigureAwait(false);
 }
 public LoggingService(ILogger <T> logger, IRedactorService redactorService, ICorrelationService correlationService)
 {
     _logger             = logger;
     _redactorService    = redactorService;
     _correlationService = correlationService;
 }
 public EventQueueCorrelationIdHandler(ICorrelationService correlationService)
 {
     _correlationService = correlationService ?? throw new ArgumentNullException(nameof(correlationService));
 }
 public ApiExceptionMapper(ILogger <ApiExceptionMapper> logger, IWebHostEnvironment environment, ICorrelationService correlationService) : base()
 {
     Logger              = logger ?? throw new ArgumentException($"{GetType().Name}.Ctr parameter {nameof(logger)} cannot be null.");
     _environment        = environment ?? throw new ArgumentException($"{GetType().Name}.Ctr parameter {nameof(environment)} cannot be null.");
     _correlationService = correlationService ?? throw new ArgumentException($"{GetType().Name}.Ctr parameter {nameof(environment)} cannot be null.");
 }