diff --git a/docs/core/diagnostics/snippets/resource-monitoring-with-manual-metrics/Program.cs b/docs/core/diagnostics/snippets/resource-monitoring-with-manual-metrics/Program.cs index b2141afaf6c6d..8f0c39f905b74 100644 --- a/docs/core/diagnostics/snippets/resource-monitoring-with-manual-metrics/Program.cs +++ b/docs/core/diagnostics/snippets/resource-monitoring-with-manual-metrics/Program.cs @@ -5,7 +5,7 @@ using Spectre.Console; // -var app = Host.CreateDefaultBuilder() +IHost app = Host.CreateDefaultBuilder() .ConfigureServices(services => { services.AddLogging(static builder => builder.AddConsole()) @@ -13,12 +13,12 @@ }) .Build(); -var logger = app.Services.GetRequiredService>(); +ILogger logger = app.Services.GetRequiredService>(); await app.StartAsync(); // using var cancellationTokenSource = new CancellationTokenSource(); -var token = cancellationTokenSource.Token; +CancellationToken token = cancellationTokenSource.Token; Console.CancelKeyPress += (_, e) => { e.Cancel = true; @@ -30,8 +30,7 @@ async Task StartMonitoringAsync(ILogger logger, CancellationToken cancellationToken) { - var table = new Table() - .Centered() + Table table = new Table() .Title("Resource Monitoring", new Style(foreground: Color.Purple, decoration: Decoration.Bold)) .RoundedBorder() .BorderColor(Color.Cyan1) diff --git a/docs/core/diagnostics/snippets/resource-monitoring-with-manual-metrics/resource-monitoring-with-manual-metrics.csproj b/docs/core/diagnostics/snippets/resource-monitoring-with-manual-metrics/resource-monitoring-with-manual-metrics.csproj index 994488ae8aed4..1f9c12f3de174 100644 --- a/docs/core/diagnostics/snippets/resource-monitoring-with-manual-metrics/resource-monitoring-with-manual-metrics.csproj +++ b/docs/core/diagnostics/snippets/resource-monitoring-with-manual-metrics/resource-monitoring-with-manual-metrics.csproj @@ -10,11 +10,11 @@ - - - - - + + + + +