From 06135307accf8f305e7368c183be93fda70497cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Kie=C5=82kowicz?= Date: Mon, 28 Oct 2024 06:40:42 +0100 Subject: [PATCH] Fix IDE0007 --- .../AspNet/Controllers/WeatherForecastController.cs | 2 +- examples/kafka/ProduceConsumeHostedService.cs | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/AspNet/Controllers/WeatherForecastController.cs b/examples/AspNet/Controllers/WeatherForecastController.cs index d626f28c44..984f41a783 100644 --- a/examples/AspNet/Controllers/WeatherForecastController.cs +++ b/examples/AspNet/Controllers/WeatherForecastController.cs @@ -89,7 +89,7 @@ public async Task GetData() [HttpPost] public async Task PostData() { - string value1 = Baggage.GetBaggage("key1"); + var value1 = Baggage.GetBaggage("key1"); if (string.IsNullOrEmpty(value1)) { throw new InvalidOperationException("Key1 was not found on Baggage."); diff --git a/examples/kafka/ProduceConsumeHostedService.cs b/examples/kafka/ProduceConsumeHostedService.cs index b44fc90bb5..b61a39aebd 100644 --- a/examples/kafka/ProduceConsumeHostedService.cs +++ b/examples/kafka/ProduceConsumeHostedService.cs @@ -12,10 +12,10 @@ internal class ProduceConsumeHostedService( { protected override async Task ExecuteAsync(CancellationToken stoppingToken) { - IProducer producer = instrumentedProducerBuilder.Build(); - IConsumer consumer = instrumentedConsumerBuilder.Build(); + var producer = instrumentedProducerBuilder.Build(); + var consumer = instrumentedConsumerBuilder.Build(); - for (int j = 0; j < 100; j++) + for (var j = 0; j < 100; j++) { await producer.ProduceAsync( Constants.Topic, @@ -23,7 +23,7 @@ await producer.ProduceAsync( stoppingToken); } - for (int j = 0; j < 100; j++) + for (var j = 0; j < 100; j++) { producer.Produce( Constants.Topic, @@ -35,7 +35,7 @@ await producer.ProduceAsync( consumer.Subscribe(Constants.Topic); while (!stoppingToken.IsCancellationRequested) { - ConsumeResult consumeResult = consumer.Consume(stoppingToken); + var consumeResult = consumer.Consume(stoppingToken); if (consumeResult == null) { continue;