diff --git a/src/Abstractions/ExecutionContext/BaseExecutionContext.cs b/src/Abstractions/ExecutionContext/BaseExecutionContext.cs
index 8432259d..1da02b8b 100644
--- a/src/Abstractions/ExecutionContext/BaseExecutionContext.cs
+++ b/src/Abstractions/ExecutionContext/BaseExecutionContext.cs
@@ -40,7 +40,7 @@ namespace Microsoft.Omex.Extensions.Abstractions.ExecutionContext
BuildVersion = GetBuildVersion();
ClusterIpAddress = GetIpAddress(MachineName);
-
+
RegionName = GetVariable(RegionNameVariableName) ?? DefaultEmptyValue;
DeploymentSlice = GetVariable(SliceNameVariableName) ?? DefaultEmptyValue;
diff --git a/src/Diagnostics.HealthChecks/DependencyInjection/OmexHealthCheckServiceCollectionExtensions.cs b/src/Diagnostics.HealthChecks/DependencyInjection/OmexHealthCheckServiceCollectionExtensions.cs
index 72bf12f8..79a65627 100644
--- a/src/Diagnostics.HealthChecks/DependencyInjection/OmexHealthCheckServiceCollectionExtensions.cs
+++ b/src/Diagnostics.HealthChecks/DependencyInjection/OmexHealthCheckServiceCollectionExtensions.cs
@@ -46,14 +46,7 @@ public static class OmexHealthCheckServiceCollectionExtensions
///
public static bool TryRemoveServiceByPredicate(this IServiceCollection @this, Func predicate)
{
-
- /* Unmerged change from project 'Microsoft.Omex.Extensions.Diagnostics.HealthChecks(netstandard2.0)'
- Before:
- var descriptorToRemove = @this.SingleOrDefault(predicate);
- After:
- ServiceDescriptor descriptorToRemove = @this.SingleOrDefault(predicate);
- */
- ServiceDescriptor? descriptorToRemove = @this.SingleOrDefault(predicate);
+ var descriptorToRemove = @this.SingleOrDefault(predicate);
if (descriptorToRemove != null)
{
return @this.Remove(descriptorToRemove);
diff --git a/src/Diagnostics.HealthChecks/Internal/HttpEndpointHealthCheck.cs b/src/Diagnostics.HealthChecks/Internal/HttpEndpointHealthCheck.cs
index 48763fdb..f8298aba 100644
--- a/src/Diagnostics.HealthChecks/Internal/HttpEndpointHealthCheck.cs
+++ b/src/Diagnostics.HealthChecks/Internal/HttpEndpointHealthCheck.cs
@@ -83,7 +83,7 @@ namespace Microsoft.Omex.Extensions.Diagnostics.HealthChecks
}
#if !NETCOREAPP3_1 && !NETSTANDARD2_0
- clone.VersionPolicy = message.VersionPolicy;
+ clone.VersionPolicy = message.VersionPolicy;
foreach (KeyValuePair option in message.Options)
{
diff --git a/src/Diagnostics.HealthChecks/Internal/NonCapturingTimer.cs b/src/Diagnostics.HealthChecks/Internal/NonCapturingTimer.cs
index 18c8436a..3ebca955 100644
--- a/src/Diagnostics.HealthChecks/Internal/NonCapturingTimer.cs
+++ b/src/Diagnostics.HealthChecks/Internal/NonCapturingTimer.cs
@@ -23,7 +23,7 @@ internal static class NonCapturingTimer
}
// Don't capture the current ExecutionContext and its AsyncLocals onto the timer
- bool restoreFlow = false;
+ var restoreFlow = false;
try
{
if (!ExecutionContext.IsFlowSuppressed())
diff --git a/src/Diagnostics.HealthChecks/Internal/ServiceContextHealthStatusSender.cs b/src/Diagnostics.HealthChecks/Internal/ServiceContextHealthStatusSender.cs
index f3160f3a..2e1b36af 100644
--- a/src/Diagnostics.HealthChecks/Internal/ServiceContextHealthStatusSender.cs
+++ b/src/Diagnostics.HealthChecks/Internal/ServiceContextHealthStatusSender.cs
@@ -3,12 +3,12 @@
using System;
using System.Fabric;
-using System.Fabric.Health;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Diagnostics.HealthChecks;
using Microsoft.Extensions.Logging;
using Microsoft.Omex.Extensions.Abstractions;
+using System.Fabric.Health;
namespace Microsoft.Omex.Extensions.Diagnostics.HealthChecks
{
diff --git a/src/Diagnostics.HealthChecks/Internal/ValueStopwatch.cs b/src/Diagnostics.HealthChecks/Internal/ValueStopwatch.cs
index c3f5f524..fcc65874 100644
--- a/src/Diagnostics.HealthChecks/Internal/ValueStopwatch.cs
+++ b/src/Diagnostics.HealthChecks/Internal/ValueStopwatch.cs
@@ -34,9 +34,9 @@ internal struct ValueStopwatch
throw new InvalidOperationException("An uninitialized, or 'default', ValueStopwatch cannot be used to get elapsed time.");
}
- long end = Stopwatch.GetTimestamp();
- long timestampDelta = end - _startTimestamp;
- long ticks = (long)(TimestampToTicks * timestampDelta);
+ var end = Stopwatch.GetTimestamp();
+ var timestampDelta = end - _startTimestamp;
+ var ticks = (long)(TimestampToTicks * timestampDelta);
return new TimeSpan(ticks);
}
}
diff --git a/src/Diagnostics.HealthChecks/OmexHealthCheckPublisherHostedService.cs b/src/Diagnostics.HealthChecks/OmexHealthCheckPublisherHostedService.cs
index 3f571528..ec16ba21 100644
--- a/src/Diagnostics.HealthChecks/OmexHealthCheckPublisherHostedService.cs
+++ b/src/Diagnostics.HealthChecks/OmexHealthCheckPublisherHostedService.cs
@@ -88,7 +88,7 @@ internal sealed partial class OmexHealthCheckPublisherHostedService : IHostedSer
// actually tries to **run** health checks would be real baaaaad.
ValidateRegistrations(_healthCheckServiceOptions.Value.Registrations);
- _defaultTimerOptions = (_healthCheckPublisherOptions.Value.Delay, _healthCheckPublisherOptions.Value.Period, _healthCheckPublisherOptions.Value.Timeout);
+ _defaultTimerOptions = (_healthCheckPublisherOptions.Value.Delay, _healthCheckPublisherOptions.Value.Period, _healthCheckPublisherOptions.Value.Timeout);
// Group healthcheck registrations by Delay, Period and Timeout, to build a Dictionary<(TimeSpan, TimeSpan, TimeSpan), List>
// For HCs with no Delay, Period or Timeout, we default to the publisher values
diff --git a/src/Hosting.Services.Web/ApplicationBuilderExtensions.cs b/src/Hosting.Services.Web/ApplicationBuilderExtensions.cs
index 6d02938c..2de6de0d 100644
--- a/src/Hosting.Services.Web/ApplicationBuilderExtensions.cs
+++ b/src/Hosting.Services.Web/ApplicationBuilderExtensions.cs
@@ -75,7 +75,7 @@ namespace Microsoft.AspNetCore.Builder
///
public static IApplicationBuilder UseOmexExceptionHandler(this IApplicationBuilder builder, IHostEnvironment environment) =>
builder.UseOmexExceptionHandler(environment.IsDevelopment());
-
+
///
/// Adds the default exception handling logic that will display a developer exception page in develop and a short message during deployment
///
diff --git a/src/Hosting.Services.Web/Middlewares/ObsoleteCorrelationHeadersMiddleware.cs b/src/Hosting.Services.Web/Middlewares/ObsoleteCorrelationHeadersMiddleware.cs
index ca693229..73023679 100644
--- a/src/Hosting.Services.Web/Middlewares/ObsoleteCorrelationHeadersMiddleware.cs
+++ b/src/Hosting.Services.Web/Middlewares/ObsoleteCorrelationHeadersMiddleware.cs
@@ -125,7 +125,7 @@ namespace Microsoft.Omex.Extensions.Hosting.Services.Web.Middlewares
private static readonly string[] s_officeClientQueryParameters = {
"client", // Identifies the client application and platform
"av", // Identifies the client application, platform and partial version
- "app" }; // Identifies the client application
+ "app" }; // Identifies the client application
private const string CorrelationHeader = "X-CorrelationId";
diff --git a/src/Logging/InitializationLogger.cs b/src/Logging/InitializationLogger.cs
index 811d9459..5f82e8dc 100644
--- a/src/Logging/InitializationLogger.cs
+++ b/src/Logging/InitializationLogger.cs
@@ -19,7 +19,7 @@ namespace Microsoft.Omex.Extensions.Logging
///
public static ILogger Instance { get; private set; } = LoggerFactory.Create(builder =>
{
- builder.LoadInitializationLogger();
+ builder.LoadInitializationLogger();
}).CreateLogger("Initial-Logging");
private static ILoggingBuilder LoadInitializationLogger(this ILoggingBuilder builder)
@@ -56,7 +56,7 @@ namespace Microsoft.Omex.Extensions.Logging
/// Service name for logging
/// Exception to log
/// Message to log
- public static void LogInitializationFail(string serviceNameForLogging, Exception? ex = null, string message = "")
+ public static void LogInitializationFail(string serviceNameForLogging, Exception? ex = null, string message = "")
{
ServiceInitializationEventSource.Instance.LogHostFailed(ex?.ToString() ?? string.Empty, serviceNameForLogging, message);
Instance.LogError(Tag.Create(), ex, message);
diff --git a/tests/Activities.UnitTests/Internal/DefaultActivityListenerConfiguratorTests.cs b/tests/Activities.UnitTests/Internal/DefaultActivityListenerConfiguratorTests.cs
index 363afebd..fef3aeed 100644
--- a/tests/Activities.UnitTests/Internal/DefaultActivityListenerConfiguratorTests.cs
+++ b/tests/Activities.UnitTests/Internal/DefaultActivityListenerConfiguratorTests.cs
@@ -1,10 +1,10 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
-using System.Diagnostics;
-using Microsoft.Extensions.Options;
using Microsoft.VisualStudio.TestTools.UnitTesting;
+using System.Diagnostics;
using Moq;
+using Microsoft.Extensions.Options;
namespace Microsoft.Omex.Extensions.Activities.UnitTests
{
diff --git a/tests/Activities.UnitTests/ServiceCollectionTests.cs b/tests/Activities.UnitTests/ServiceCollectionTests.cs
index 323376da..b5cd0aa4 100644
--- a/tests/Activities.UnitTests/ServiceCollectionTests.cs
+++ b/tests/Activities.UnitTests/ServiceCollectionTests.cs
@@ -1,16 +1,16 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
-using System;
-using System.Collections.Generic;
+using Microsoft.Extensions.Hosting;
+using Microsoft.Extensions.DependencyInjection;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Diagnostics;
+using System;
+using Microsoft.Omex.Extensions.Abstractions.Activities.Processing;
+using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
-using Microsoft.Extensions.DependencyInjection;
-using Microsoft.Extensions.Hosting;
-using Microsoft.Omex.Extensions.Abstractions.Activities.Processing;
using Microsoft.Omex.Extensions.Testing.Helpers;
-using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Microsoft.Omex.Extensions.Activities.UnitTests
{
diff --git a/tests/Diagnostics.HealthChecks.UnitTests/Extensions/TaskExtensions.cs b/tests/Diagnostics.HealthChecks.UnitTests/Extensions/TaskExtensions.cs
index 1bb30b36..c707f099 100644
--- a/tests/Diagnostics.HealthChecks.UnitTests/Extensions/TaskExtensions.cs
+++ b/tests/Diagnostics.HealthChecks.UnitTests/Extensions/TaskExtensions.cs
@@ -8,8 +8,8 @@
using System;
using System.Diagnostics;
using System.Runtime.CompilerServices;
-using System.Threading;
using System.Threading.Tasks;
+using System.Threading;
namespace Microsoft.Omex.Extensions.Diagnostics.HealthChecks.UnitTests.Extensions
{
@@ -41,7 +41,7 @@ namespace Microsoft.Omex.Extensions.Diagnostics.HealthChecks.UnitTests.Extension
throw new TimeoutException(CreateMessage(timeout, filePath, lineNumber));
}
#else
- CancellationTokenSource cts = new CancellationTokenSource();
+ var cts = new CancellationTokenSource();
if (task == await Task.WhenAny(task, Task.Delay(timeout, cts.Token)).ConfigureAwait(false))
{
cts.Cancel();
diff --git a/tests/Diagnostics.HealthChecks.UnitTests/OmexHealthCheckPublisherHostedServiceTests.cs b/tests/Diagnostics.HealthChecks.UnitTests/OmexHealthCheckPublisherHostedServiceTests.cs
index 69f95c5f..c379be5c 100644
--- a/tests/Diagnostics.HealthChecks.UnitTests/OmexHealthCheckPublisherHostedServiceTests.cs
+++ b/tests/Diagnostics.HealthChecks.UnitTests/OmexHealthCheckPublisherHostedServiceTests.cs
@@ -28,9 +28,9 @@ namespace Microsoft.Omex.Extensions.Diagnostics.HealthChecks.UnitTests
public async Task StartAsync_WithoutPublishers_DoesNotStartTimer()
{
// Arrange
- IHealthCheckPublisher[] publishers = Array.Empty();
+ var publishers = Array.Empty();
- OmexHealthCheckPublisherHostedService service = CreateService(publishers);
+ var service = CreateService(publishers);
try
{
@@ -53,12 +53,12 @@ namespace Microsoft.Omex.Extensions.Diagnostics.HealthChecks.UnitTests
public async Task StartAsync_WithPublishers_StartsTimer()
{
// Arrange
- IHealthCheckPublisher[] publishers = new IHealthCheckPublisher[]
+ var publishers = new IHealthCheckPublisher[]
{
new TestPublisher(),
};
- OmexHealthCheckPublisherHostedService service = CreateService(publishers);
+ var service = CreateService(publishers);
try
{
@@ -81,11 +81,11 @@ namespace Microsoft.Omex.Extensions.Diagnostics.HealthChecks.UnitTests
public async Task StartAsync_WithPublishers_StartsTimer_RunsPublishers()
{
// Arrange
- TaskCompletionSource