Skip to content

Commit

Permalink
Fix IDE0007
Browse files Browse the repository at this point in the history
  • Loading branch information
Kielek committed Oct 28, 2024
1 parent 60c8776 commit 3da8484
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion examples/AspNet/Controllers/WeatherForecastController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public async Task<string> GetData()
[HttpPost]
public async Task<HttpResponseMessage> PostData()
{
string value1 = Baggage.GetBaggage("key1");
var value1 = Baggage.GetBaggage("key1");
if (string.IsNullOrEmpty(value1))
{
throw new InvalidOperationException("Key1 was not found on Baggage.");
Expand Down
10 changes: 5 additions & 5 deletions examples/kafka/ProduceConsumeHostedService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ internal class ProduceConsumeHostedService(
{
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
{
IProducer<string, string> producer = instrumentedProducerBuilder.Build();
IConsumer<string, string> 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,
new Message<string, string> { Key = "any_key", Value = $"any_value_{j}" },
stoppingToken);
}

for (int j = 0; j < 100; j++)
for (var j = 0; j < 100; j++)
{
producer.Produce(
Constants.Topic,
Expand All @@ -35,7 +35,7 @@ await producer.ProduceAsync(
consumer.Subscribe(Constants.Topic);
while (!stoppingToken.IsCancellationRequested)
{
ConsumeResult<string, string> consumeResult = consumer.Consume(stoppingToken);
var consumeResult = consumer.Consume(stoppingToken);
if (consumeResult == null)
{
continue;
Expand Down

0 comments on commit 3da8484

Please sign in to comment.