6585 references to Key
aspire (44)
Backchannel\ResourceSnapshotMapper.cs (4)
87var properties = snapshot.Properties.OrderBy(p => p.Key).ToDistinctDictionary( 88p => p.Key, 134var stringProperties = snapshot.Properties.OrderBy(p => p.Key).ToDistinctDictionary( 135p => p.Key,
Commands\AgentMcpCommand.cs (1)
199Name = x.Key,
Commands\ConfigCommand.cs (4)
281.Where(kvp => kvp.Key.StartsWith(featurePrefix, StringComparison.Ordinal)) 282.Select(kvp => kvp.Key.Substring(featurePrefix.Length)) 335foreach (var kvp in config.OrderBy(k => k.Key)) 338$"[cyan]{kvp.Key.EscapeMarkup()}[/]",
Commands\GroupedHelpWriter.cs (1)
120foreach (var (group, commands) in grouped.OrderBy(kvp => kvp.Key))
Commands\RenderCommand.cs (3)
216foreach (var choice in s_choices.Where(choice => !s_publishSummaryScenarioDescriptions.ContainsKey(choice.Key))) 218InteractionService.DisplayPlainText($"{choice.Key}: {choice.Value}"); 225InteractionService.DisplayPlainText($"{scenario.Key}: {scenario.Value}");
Commands\SecretListCommand.cs (2)
56foreach (var (key, value) in secrets.OrderBy(s => s.Key, StringComparer.OrdinalIgnoreCase)) 76foreach (var (key, value) in secrets.OrderBy(s => s.Key, StringComparer.OrdinalIgnoreCase))
Configuration\ConfigurationService.cs (1)
345var normalizedKey = kvp.Key.Replace(':', '.');
Configuration\FlexibleBooleanDictionaryConverter.cs (1)
66writer.WriteBoolean(kvp.Key, kvp.Value);
DotNet\DotNetCliRunner.cs (1)
272execution.EnvironmentVariables.Select(kvp => new EnvVar { Name = kvp.Key, Value = kvp.Value }).ToList(),
DotNet\ProcessExecution.cs (1)
180.ToDictionary(static kvp => kvp.Key, static kvp => kvp.Value!, ProcessEnvironment.Comparer);
DotNet\ProcessExecutionFactory.cs (2)
63effectiveLogger.LogDebug("{FileName} env: {EnvKey}={EnvValue}", fileName, envKvp.Key, envKvp.Value); 93startInfo.Environment[envKvp.Key] = envKvp.Value;
Migrations\TypeScriptAppHostMigration.cs (1)
303scripts[script.Key] = (JsonNode?)JsonValue.Create(rewritten);
Packaging\NuGetConfigMerger.cs (2)
354var sourceValue = sourceElement.Key ?? sourceKey; 710string.Equals(kvp.Key, sourceKey, StringComparison.OrdinalIgnoreCase) &&
Packaging\PackagingService.cs (2)
711.OrderBy(static kvp => kvp.Key, StringComparer.OrdinalIgnoreCase) 717$"{kvp.Key} ({string.Join(", ", kvp.Value)})"));
Processes\WindowsProcessInterop.cs (1)
625blockBuilder.Append(kvp.Key);
Projects\DotNetAppHostProject.cs (1)
1639env[kvp.Key] = kvp.Value;
Projects\ExtensionGuestLauncher.cs (1)
53effectiveEnvironmentVariables.Select(kvp => new EnvVar { Name = kvp.Key, Value = kvp.Value }).ToList(),
Projects\GuestAppHostProject.cs (2)
466launchSettingsEnvVars[kvp.Key] = kvp.Value; 1033result[kvp.Key] = kvp.Value;
src\Shared\ConsoleLogs\SharedAIHelpers.cs (2)
365.Select(kvp => new OtlpTraceDto(kvp.Key, kvp.Value)) 514foreach (var key in obj.Where(kvp => kvp.Value is null).Select(kvp => kvp.Key).ToList())
src\Shared\IntegrationPackageProbeManifest.cs (1)
292static pair => pair.Key,
src\Shared\Json\JsonFlattener.cs (4)
32var keys = kvp.Key.Split(':'); 61? kvp.Key 62: string.IsNullOrEmpty(kvp.Key) 64: $"{prefix}:{kvp.Key}";
src\Shared\UserSecrets\SecretsStore.cs (1)
142result[kvp.Key] = value;
Telemetry\AspireCliTelemetry.cs (1)
210tags[tag.Key] = tag.Value;
Telemetry\CliTagEnrichmentProcessor.cs (1)
31activity.SetTag(tag.Key, tag.Value);
Utils\ConfigurationHelper.cs (2)
311if (kvp.Key.Contains(':')) 315colonKeys.Add((kvp.Key, kvp.Value?.DeepClone()));
Utils\FileSystemHelper.cs (1)
200var originalPath = kvp.Key;
aspire-managed (1)
src\Shared\IntegrationPackageProbeManifest.cs (1)
292static pair => pair.Key,
Aspire.Acquisition.Tests (2)
tests\Shared\TemplatesTesting\ToolCommand.cs (2)
249_testOutput.WriteLine($"{_msgPrefix}\t[{item.Key}] = {item.Value}"); 250psi.Environment[item.Key] = item.Value;
Aspire.Azure.Messaging.EventHubs.Tests (2)
tests\Aspire.Azure.Security.KeyVault.Tests\MockTransport.cs (2)
116protected override IEnumerable<HttpHeader> EnumerateHeaders() => _headers.Select(h => new HttpHeader(h.Key, JoinHeaderValue(h.Value))); 207protected override IEnumerable<HttpHeader> EnumerateHeaders() => _headers.Select(h => new HttpHeader(h.Key, JoinHeaderValue(h.Value)));
Aspire.Azure.Security.KeyVault.Tests (2)
MockTransport.cs (2)
116protected override IEnumerable<HttpHeader> EnumerateHeaders() => _headers.Select(h => new HttpHeader(h.Key, JoinHeaderValue(h.Value))); 207protected override IEnumerable<HttpHeader> EnumerateHeaders() => _headers.Select(h => new HttpHeader(h.Key, JoinHeaderValue(h.Value)));
Aspire.Cli.EndToEnd.Tests (9)
Helpers\CaptureWorkspaceOnFailureAttribute.cs (8)
64if (kvp.Key.StartsWith("CapturePath:", StringComparison.Ordinal) && 68var label = kvp.Key["CapturePath:".Length..]; 72if (kvp.Key.StartsWith("CaptureFile:", StringComparison.Ordinal) && 76var fileName = kvp.Key["CaptureFile:".Length..]; 96if (kvp.Key.StartsWith("CapturePath:", StringComparison.Ordinal) && 100var label = kvp.Key["CapturePath:".Length..]; 105if (kvp.Key.StartsWith("CaptureFile:", StringComparison.Ordinal) && 109var fileName = kvp.Key["CaptureFile:".Length..];
Helpers\CliInstallStrategyTests.cs (1)
1012return new EnvironmentVariableScope([.. cleanVariables.Select(variable => (variable.Key, variable.Value))]);
Aspire.Cli.Tests (87)
Agents\AspireSkillsBundleTests.cs (2)
861RelativePath = file.Key, 862Sha512 = hashOverride ?? ComputeSha512(Path.Combine(skillDirectory, AspireSkillsBundleProvider.NormalizeRelativePath(file.Key)))
Agents\TelemetryHookScriptTests.cs (3)
445environment[pair.Key] = pair.Value; 501psi.Environment.Remove(pair.Key); 505psi.Environment[pair.Key] = pair.Value;
Backchannel\ResourceSnapshotMapperTests.cs (1)
100Assert.Equal("stop", command.Key);
Commands\AgentTelemetryCommandTests.cs (6)
39var tags = activity.Tags.ToDictionary(t => t.Key, t => t.Value); 69var tags = activity.Tags.ToDictionary(t => t.Key, t => t.Value); 100var tags = activity.Tags.ToDictionary(t => t.Key, t => t.Value); 132var tags = activity.Tags.ToDictionary(t => t.Key, t => t.Value); 158var tags = activity.Tags.ToDictionary(t => t.Key, t => t.Value); 252var tags = activity.Tags.ToDictionary(t => t.Key, t => t.Value);
Commands\AppHostLauncherTests.cs (2)
1318.ToDictionary(static kvp => kvp.Key, static kvp => kvp.Value!); 1429environment?.ToDictionary(static kvp => kvp.Key, static kvp => (string?)kvp.Value)
Commands\RunCommandTests.cs (3)
971var tags = fixture.CapturedActivity.TagObjects.ToDictionary(t => t.Key, t => t.Value); 997var tags = fixture.CapturedActivity.TagObjects.ToDictionary(t => t.Key, t => t.Value); 4285var tags = fixture.CapturedActivity.TagObjects.ToDictionary(t => t.Key, t => t.Value);
DotNet\DotNetCliRunnerTests.cs (2)
807.Where(activity => activity.Tags.Any(tag => tag.Key == ProfilingTelemetry.Tags.ProfilingSessionId && tag.Value == sessionId)) 2688public IReadOnlyDictionary<string, string?> EnvironmentVariables { get; } = environmentVariables?.ToDictionary(kvp => kvp.Key, kvp => (string?)kvp.Value)
DotNet\ProcessExecutionDetachedTests.cs (1)
503environment?.ToDictionary(static kvp => kvp.Key, static kvp => kvp.Value),
Projects\DotNetAppHostProjectTests.cs (1)
609: new TestEnvironment(environmentVariables.ToDictionary(pair => pair.Key, pair => (string?)pair.Value));
Projects\PrebuiltAppHostServerTests.cs (1)
2850foreach (var (relativePath, content) in closureFiles.OrderBy(static file => file.Key, StringComparer.Ordinal))
Scaffolding\PackageJsonMergerTests.cs (3)
1287Assert.Contains("test", scripts.Select(p => p.Key)); 1288Assert.Contains("aspire:start", scripts.Select(p => p.Key)); 1289Assert.Contains("aspire:build", scripts.Select(p => p.Key));
Telemetry\AspireCliTelemetryTests.cs (37)
52var activityTags = activity.Tags.ToDictionary(t => t.Key, t => t.Value); 55Assert.True(activityTags.ContainsKey(tag.Key), $"Activity is missing tag '{tag.Key}'"); 56Assert.Equal(tag.Value?.ToString(), activityTags[tag.Key]); 126var eventTags = exceptionEvent.Tags.ToDictionary(t => t.Key, t => t.Value); 137Assert.True(eventTags.ContainsKey(tag.Key), $"Error event is missing default tag '{tag.Key}'"); 138Assert.Equal(tag.Value?.ToString(), eventTags[tag.Key]?.ToString()); 225Assert.Contains(tags, t => t.Key == "machine.device_id" && (string?)t.Value == "test-device-id"); 226Assert.Contains(tags, t => t.Key == "machine.mac_address_hash" && (string?)t.Value == "test-mac-hash"); 238Assert.Contains(tags, t => t.Key == TelemetryConstants.Tags.OsName && (string?)t.Value == expectedOsName); 239Assert.Contains(tags, t => t.Key == TelemetryConstants.Tags.OsVersion && t.Value is string s && s == Environment.OSVersion.Version.ToString()); 240Assert.Contains(tags, t => t.Key == TelemetryConstants.Tags.OsType && (string?)t.Value == expectedOsType); 265Assert.DoesNotContain(tags, t => t.Key == TelemetryConstants.Tags.CodingAgent); 286Assert.Contains(tags, t => t.Key == TelemetryConstants.Tags.InternalMicrosoft && t.Value is true); 287Assert.Contains(tags, t => t.Key == TelemetryConstants.Tags.InternalMicrosoftSource && (string?)t.Value == "test source"); 288Assert.Contains(tags, t => t.Key == TelemetryConstants.Tags.InternalMicrosoftAlias && (string?)t.Value == "test.alias"); 289Assert.Contains(tags, t => t.Key == TelemetryConstants.Tags.InternalMicrosoftDomain && (string?)t.Value == "TEST"); 308Assert.Equal(TelemetryConstants.Tags.InternalMicrosoft, tag.Key); 313Assert.Equal(TelemetryConstants.Tags.InternalMicrosoftSource, tag.Key); 377Assert.Contains(tags, t => t.Key == TelemetryConstants.Tags.MacAddressHash && (string?)t.Value == "test-mac-hash"); 378Assert.Contains(tags, t => t.Key == TelemetryConstants.Tags.DeviceId && (string?)t.Value == "test-device-id"); 379Assert.Contains(tags, t => t.Key == TelemetryConstants.Tags.CliVersion); 380Assert.Contains(tags, t => t.Key == TelemetryConstants.Tags.OsName); 422var activityTags = activity.Tags.ToDictionary(t => t.Key, t => t.Value); 425Assert.True(activityTags.ContainsKey(tag.Key), $"Activity is missing tag '{tag.Key}'"); 426Assert.Equal(tag.Value?.ToString(), activityTags[tag.Key]); 461return [.. tags.Where(t => t.Key == TelemetryConstants.Tags.InternalMicrosoft || 462t.Key.StartsWith("aspire.cli.microsoft_internal", StringComparison.Ordinal))]; 481Assert.Contains(tags, t => t.Key == TelemetryConstants.Tags.IdentityVersion && (string?)t.Value == "13.5.0-preview.1.26310.9"); 482Assert.Contains(tags, t => t.Key == TelemetryConstants.Tags.IdentityChannel && (string?)t.Value == "daily"); 483Assert.Contains(tags, t => t.Key == TelemetryConstants.Tags.IdentityCommit && (string?)t.Value == "95f0d2968"); 487Assert.Contains(tags, t => t.Key == TelemetryConstants.Tags.CliVersion); 488Assert.Contains(tags, t => t.Key == TelemetryConstants.Tags.CliBuildId); 505Assert.Contains(tags, t => t.Key == TelemetryConstants.Tags.IdentityVersion && (string?)t.Value == "13.5.0"); 506Assert.DoesNotContain(tags, t => t.Key == TelemetryConstants.Tags.IdentityCommit);
Telemetry\CliTagEnrichmentProcessorTests.cs (5)
32Assert.DoesNotContain(activity.Tags, t => t.Key == "aspire.cli.version"); 37Assert.Contains(activity.Tags, t => t.Key == "aspire.cli.version"); 38Assert.Contains(activity.Tags, t => t.Key == "machine.device_id"); 88Assert.Contains(activity.Tags, t => t.Key == "aspire.cli.version" && (string?)t.Value == "1.0.0-test"); 89Assert.Contains(activity.Tags, t => t.Key == "machine.device_id" && (string?)t.Value == "test-device-id");
Telemetry\InternalMicrosoftDetectorTests.cs (1)
614environment?.ToDictionary(kvp => kvp.Key, kvp => (string?)kvp.Value)
Telemetry\TelemetryConfigurationTests.cs (4)
32result[s_telemetryOptInOverride.Key] = s_telemetryOptInOverride.Value; 181.AddInMemoryCollection(config.Select(pair => new KeyValuePair<string, string?>(pair.Key, pair.Value))) 322return [.. tags.Where(t => t.Key == TelemetryConstants.Tags.InternalMicrosoft || 323t.Key.StartsWith("aspire.cli.microsoft_internal", StringComparison.Ordinal))];
Telemetry\TelemetryFixture.cs (1)
67activity.SetTag(tag.Key, tag.Value);
tests\Shared\Logging\LogTestHelpers.cs (1)
31return list?.SingleOrDefault(kvp => kvp.Key == key).Value;
tests\Shared\Logging\LogValuesAssert.cs (3)
54return string.Join(",", logValues.Select(kvp => $"[{kvp.Key} {kvp.Value}]")); 61return string.Equals(x.Key, y.Key) && object.Equals(x.Value, y.Value);
TestServices\FakePeerInstallProbe.cs (1)
29_responses[kvp.Key] = kvp.Value;
TestServices\FakePlaywrightServices.cs (3)
185.Where(entry => string.Equals(entry.Key.SkillName, skillName, StringComparison.Ordinal)) 188RelativePath = entry.Key.RelativePath, 189Sha512 = ComputeSha512(Path.Combine(_bundleDirectory.FullName, "skills", skillName, entry.Key.RelativePath))
TestServices\TestProcessExecutionFactory.cs (2)
130.ToDictionary(static kvp => kvp.Key, static kvp => kvp.Value!); 158EnvironmentVariables = env?.ToDictionary(kvp => kvp.Key, kvp => (string?)kvp.Value)
Utils\SdkInstallHelperTests.cs (3)
33var tags = fixture.CapturedActivity.Tags.ToDictionary(t => t.Key, t => t.Value); 59var tags = fixture.CapturedActivity.Tags.ToDictionary(t => t.Key, t => t.Value); 85var tags = fixture.CapturedActivity.Tags.ToDictionary(t => t.Key, t => t.Value);
Utils\TestEnvironment.cs (1)
29return Variables.Select(pair => (pair.Key, pair.Value));
Aspire.Confluent.Kafka (2)
ConsumerConnectionFactory.cs (1)
18_consumerConfig.Set(property.Key, property.Value);
ProducerConnectionFactory.cs (1)
18_producerConfig.Set(property.Key, property.Value);
Aspire.Confluent.Kafka.Tests (60)
Aspire8MetricsTests.cs (60)
79Assert.Contains(collectorProducerQueueMessageCount.LastMeasurement!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka"); 80Assert.Contains(collectorProducerQueueMessageCount.LastMeasurement!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1"); 83Assert.Contains(collectorConsumerQueueMessageCount.LastMeasurement!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka"); 84Assert.Contains(collectorConsumerQueueMessageCount.LastMeasurement!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1"); 87Assert.Contains(collectorProducerQueueSize.LastMeasurement!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka"); 88Assert.Contains(collectorProducerQueueSize.LastMeasurement!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1"); 91Assert.Contains(collectorNetworkTx.LastMeasurement!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka"); 92Assert.Contains(collectorNetworkTx.LastMeasurement!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1"); 93Assert.Contains(collectorNetworkTx.LastMeasurement!.Tags, t => t.Key == "type" && t.Value!.ToString() == "producer"); 96Assert.Contains(collectorNetworkTransmitted.LastMeasurement!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka"); 97Assert.Contains(collectorNetworkTransmitted.LastMeasurement!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1"); 98Assert.Contains(collectorNetworkTransmitted.LastMeasurement!.Tags, t => t.Key == "type" && t.Value!.ToString() == "producer"); 101Assert.Contains(collectorNetworkRx.LastMeasurement!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka"); 102Assert.Contains(collectorNetworkRx.LastMeasurement!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1"); 103Assert.Contains(collectorNetworkRx.LastMeasurement!.Tags, t => t.Key == "type" && t.Value!.ToString() == "producer"); 106Assert.Contains(collectorNetworkReceived.LastMeasurement!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka"); 107Assert.Contains(collectorNetworkReceived.LastMeasurement!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1"); 108Assert.Contains(collectorNetworkReceived.LastMeasurement!.Tags, t => t.Key == "type" && t.Value!.ToString() == "producer"); 111Assert.Contains(collectorMessageTx.LastMeasurement!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka"); 112Assert.Contains(collectorMessageTx.LastMeasurement!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1"); 113Assert.Contains(collectorMessageTx.LastMeasurement!.Tags, t => t.Key == "type" && t.Value!.ToString() == "producer"); 116Assert.Contains(collectorMessageTransmitted.LastMeasurement!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka"); 117Assert.Contains(collectorMessageTransmitted.LastMeasurement!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1"); 118Assert.Contains(collectorMessageTransmitted.LastMeasurement!.Tags, t => t.Key == "type" && t.Value!.ToString() == "producer"); 121Assert.Contains(collectorMessageRx.LastMeasurement!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka"); 122Assert.Contains(collectorMessageRx.LastMeasurement!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1"); 123Assert.Contains(collectorMessageRx.LastMeasurement!.Tags, t => t.Key == "type" && t.Value!.ToString() == "producer"); 126Assert.Contains(collectorMessageReceived.LastMeasurement!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka"); 127Assert.Contains(collectorMessageReceived.LastMeasurement!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1"); 128Assert.Contains(collectorMessageReceived.LastMeasurement!.Tags, t => t.Key == "type" && t.Value!.ToString() == "producer"); 194Assert.Contains(collectorProducerQueueMessageCount.LastMeasurement!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka"); 195Assert.Contains(collectorProducerQueueMessageCount.LastMeasurement!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1"); 198Assert.Contains(collectorConsumerQueueMessageCount.LastMeasurement!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka"); 199Assert.Contains(collectorConsumerQueueMessageCount.LastMeasurement!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1"); 202Assert.Contains(collectorProducerQueueSize.LastMeasurement!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka"); 203Assert.Contains(collectorProducerQueueSize.LastMeasurement!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1"); 206Assert.Contains(collectorNetworkTx.LastMeasurement!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka"); 207Assert.Contains(collectorNetworkTx.LastMeasurement!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1"); 208Assert.Contains(collectorNetworkTx.LastMeasurement!.Tags, t => t.Key == "type" && t.Value!.ToString() == "producer"); 211Assert.Contains(collectorNetworkTransmitted.LastMeasurement!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka"); 212Assert.Contains(collectorNetworkTransmitted.LastMeasurement!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1"); 213Assert.Contains(collectorNetworkTransmitted.LastMeasurement!.Tags, t => t.Key == "type" && t.Value!.ToString() == "producer"); 216Assert.Contains(collectorNetworkRx.LastMeasurement!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka"); 217Assert.Contains(collectorNetworkRx.LastMeasurement!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1"); 218Assert.Contains(collectorNetworkRx.LastMeasurement!.Tags, t => t.Key == "type" && t.Value!.ToString() == "producer"); 221Assert.Contains(collectorNetworkReceived.LastMeasurement!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka"); 222Assert.Contains(collectorNetworkReceived.LastMeasurement!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1"); 223Assert.Contains(collectorNetworkReceived.LastMeasurement!.Tags, t => t.Key == "type" && t.Value!.ToString() == "producer"); 226Assert.Contains(collectorMessageTx.LastMeasurement!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka"); 227Assert.Contains(collectorMessageTx.LastMeasurement!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1"); 228Assert.Contains(collectorMessageTx.LastMeasurement!.Tags, t => t.Key == "type" && t.Value!.ToString() == "producer"); 231Assert.Contains(collectorMessageTransmitted.LastMeasurement!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka"); 232Assert.Contains(collectorMessageTransmitted.LastMeasurement!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1"); 233Assert.Contains(collectorMessageTransmitted.LastMeasurement!.Tags, t => t.Key == "type" && t.Value!.ToString() == "producer"); 236Assert.Contains(collectorMessageRx.LastMeasurement!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka"); 237Assert.Contains(collectorMessageRx.LastMeasurement!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1"); 238Assert.Contains(collectorMessageRx.LastMeasurement!.Tags, t => t.Key == "type" && t.Value!.ToString() == "producer"); 241Assert.Contains(collectorMessageReceived.LastMeasurement!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka"); 242Assert.Contains(collectorMessageReceived.LastMeasurement!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1"); 243Assert.Contains(collectorMessageReceived.LastMeasurement!.Tags, t => t.Key == "type" && t.Value!.ToString() == "producer");
Aspire.Dashboard (61)
Components\Controls\Chart\ChartContainer.razor.cs (2)
221foreach (var item in _instrument.KnownAttributeValues.OrderBy(kvp => kvp.Key)) 225Name = item.Key
Components\Controls\Chart\ChartDataCalculator.cs (3)
107foreach (var trace in traces.OrderBy(kvp => kvp.Key)) 127Traces = traces.OrderBy(kvp => kvp.Key).Select(kvp => kvp.Value).ToList(), 252var percentileValue = CalculatePercentile(percentileValues.Key, currentBucketCounts!, explicitBounds!);
Components\Controls\Chart\MetricTable.razor.cs (1)
127var previousMetric = newMetrics.LastOrDefault(dt => dt.Key < xValue).Value;
Components\Controls\GridValue.razor.cs (1)
177_componentParameters[parameter.Key] = parameter.Value;
Components\Controls\StructuredLogDetails.razor.cs (2)
77.Select(a => new TelemetryPropertyViewModel { Name = a.Key, Key = $"unknown-{a.Key}", Value = a.Value })
Components\Dialogs\FilterDialog.razor.cs (1)
171.Select(kvp => new FieldValue { Value = kvp.Key, Count = kvp.Value })
Components\Dialogs\ManageDataDialog.razor.cs (1)
563.Select(kvp => kvp.Key)
Components\Pages\Resources.razor.cs (1)
967var escapedFilters = filters.Where(kvp => !kvp.Value).Select(kvp => StringUtils.Escape(kvp.Key)).ToList();
Components\Pages\TraceDetail.razor.cs (1)
618keys.Add(attribute.Key);
Model\EnvHelpers.cs (3)
22foreach (var envVar in environmentVariables.OrderBy(e => e.Key, StringComparer.OrdinalIgnoreCase)) 37builder.AppendLine(System.Globalization.CultureInfo.InvariantCulture, $"{envVar.Key}=\"{value}\""); 41builder.AppendLine(System.Globalization.CultureInfo.InvariantCulture, $"{envVar.Key}={value}");
Model\GenAI\GenAIItemPartViewModel.cs (2)
61? genericPart.AdditionalProperties?.Select(p => new GenAIPartPropertyViewModel { Name = p.Key, Value = p.Value.ToString() ?? string.Empty }).ToList() 144jsonObject[kvp.Key] = JsonNode.Parse(kvp.Value.GetRawText());
Model\GenAI\GenAISchemaHelpers.cs (1)
34schema.Properties[prop.Key] = ParseToolDefinitionSchema(propSchemaObj);
Model\GenAI\GenAIVisualizerDialogViewModel.cs (4)
400foreach (var (index, message) in promptMessages.OrderBy(kvp => kvp.Key)) 427foreach (var (index, message) in completionMessages.OrderBy(kvp => kvp.Key)) 464if (attr.Key.StartsWith(prefix, StringComparison.Ordinal)) 468var remainder = attr.Key.AsSpan(prefix.Length);
Model\Interaction\InputViewModel.cs (1)
46.Select(option => new SelectViewModel<string> { Id = option.Key, Name = option.Value, })
Model\Markdown\HighlightedCodeBlockRenderer.cs (1)
89copyButtonAttributes.AddProperty(item.Key, item.Value.ToString()!);
Model\TelemetryExportService.cs (9)
70.Where(kvp => kvp.Value.Contains(AspireDataType.ResourceDetails) && resourcesByName.ContainsKey(kvp.Key)) 71.Select(kvp => resourcesByName[kvp.Key]) 77.Select(kvp => kvp.Key) 633Key = property.Key, 670Key = attributes[i].Key, 681Key = additionalAttributes[i].Key, 765? resource.Properties.OrderBy(p => p.Key).ToDistinctDictionary( 766p => p.Key, 810jsonObject[field.Key] = ConvertPropertyValueToJsonNode(field.Value);
Otlp\Model\OtlpHelpers.cs (4)
238if (values[i].Key == name) 352if (values[i].Key == name) 395if (values[i].Key == name) 414sb.Append(CultureInfo.InvariantCulture, $"{kv.Key}: ");
Otlp\Model\OtlpInstrument.cs (6)
84var keys = KnownAttributeValues.Keys.Union(durableAttributes.Select(a => a.Key)).Distinct(); 135newInstrument.KnownAttributeValues.Add(item.Key, item.Value.ToList()); 139newInstrument.Dimensions.Add(item.Key, DimensionScope.Clone(item.Value, valuesStart, valuesEnd)); 160hashcode.Add(pair.Key); 173return string.Compare(x.Key, y.Key, StringComparison.Ordinal);
Otlp\Model\OtlpResource.cs (3)
349if (!string.Equals(x[i].Key, y[i].Key, StringComparisons.OtlpAttribute)) 367hashCode.Add(StringComparers.OtlpAttribute.GetHashCode(obj[i].Key));
Otlp\Model\OtlpResourceView.cs (4)
37Array.Sort(properties, (p1, p2) => string.Compare(p1.Key, p2.Key, StringComparisons.OtlpAttribute)); 56props.Add(new OtlpDisplayField { DisplayName = kv.Key, Key = $"unknown-{kv.Key}", Value = kv.Value });
Otlp\Model\OtlpSpan.cs (3)
130foreach (var kv in Attributes.OrderBy(a => a.Key)) 132props.Add(new OtlpDisplayField { DisplayName = kv.Key, Key = $"unknown-{kv.Key}", Value = kv.Value });
Otlp\Storage\TelemetryRepository.cs (6)
147if (kvp.Key.EqualsCompositeName(compositeName)) 413_logPropertyKeys.Add((resourceView.Resource, kvp.Key)); 869if (attribute.Key.Contains(fragment, StringComparisons.FullTextSearch) || 935if (attribute.Key.Contains(fragment, StringComparisons.FullTextSearch) || 1836_tracePropertyKeys.Add((resourceView.Resource, kvp.Key)); 2135ref var values = ref CollectionsMarshal.GetValueRefOrAddDefault(allKnownAttributes, knownAttributeValues.Key, out _);
Utils\DashboardUIHelpers.cs (1)
161maskedParts.Add($"{param.Key}={maskedValue}");
Aspire.Dashboard.Components.Tests (33)
Pages\ResourcesTests.cs (23)
58Assert.Collection(cut.Instance.PageViewModel.ResourceTypesToVisibility.OrderBy(kvp => kvp.Key), 61Assert.Equal("Type1", kvp.Key); 64Assert.Collection(cut.Instance.PageViewModel.ResourceStatesToVisibility.OrderBy(kvp => kvp.Key), 67Assert.Equal("Running", kvp.Key); 70Assert.Collection(cut.Instance.PageViewModel.ResourceHealthStatusesToVisibility.OrderBy(kvp => kvp.Key), 73Assert.Equal("Unhealthy", kvp.Key); 91Assert.Collection(cut.Instance.PageViewModel.ResourceTypesToVisibility.OrderBy(kvp => kvp.Key), 94Assert.Equal("Type1", kvp.Key); 99Assert.Equal("Type2", kvp.Key); 102Assert.Collection(cut.Instance.PageViewModel.ResourceStatesToVisibility.OrderBy(kvp => kvp.Key), 105Assert.Equal("Running", kvp.Key); 108Assert.Collection(cut.Instance.PageViewModel.ResourceHealthStatusesToVisibility.OrderBy(kvp => kvp.Key), 111Assert.Equal("Healthy", kvp.Key); 116Assert.Equal("Unhealthy", kvp.Key); 388Assert.Collection(cut.Instance.PageViewModel.ResourceTypesToVisibility.OrderBy(kvp => kvp.Key), 391Assert.Equal("Type1", kvp.Key); 396Assert.Equal("Type2", kvp.Key); 399Assert.Collection(cut.Instance.PageViewModel.ResourceStatesToVisibility.OrderBy(kvp => kvp.Key), 402Assert.Equal("Finished", kvp.Key); 407Assert.Equal("Running", kvp.Key); 412Assert.Collection(cut.Instance.PageViewModel.ResourceHealthStatusesToVisibility.OrderBy(kvp => kvp.Key), 415Assert.Equal(string.Empty, kvp.Key); 420Assert.Equal("Healthy", kvp.Key);
tests\Shared\Logging\LogTestHelpers.cs (1)
31return list?.SingleOrDefault(kvp => kvp.Key == key).Value;
tests\Shared\Logging\LogValuesAssert.cs (3)
54return string.Join(",", logValues.Select(kvp => $"[{kvp.Key} {kvp.Value}]")); 61return string.Equals(x.Key, y.Key) && object.Equals(x.Value, y.Value);
tests\Shared\Telemetry\TelemetryTestHelpers.cs (6)
61scope.Attributes.Add(new KeyValue { Key = attribute.Key, Value = new AnyValue { StringValue = attribute.Value } }); 124point.Attributes.Add(new KeyValue { Key = attribute.Key, Value = new AnyValue { StringValue = attribute.Value } }); 149e.Attributes.Add(new KeyValue { Key = attribute.Key, Value = new AnyValue { StringValue = attribute.Value } }); 181span.Attributes.Add(new KeyValue { Key = attribute.Key, Value = new AnyValue { StringValue = attribute.Value } }); 206logRecord.Attributes.Add(new KeyValue { Key = attribute.Key, Value = new AnyValue { StringValue = attribute.Value } }); 227resource.Attributes.Add(new KeyValue { Key = attribute.Key, Value = new AnyValue { StringValue = attribute.Value } });
Aspire.Dashboard.Tests (105)
Integration\OtlpHttpJsonTests.cs (8)
551Assert.Equal("my.span.attr", a.Key); 607Assert.Equal("string.attribute", a.Key); 612Assert.Equal("boolean.attribute", a.Key); 617Assert.Equal("int.attribute", a.Key); 622Assert.Equal("double.attribute", a.Key); 627Assert.Equal("array.attribute", a.Key); 631Assert.Equal("map.attribute", a.Key); 680Assert.Equal("event.attribute", a.Key);
Integration\ResponseCompressionTests.cs (2)
31Assert.DoesNotContain(response.Content.Headers, h => h.Key == "Content-Encoding"); 53Assert.Contains(response.Content.Headers, h => h.Key == "Content-Encoding" && h.Value.Contains("br"));
Model\ResourceViewModelTests.cs (4)
85var (key, vm) = (e.Key, e.Value); 133vm.Properties.OrderBy(p => p.Key), 136Assert.Equal("Property1", p.Key); 148Assert.Equal("Property2", p.Key);
Model\TelemetryExportServiceTests.cs (1)
410var peerService = attributes.FirstOrDefault(a => a.Key == "peer.service");
Model\TelemetryImportServiceTests.cs (2)
368Assert.DoesNotContain(importedLogs.Items[0].Attributes, a => a.Key == OtlpHelpers.AspireLogIdAttribute); 374Assert.Contains(importedLogs.Items[0].Attributes, a => a.Key == "custom.attr" && a.Value == "custom-value");
Telemetry\ComponentTelemetryContextTests.cs (5)
81Assert.Collection(telemetryContext.Properties.OrderBy(p => p.Key), 84Assert.Equal("Aspire.Dashboard.ComponentId", kvp.Key); 89Assert.Equal("Aspire.Dashboard.ComponentType", kvp.Key); 94Assert.Equal("Aspire.Dashboard.UserAgent", kvp.Key); 99Assert.Equal("Test", kvp.Key);
TelemetryRepositoryTests\LogTests.cs (11)
83Assert.Equal("Log", p.Key); 675Assert.Equal("Key0", p.Key); 680Assert.Equal("Key1", p.Key); 685Assert.Equal("Key2", p.Key); 690Assert.Equal("Key3", p.Key); 695Assert.Equal("Key4", p.Key); 942Assert.Equal("Log", p.Key); 965Assert.Equal("Log", p.Key); 1038Assert.Equal("key-1", p.Key); 1049Assert.Equal("key-2", p.Key); 1386Assert.DoesNotContain(resource.Attributes, a => a.Key == "logrecord.event.name");
TelemetryRepositoryTests\MetricsTests.cs (22)
163Assert.Equal("Meter_Key0", p.Key); 168Assert.Equal("Meter_Key1", p.Key); 173Assert.Equal("Meter_Key2", p.Key); 178Assert.Equal("Meter_Key3", p.Key); 183Assert.Equal("Meter_Key4", p.Key); 192Assert.Equal("Meter_Key0", p.Key); 197Assert.Equal("Meter_Key1", p.Key); 202Assert.Equal("Meter_Key2", p.Key); 207Assert.Equal("Meter_Key3", p.Key); 212Assert.Equal("Meter_Key4", p.Key); 279Assert.Equal("Meter_Key0", p.Key); 288Assert.Equal("Meter_Key0", p.Key); 293Assert.Equal("Metric_Key0", p.Key); 298Assert.Equal("Metric_Key1", p.Key); 303Assert.Equal("Metric_Key2", p.Key); 308Assert.Equal("Metric_Key3", p.Key); 380Assert.Collection(instrumentData.KnownAttributeValues.OrderBy(kvp => kvp.Key), 383Assert.Equal("key1", e.Key); 388Assert.Equal("key2", e.Key); 397Assert.Equal("key1", exemplar.Attributes[0].Key); 423exemplar.FilteredAttributes.Add(new KeyValue { Key = attribute.Key, Value = new AnyValue { StringValue = attribute.Value } }); 620Assert.Equal("key-1", knownValues.Key);
TelemetryRepositoryTests\OtlpHelpersTests.cs (22)
181Assert.Equal("key1", a.Key); 211Assert.Equal("key1", a.Key); 216Assert.Equal("key2", a.Key); 221Assert.Equal("key3", a.Key); 255Assert.Equal("key1", a.Key); 260Assert.Equal("key2", a.Key); 265Assert.Equal("key3", a.Key); 294Assert.Equal("parentkey1", a.Key); 299Assert.Equal("key1", a.Key); 330Assert.Equal("parentkey1", a.Key); 335Assert.Equal("key1", a.Key); 340Assert.Equal("key2", a.Key); 373Assert.Equal("parentkey1", a.Key); 378Assert.Equal("parentkey2", a.Key); 383Assert.Equal("parentkey3", a.Key); 406Assert.Equal("key1", a.Key); 411Assert.Equal("key2", a.Key); 442Assert.Equal("key1", a.Key); 447Assert.Equal("key2", a.Key); 490Assert.Equal("key1", a.Key); 495Assert.Equal("key2", a.Key); 500Assert.Equal("key3", a.Key);
TelemetryRepositoryTests\TraceTests.cs (18)
573Assert.Equal("key1", a.Key); 650Assert.Equal("key2", a.Key); 661Assert.Equal("key1", a.Key); 675Assert.Equal("key2", a.Key); 686Assert.Equal("key1", a.Key); 816Assert.Equal("Key0", p.Key); 821Assert.Equal("Key1", p.Key); 826Assert.Equal("Key2", p.Key); 831Assert.Equal("Key3", p.Key); 836Assert.Equal("Key4", p.Key); 1632Assert.Equal("prop1", p.Key); 1641Assert.Equal("prop1", p.Key); 1646Assert.Equal("prop2", p.Key); 1667Assert.Equal("prop1", p.Key); 1677Assert.Equal("prop1", p.Key); 1682Assert.Equal("prop2", p.Key); 1692Assert.Equal("prop1", p.Key); 1697Assert.Equal("prop2", p.Key);
tests\Shared\Logging\LogTestHelpers.cs (1)
31return list?.SingleOrDefault(kvp => kvp.Key == key).Value;
tests\Shared\Logging\LogValuesAssert.cs (3)
54return string.Join(",", logValues.Select(kvp => $"[{kvp.Key} {kvp.Value}]")); 61return string.Equals(x.Key, y.Key) && object.Equals(x.Value, y.Value);
tests\Shared\Telemetry\TelemetryTestHelpers.cs (6)
61scope.Attributes.Add(new KeyValue { Key = attribute.Key, Value = new AnyValue { StringValue = attribute.Value } }); 124point.Attributes.Add(new KeyValue { Key = attribute.Key, Value = new AnyValue { StringValue = attribute.Value } }); 149e.Attributes.Add(new KeyValue { Key = attribute.Key, Value = new AnyValue { StringValue = attribute.Value } }); 181span.Attributes.Add(new KeyValue { Key = attribute.Key, Value = new AnyValue { StringValue = attribute.Value } }); 206logRecord.Attributes.Add(new KeyValue { Key = attribute.Key, Value = new AnyValue { StringValue = attribute.Value } }); 227resource.Attributes.Add(new KeyValue { Key = attribute.Key, Value = new AnyValue { StringValue = attribute.Value } });
Aspire.EndToEnd.Tests (4)
tests\Shared\TemplatesTesting\AspireProject.cs (2)
194AppHostProcess.StartInfo.Environment[item.Key] = item.Value; 195_testOutput.WriteLine($"\t[{item.Key}] = {item.Value}");
tests\Shared\TemplatesTesting\ToolCommand.cs (2)
249_testOutput.WriteLine($"{_msgPrefix}\t[{item.Key}] = {item.Value}"); 250psi.Environment[item.Key] = item.Value;
Aspire.Hosting (55)
ApplicationModel\CertificateTrustExecutionConfigurationGatherer.cs (1)
121additionalData.CustomBundlesFactories[bundleFactory.Key] = bundleFactory.Value;
ApplicationModel\EnvironmentVariablesConfigurationGatherer.cs (1)
33context.EnvironmentVariables[kvp.Key] = kvp.Value;
ApplicationModel\ExecutableLaunchRecipe.cs (1)
399static variable => variable.Key,
ApplicationModel\ExecutionConfigurationGathererContext.cs (2)
65resolvedEnvironmentVariables[kvp.Key] = (kvp.Value, resolvedValue.Value); 74resourceLogger.LogError(ex, "Failed to resolve environment variable '{EnvironmentVariable}' for resource '{ResourceName}'. A dependency may have failed to start.", kvp.Key, resource.Name);
ApplicationModel\ExecutionConfigurationResult.cs (1)
24public IEnumerable<KeyValuePair<string, string>> EnvironmentVariables => EnvironmentVariablesWithUnprocessed.Select(kvp => new KeyValuePair<string, string>(kvp.Key, kvp.Value.Processed));
ApplicationModel\ResourceCommandService.cs (1)
629if (!argument.AllowCustomChoice && argument.Options is { } options && !options.Any(o => o.Key == value))
ApplicationModel\ResourceLoggerService.cs (1)
35value((logger.Key, logger.Value));
ApplicationModel\ResourceNotificationService.cs (2)
749resourceEvent = new ResourceEvent(m.Value.Resource, m.Key, m.Value.LastSnapshot); 781var resourceId = state.Key;
Ats\HealthCheckExports.cs (1)
60pair => pair.Key,
Backchannel\AuxiliaryBackchannelRpcTarget.cs (4)
381values[property.Key] = ConvertArgumentValue(property.Key, property.Value); 1408jsonObject[property.Key] = property.Value; 1492result[option.Key] = option.Value;
ConnectionPropertiesExtensions.cs (2)
29dict[kv.Key] = kv.Value; 34dict[kv.Key] = kv.Value;
Dashboard\DashboardService.cs (2)
459values[field.Key] = ConvertArgumentValue(field.Key, field.Value);
Dashboard\ResourceSnapshot.cs (1)
79structValue.Fields[property.Key] = ConvertToValue(property.Value);
Dcp\ContainerCreator.cs (5)
347spec.Env = configuration.EnvironmentVariables.Select(kvp => new EnvVar { Name = kvp.Key, Value = kvp.Value }).ToList(); 751var bundleId = bundleFactory.Key; 948dcpBuildArgs.Add(new EnvVar() { Name = buildArgument.Key, Value = valueString }); 964dcpBuildSecrets.Add(new BuildContextSecret { Id = buildSecret.Key, Type = "file", Source = valueString }); 968dcpBuildSecrets.Add(new BuildContextSecret { Id = buildSecret.Key, Type = "env", Value = valueString });
Dcp\ExecutableConfigurationResolver.cs (1)
107File.WriteAllBytes(Path.Join(customBundleOutputPath, bundleFactory.Key), bundleBytes);
Dcp\ExecutableCreator.cs (1)
181.Select(static variable => new EnvVar { Name = variable.Key, Value = variable.Value })
Devcontainers\DevcontainerSettingsWriter.cs (1)
147let forwardedPort = props.Key
InteractionService.cs (2)
224if (input.Options == null || !input.Options.Any(o => o.Key == input.Value)) 605if (options != null && !options.Any(o => o.Key == value))
Orchestrator\ApplicationOrchestrator.cs (2)
92connectionProperties[property.Key] = await property.Value.GetValueAsync(token).ConfigureAwait(false); 100_logger.LogWarning(ex, "Failed to resolve connection property {ConnectionPropertyName} for resource {ResourceName}.", property.Key, resourceWithConnectionString.Name);
ParameterResourceBuilderExtensions.cs (1)
271Options = options.Options is { Count: > 0 } optionValues ? optionValues.Select(static option => KeyValuePair.Create(option.Key, option.Value)).ToArray() : null,
Pipelines\DistributedApplicationPipeline.cs (1)
1332.ToDictionary(g => g.Key, g => g.Select(kvp => kvp.Key).OrderBy(s => s, StringComparer.Ordinal).ToList());
Pipelines\Internal\JsonFlattener.cs (4)
38var keys = kvp.Key.Split(':'); 67? kvp.Key 68: string.IsNullOrEmpty(kvp.Key) 70: $"{prefix}:{kvp.Key}";
ProjectResourceBuilderExtensions.cs (1)
791context.EnvironmentVariables.TryAdd(envVar.Key, value);
Publishing\ContainerRuntimeBase.cs (6)
235? $" --build-arg \"{buildArg.Key}={buildArg.Value}\"" 236: $" --build-arg \"{buildArg.Key}\""; 254result += $" --secret \"id={buildSecret.Key},type=file,src={buildSecret.Value.Value}\""; 258result += $" --secret \"id={buildSecret.Key},type=env\""; 262result += $" --secret \"id={buildSecret.Key},type=env,env={buildSecret.Key.ToUpperInvariant()}\"";
Publishing\DockerContainerRuntime.cs (1)
97environmentVariables[buildSecret.Key.ToUpperInvariant()] = buildSecret.Value.Value;
Publishing\ManifestPublishingContext.cs (1)
558Writer.WriteString(kvp.Key, manifestExpression);
Publishing\PodmanContainerRuntime.cs (2)
141Service = g.Key, 205environmentVariables[buildSecret.Key.ToUpperInvariant()] = buildSecret.Value.Value;
Publishing\ResourceContainerImageManager.cs (2)
466resolvedBuildArguments[buildArg.Key] = await ResolveValue(buildArg.Value, cancellationToken).ConfigureAwait(false); 475resolvedBuildSecrets[buildSecret.Key] = new BuildImageSecretValue(resolvedValue, secretType);
ResourceBuilderExtensions.cs (2)
1156context.EnvironmentVariables[$"{prefix}{connectionProperty.Key.ToUpperInvariant()}"] = connectionProperty.Value; 1173if (string.Equals(connectionProperty.Key, key, StringComparison.OrdinalIgnoreCase))
UserSecrets\UserSecretsManagerFactory.cs (2)
203.ToDictionary(i => i.Key, i => i.Value); 211contents[secret.Key] = secret.Value;
Aspire.Hosting.Analyzers (2)
AppHostAnalyzer.DetectInvalidModelNames.cs (2)
22var modelTypes = operation.Key.ModelTypes; 23var token = operation.Key.ModelNameToken;
Aspire.Hosting.Azure (15)
AzureBicepResource.cs (2)
261context.Writer.WritePropertyName(input.Key); 274context.Writer.WriteString(input.Key, value);
AzureProvisioningController.cs (2)
3199if (string.Equals(option.Key, location, StringComparisons.AzureLocation) || 3204return option.Key;
AzureProvisioningResource.cs (2)
282if (distinctInfrastructureParametersLookup.ContainsKey(aspireParameter.Key)) 290var parameter = new ProvisioningParameter(aspireParameter.Key, typeof(string)) { IsSecure = isSecure };
AzurePublishingContext.cs (5)
323if (parameter.Key == AzureBicepResource.KnownParameters.UserPrincipalId && parameter.Value is null) 325module.Parameters.Add(parameter.Key, principalId); 328if (parameter.Key == AzureBicepResource.KnownParameters.PrincipalId && parameter.Value is null) 330module.Parameters.Add(parameter.Key, principalId); 336module.Parameters.Add(parameter.Key, value);
Provisioning\BicepUtilities.cs (2)
50if (skipKnownValues && s_knownParameterNames.Contains(parameter.Key) && parameterValue is null) 55parameters[parameter.Key] = new JsonObject()
Provisioning\Provisioners\BicepProvisioner.cs (2)
106resource.Outputs[item.Key] = item.Value?.Prop("value")?.ToString(); 809resource.Outputs[item.Key] = item.Value?.Prop("value")?.ToString();
Aspire.Hosting.Azure.AppContainers (5)
AzureContainerAppExtensions.cs (2)
170.Select(pair => pair.Value.Where(environment => includedEnvironmentNames.Contains(environment.Key)).ToArray()) 186$"'{string.Join("', '", group.Select(environment => environment.Key).Order(StringComparer.Ordinal))}' resolve to {group.Key}")));
BaseContainerAppContext.cs (3)
441var secretName = kv.Key.Replace("_", "-").ToLowerInvariant(); 480SecretType.None => new ContainerAppEnvironmentVariable { Name = kv.Key, Value = argValue }, 481SecretType.Normal or SecretType.KeyVault => new ContainerAppEnvironmentVariable { Name = kv.Key, SecretRef = (string)val },
Aspire.Hosting.Azure.AppService (3)
AzureAppServiceWebsiteContext.cs (3)
511site.SiteConfig.AppSettings.Add(new AppServiceNameValuePair { Name = kv.Key, Value = value }); 515slot.SiteConfig.AppSettings.Add(new AppServiceNameValuePair { Name = kv.Key, Value = value }); 521slotConfigNames.Add(kv.Key);
Aspire.Hosting.Azure.Kusto.Tests (8)
AzureKustoConnectionPropertiesTests.cs (8)
23Assert.Equal("Uri", property.Key); 40Assert.Equal("Uri", property.Key); 53var properties = ((IResourceWithConnectionString)resource).GetConnectionProperties().ToDictionary(x => x.Key, x => x.Value); 59Assert.Equal("Uri", property.Key); 64Assert.Equal("DatabaseName", property.Key); 77var properties = ((IResourceWithConnectionString)resource).GetConnectionProperties().ToDictionary(x => x.Key, x => x.Value); 83Assert.Equal("Uri", property.Key); 88Assert.Equal("DatabaseName", property.Key);
Aspire.Hosting.Azure.PostgreSQL (7)
AzurePostgresExtensions.cs (6)
253if (!azureDatabases.TryGetValue(database.Key, out var existingDb)) 255throw new InvalidOperationException($"Could not find a {nameof(AzurePostgresFlexibleServerDatabaseResource)} with name {database.Key}."); 258var innerDb = postgresContainer.AddDatabase(database.Key, database.Value); 508var bicepIdentifier = Infrastructure.NormalizeBicepIdentifier(databaseNames.Key); 567var dbSecret = new KeyVaultSecret(Infrastructure.NormalizeBicepIdentifier(database.Key + "_connectionString")) 570Name = AzurePostgresFlexibleServerResource.GetDatabaseKeyVaultSecretName(database.Key),
AzurePostgresFlexibleServerResource.cs (1)
302var propertiesDictionary = properties.ToDictionary(kvp => kvp.Key, kvp => kvp.Value, StringComparers.ResourceName);
Aspire.Hosting.Azure.ServiceBus (1)
AzureServiceBusRule.cs (1)
61rule.CorrelationFilter.ApplicationProperties[property.Key] = property.Value;
Aspire.Hosting.Azure.Sql (6)
AzureSqlExtensions.cs (5)
204if (!azureDatabases.TryGetValue(database.Key, out var existingDb)) 206throw new InvalidOperationException($"Could not find a {nameof(AzureSqlDatabaseResource)} with name {database.Key}."); 209var innerDb = sqlContainer.AddDatabase(database.Key, database.Value.DatabaseName); 236var sqlDatabase = CreateAzureSQLDatabase(sqlServer, database.Key, database.Value); 251var sqlDatabase = CreateAzureSQLDatabase(sqlServer, database.Key, database.Value.DatabaseName);
AzureSqlServerResource.cs (1)
169kvp => kvp.Key,
Aspire.Hosting.Azure.Tests (203)
AzureBlobStorageConnectionPropertiesTests.cs (2)
19var properties = ((IResourceWithConnectionString)resource).GetConnectionProperties().ToDictionary(x => x.Key, x => x.Value); 25Assert.Equal("Uri", property.Key);
AzureBlobStorageContainerConnectionPropertiesTests.cs (3)
19var properties = ((IResourceWithConnectionString)resource).GetConnectionProperties().ToDictionary(x => x.Key, x => x.Value); 25Assert.Equal("Uri", property.Key); 30Assert.Equal("BlobContainerName", property.Key);
AzureCosmosDBConnectionPropertiesTests.cs (7)
21Assert.Equal("Uri", property.Key); 39Assert.Equal("Uri", property.Key); 44Assert.Equal("AccountKey", property.Key); 49Assert.Equal("ConnectionString", property.Key); 73Assert.Equal("Uri", property.Key); 78Assert.Equal("AccountKey", property.Key); 83Assert.Equal("ConnectionString", property.Key);
AzureCosmosDBContainerConnectionPropertiesTests.cs (15)
20var properties = ((IResourceWithConnectionString)resource).GetConnectionProperties().ToDictionary(x => x.Key, x => x.Value); 26Assert.Equal("Uri", property.Key); 31Assert.Equal("DatabaseName", property.Key); 36Assert.Equal("ContainerName", property.Key); 50var properties = ((IResourceWithConnectionString)resource).GetConnectionProperties().ToDictionary(x => x.Key, x => x.Value); 56Assert.Equal("Uri", property.Key); 61Assert.Equal("AccountKey", property.Key); 66Assert.Equal("ConnectionString", property.Key); 71Assert.Equal("DatabaseName", property.Key); 76Assert.Equal("ContainerName", property.Key); 102Assert.Equal("Uri", property.Key); 107Assert.Equal("AccountKey", property.Key); 112Assert.Equal("ConnectionString", property.Key); 117Assert.Equal("DatabaseName", property.Key); 122Assert.Equal("ContainerName", property.Key);
AzureCosmosDBDatabaseConnectionPropertiesTests.cs (12)
19var properties = ((IResourceWithConnectionString)resource).GetConnectionProperties().ToDictionary(x => x.Key, x => x.Value); 25Assert.Equal("Uri", property.Key); 30Assert.Equal("DatabaseName", property.Key); 43var properties = ((IResourceWithConnectionString)resource).GetConnectionProperties().ToDictionary(x => x.Key, x => x.Value); 49Assert.Equal("Uri", property.Key); 54Assert.Equal("AccountKey", property.Key); 59Assert.Equal("ConnectionString", property.Key); 64Assert.Equal("DatabaseName", property.Key); 89Assert.Equal("Uri", property.Key); 94Assert.Equal("AccountKey", property.Key); 99Assert.Equal("ConnectionString", property.Key); 104Assert.Equal("DatabaseName", property.Key);
AzureDataLakeStorageFileSystemConnectionPropertiesTests.cs (3)
20.ToDictionary(x => x.Key, x => x.Value); 26Assert.Equal("Uri", property.Key); 31Assert.Equal("DataLakeFileSystemName", property.Key);
AzureDataLakeStorageResourceGetConnectionPropertiesTests.cs (1)
22Assert.Equal("Uri", property.Key);
AzureEnvironmentResourceExtensionsTests.cs (11)
194Assert.Contains(tenantInput.Options!, option => option.Key == "87654321-4321-4321-4321-210987654321"); 204Assert.Contains(subscriptionInput.Options!, option => option.Key == "12345678-1234-1234-1234-123456789012"); 213Assert.Contains(resourceGroupInput.Options!, option => option.Key == "rg-test-2"); 248Assert.Contains(tenantInput.Options!, option => option.Key == AzureContextOptionsArmClient.SecondTenantId); 259Assert.DoesNotContain(subscriptionInput.Options!, option => option.Key == AzureContextOptionsArmClient.FirstSubscriptionId); 260Assert.Contains(subscriptionInput.Options!, option => option.Key == AzureContextOptionsArmClient.SecondSubscriptionId); 268Assert.Contains(resourceGroupInput.Options!, option => option.Key == "rg-second"); 298Assert.Contains(locationInput.Options!, option => option.Key == "eastus"); 299Assert.Contains(locationInput.Options!, option => option.Key == "westus2"); 2189Assert.Contains(storage.Resource.Outputs, output => output.Key == "blobEndpoint"); 2971Assert.Contains(options, option => option.Key == "westus2");
AzureEventHubConnectionPropertiesTests.cs (4)
19var properties = ((IResourceWithConnectionString)resource).GetConnectionProperties().ToDictionary(x => x.Key, x => x.Value); 25Assert.Equal("Host", property.Key); 30Assert.Equal("Uri", property.Key); 35Assert.Equal("EventHubName", property.Key);
AzureEventHubConsumerGroupConnectionPropertiesTests.cs (5)
20var properties = ((IResourceWithConnectionString)resource).GetConnectionProperties().ToDictionary(x => x.Key, x => x.Value); 26Assert.Equal("Host", property.Key); 31Assert.Equal("Uri", property.Key); 36Assert.Equal("EventHubName", property.Key); 41Assert.Equal("ConsumerGroupName", property.Key);
AzureEventHubsConnectionPropertiesTests.cs (6)
23Assert.Equal("Host", property.Key); 28Assert.Equal("Uri", property.Key); 45Assert.Equal("Host", property.Key); 50Assert.Equal("Port", property.Key); 55Assert.Equal("Uri", property.Key); 60Assert.Equal("ConnectionString", property.Key);
AzureKeyVaultConnectionPropertiesTests.cs (1)
23Assert.Equal("Uri", property.Key);
AzureKeyVaultTests.cs (2)
84Assert.Equal("MY_SECRET", runKvp.Key); 87Assert.Equal("MY_SECRET", pubishKvp.Key);
AzureManagedRedisConnectionPropertiesTests.cs (7)
23Assert.Equal("Host", property.Key); 28Assert.Equal("Port", property.Key); 33Assert.Equal("Uri", property.Key); 50Assert.Equal("Host", property.Key); 55Assert.Equal("Port", property.Key); 60Assert.Equal("Uri", property.Key); 65Assert.Equal("Password", property.Key);
AzureOpenAIConnectionPropertiesTests.cs (2)
18var properties = ((IResourceWithConnectionString)resource).GetConnectionProperties().ToDictionary(x => x.Key, x => x.Value); 24Assert.Equal("Uri", property.Key);
AzureOpenAIDeploymentConnectionPropertiesTests.cs (3)
19var properties = ((IResourceWithConnectionString)resource).GetConnectionProperties().ToDictionary(x => x.Key, x => x.Value); 25Assert.Equal("Uri", property.Key); 30Assert.Equal("ModelName", property.Key);
AzurePostgresExtensionsTests.cs (1)
395var databaseUri = Assert.Single(env, e => e.Key == "DATABASE_URI");
AzurePostgresFlexibleServerConnectionPropertiesTests.cs (13)
18var properties = ((IResourceWithConnectionString)resource).GetConnectionProperties().ToDictionary(x => x.Key, x => x.Value); 24Assert.Equal("Host", property.Key); 29Assert.Equal("Port", property.Key); 34Assert.Equal("Uri", property.Key); 39Assert.Equal("JdbcConnectionString", property.Key); 51var properties = ((IResourceWithConnectionString)resource).GetConnectionProperties().ToDictionary(x => x.Key, x => x.Value); 54properties.OrderBy(p => p.Key), 57Assert.Equal("Host", property.Key); 62Assert.Equal("JdbcConnectionString", property.Key); 67Assert.Equal("Password", property.Key); 72Assert.Equal("Port", property.Key); 77Assert.Equal("Uri", property.Key); 82Assert.Equal("Username", property.Key);
AzurePostgresFlexibleServerDatabaseConnectionPropertiesTests.cs (16)
19var properties = ((IResourceWithConnectionString)resource).GetConnectionProperties().ToDictionary(x => x.Key, x => x.Value); 22properties.OrderBy(p => p.Key), 25Assert.Equal("DatabaseName", property.Key); 30Assert.Equal("Host", property.Key); 35Assert.Equal("JdbcConnectionString", property.Key); 40Assert.Equal("Port", property.Key); 45Assert.Equal("Uri", property.Key); 58var properties = ((IResourceWithConnectionString)resource).GetConnectionProperties().ToDictionary(x => x.Key, x => x.Value); 61properties.OrderBy(p => p.Key), 64Assert.Equal("DatabaseName", property.Key); 69Assert.Equal("Host", property.Key); 74Assert.Equal("JdbcConnectionString", property.Key); 79Assert.Equal("Password", property.Key); 84Assert.Equal("Port", property.Key); 89Assert.Equal("Uri", property.Key); 94Assert.Equal("Username", property.Key);
AzureQueueStorageConnectionPropertiesTests.cs (2)
19var properties = ((IResourceWithConnectionString)resource).GetConnectionProperties().ToDictionary(x => x.Key, x => x.Value); 25Assert.Equal("Uri", property.Key);
AzureQueueStorageQueueConnectionPropertiesTests.cs (3)
19var properties = ((IResourceWithConnectionString)resource).GetConnectionProperties().ToDictionary(x => x.Key, x => x.Value); 25Assert.Equal("Uri", property.Key); 30Assert.Equal("QueueName", property.Key);
AzureSearchConnectionPropertiesTests.cs (2)
18var properties = ((IResourceWithConnectionString)resource).GetConnectionProperties().ToDictionary(x => x.Key, x => x.Value); 24Assert.Equal("Uri", property.Key);
AzureServiceBusConnectionPropertiesTests.cs (6)
23Assert.Equal("Host", property.Key); 28Assert.Equal("Uri", property.Key); 45Assert.Equal("Host", property.Key); 50Assert.Equal("Port", property.Key); 55Assert.Equal("Uri", property.Key); 60Assert.Equal("ConnectionString", property.Key);
AzureServiceBusQueueConnectionPropertiesTests.cs (4)
19var properties = ((IResourceWithConnectionString)resource).GetConnectionProperties().ToDictionary(x => x.Key, x => x.Value); 25Assert.Equal("Host", property.Key); 30Assert.Equal("Uri", property.Key); 35Assert.Equal("QueueName", property.Key);
AzureServiceBusSubscriptionConnectionPropertiesTests.cs (5)
20var properties = ((IResourceWithConnectionString)resource).GetConnectionProperties().ToDictionary(x => x.Key, x => x.Value); 26Assert.Equal("Host", property.Key); 31Assert.Equal("Uri", property.Key); 36Assert.Equal("TopicName", property.Key); 41Assert.Equal("SubscriptionName", property.Key);
AzureServiceBusTopicConnectionPropertiesTests.cs (4)
19var properties = ((IResourceWithConnectionString)resource).GetConnectionProperties().ToDictionary(x => x.Key, x => x.Value); 25Assert.Equal("Host", property.Key); 30Assert.Equal("Uri", property.Key); 35Assert.Equal("TopicName", property.Key);
AzureSignalRConnectionPropertiesTests.cs (1)
23Assert.Equal("Uri", property.Key);
AzureSqlConnectionPropertiesTests.cs (5)
18var properties = ((IResourceWithConnectionString)resource).GetConnectionProperties().ToDictionary(x => x.Key, x => x.Value); 24Assert.Equal("Host", property.Key); 29Assert.Equal("Port", property.Key); 34Assert.Equal("Uri", property.Key); 39Assert.Equal("JdbcConnectionString", property.Key);
AzureSqlDatabaseConnectionPropertiesTests.cs (30)
18var properties = ((IResourceWithConnectionString)resource).GetConnectionProperties().ToDictionary(x => x.Key, x => x.Value); 21properties.OrderBy(p => p.Key), 24Assert.Equal("Host", property.Key); 29Assert.Equal("JdbcConnectionString", property.Key); 34Assert.Equal("Port", property.Key); 39Assert.Equal("Uri", property.Key); 52var properties = ((IResourceWithConnectionString)resource).GetConnectionProperties().ToDictionary(x => x.Key, x => x.Value); 55properties.OrderBy(p => p.Key), 58Assert.Equal("DatabaseName", property.Key); 63Assert.Equal("Host", property.Key); 68Assert.Equal("JdbcConnectionString", property.Key); 73Assert.Equal("Port", property.Key); 78Assert.Equal("Uri", property.Key); 97var properties = ((IResourceWithConnectionString)resource).GetConnectionProperties().ToDictionary(x => x.Key, x => x.Value); 100properties.OrderBy(p => p.Key), 103Assert.Equal("Host", property.Key); 108Assert.Equal("JdbcConnectionString", property.Key); 113Assert.Equal("Password", property.Key); 118Assert.Equal("Port", property.Key); 123Assert.Equal("Uri", property.Key); 128Assert.Equal("Username", property.Key); 148var properties = ((IResourceWithConnectionString)resource).GetConnectionProperties().ToDictionary(x => x.Key, x => x.Value); 151properties.OrderBy(p => p.Key), 154Assert.Equal("DatabaseName", property.Key); 159Assert.Equal("Host", property.Key); 164Assert.Equal("JdbcConnectionString", property.Key); 169Assert.Equal("Password", property.Key); 174Assert.Equal("Port", property.Key); 179Assert.Equal("Uri", property.Key); 184Assert.Equal("Username", property.Key);
AzureStorageConnectionPropertiesTests.cs (3)
24Assert.Equal("Uri", property.Key); 42Assert.Equal("Uri", property.Key); 60Assert.Equal("Uri", property.Key);
AzureTableStorageConnectionPropertiesTests.cs (2)
19var properties = ((IResourceWithConnectionString)resource).GetConnectionProperties().ToDictionary(x => x.Key, x => x.Value); 25Assert.Equal("Uri", property.Key);
AzureWebPubSubConnectionPropertiesTests.cs (2)
18var properties = ((IResourceWithConnectionString)resource).GetConnectionProperties().ToDictionary(x => x.Key, x => x.Value); 24Assert.Equal("Uri", property.Key);
DefaultArmClientProviderTests.cs (1)
886=> _headers.Select(static header => new HttpHeader(header.Key, string.Join(",", header.Value)));
FoundryConnectionPropertiesTests.cs (5)
23Assert.Equal("Uri", property.Key); 28Assert.Equal("AIInferenceUri", property.Key); 49Assert.Equal("Uri", property.Key); 54Assert.Equal("AIInferenceUri", property.Key); 59Assert.Equal("Key", property.Key);
FoundryDeploymentConnectionPropertiesTests.cs (11)
30Assert.Equal("Uri", property.Key); 35Assert.Equal("AIInferenceUri", property.Key); 40Assert.Equal("Key", property.Key); 45Assert.Equal("ModelName", property.Key); 50Assert.Equal("Format", property.Key); 55Assert.Equal("Version", property.Key); 73Assert.Equal("Uri", property.Key); 78Assert.Equal("AIInferenceUri", property.Key); 83Assert.Equal("ModelName", property.Key); 89Assert.Equal("Format", property.Key); 94Assert.Equal("Version", property.Key);
ProvisioningContextProviderTests.cs (3)
395inputsInteraction.Inputs[BaseProvisioningContextProvider.LocationName].Value = inputsInteraction.Inputs[BaseProvisioningContextProvider.LocationName].Options!.First(kvp => kvp.Key == "westus").Value; 451inputsInteraction.Inputs[BaseProvisioningContextProvider.LocationName].Value = inputsInteraction.Inputs[BaseProvisioningContextProvider.LocationName].Options!.First(kvp => kvp.Key == "westus").Value; 556inputsInteraction.Inputs[BaseProvisioningContextProvider.LocationName].Value = inputsInteraction.Inputs[BaseProvisioningContextProvider.LocationName].Options!.First(kvp => kvp.Key == "westus").Value;
Aspire.Hosting.Azure.WebPubSub (2)
AzureWebPubSubExtensions.cs (2)
106var hubName = setting.Key; 112Name = setting.Key,
Aspire.Hosting.Browsers (1)
BrowserLogsConfigurationManager.cs (1)
252context.Input.Options = [.. options.Select(static pair => new KeyValuePair<string, string>(pair.Key, pair.Value))];
Aspire.Hosting.Browsers.Tests (4)
BrowserLogsBuilderExtensionsTests.cs (3)
132Assert.All(browserInput.Options!, option => Assert.Contains(option.Key, knownBrowserOptionKeys)); 133Assert.Contains(profileInput.Options!, option => option.Key == "Profile 1" && option.Value == "Profile 1"); 169Assert.Contains(profileInput.Options!, option => option.Key == "Profile 1" && option.Value == "Profile 1");
src\Aspire.Hosting.Browsers\BrowserLogsConfigurationManager.cs (1)
252context.Input.Options = [.. options.Select(static pair => new KeyValuePair<string, string>(pair.Key, pair.Value))];
Aspire.Hosting.CodeGeneration.Go (6)
AtsGoCodeGenerator.cs (6)
610foreach (var (name, node) in root.Children.OrderBy(pair => pair.Key, StringComparer.Ordinal)) 624foreach (var (name, child) in node.Children.OrderBy(pair => pair.Key, StringComparer.Ordinal)) 658foreach (var (name, child) in node.Children.OrderBy(pair => pair.Key, StringComparer.Ordinal)) 700=> $"map[{MapTypeRefToGo(typeRef.KeyType, isOptional: false)}]{MapTypeRefToGo(typeRef.ValueType, isOptional: false)}{{{string.Join(", ", obj.Select(pair => $"{AtsJsonCodeWriter.ToRelaxedJsonString(pair.Key)}: {RenderGoExportedValue(pair.Value, typeRef.ValueType!, dtoTypesById)}"))}}}", 775.Where(kv => _isInterfaceType.TryGetValue(kv.Key, out var isI) && isI && !_implNames.ContainsKey(kv.Key))
Aspire.Hosting.CodeGeneration.Java (4)
AtsJavaCodeGenerator.cs (4)
807foreach (var (name, node) in root.Children.OrderBy(pair => pair.Key, StringComparer.Ordinal)) 825foreach (var (name, child) in node.Children.OrderBy(pair => pair.Key, StringComparer.Ordinal)) 872=> $"({MapTypeRefToJava(typeRef, false, useBoxedTypes: true)})(Object)new HashMap<>(Map.ofEntries({string.Join(", ", obj.Select(pair => $"Map.entry({AtsJsonCodeWriter.ToRelaxedJsonString(pair.Key)}, {RenderJavaExportedValue(pair.Value, typeRef.ValueType!, dtoTypesById)})"))}))", 1043foreach (var (className, optionalParameters) in _optionsClassesToGenerate.OrderBy(kvp => kvp.Key, StringComparer.Ordinal))
Aspire.Hosting.CodeGeneration.Java.Tests (7)
AtsJavaCodeGeneratorTests.cs (7)
386var javaFiles = files.Where(kvp => kvp.Key.EndsWith(".java", StringComparison.Ordinal)).ToList(); 391.Select(kvp => kvp.Key) 408.Where(kvp => kvp.Key.EndsWith(".java", StringComparison.Ordinal)) 410.Select(kvp => kvp.Key) 428foreach (var (path, content) in files.Where(kvp => kvp.Key.EndsWith(".java", StringComparison.Ordinal))) 504.OrderBy(kvp => kvp.Key, StringComparer.Ordinal) 505.Select(kvp => $"// ===== {kvp.Key} =====\n{kvp.Value}"));
Aspire.Hosting.CodeGeneration.Python (4)
AtsPythonCodeGenerator.cs (3)
876foreach (var (name, node) in root.Children.OrderBy(pair => pair.Key, StringComparer.Ordinal)) 890foreach (var (name, child) in node.Children.OrderBy(pair => pair.Key, StringComparer.Ordinal)) 931=> "{" + string.Join(", ", obj.Select(pair => $"{AtsJsonCodeWriter.ToRelaxedJsonString(pair.Key)}: {RenderPythonExportedValue(pair.Value, typeRef.ValueType!, dtoTypesById, topLevel: false)}")) + "}",
PythonModuleBuilder.cs (1)
175output.Append(ResourceOptions[kvp.Key]);
Aspire.Hosting.CodeGeneration.Rust (2)
AtsRustCodeGenerator.cs (2)
274foreach (var (name, node) in root.Children.OrderBy(pair => pair.Key, StringComparer.Ordinal)) 289foreach (var (childName, childNode) in node.Children.OrderBy(pair => pair.Key, StringComparer.Ordinal))
Aspire.Hosting.CodeGeneration.TypeScript (6)
AtsTypeScriptCodeGenerator.cs (6)
1275foreach (var (name, node) in root.Children.OrderBy(pair => pair.Key, StringComparer.Ordinal)) 1291foreach (var (name, child) in node.Children.OrderBy(pair => pair.Key, StringComparer.Ordinal)) 1331=> "{ " + string.Join(", ", obj.Select(pair => $"{RenderTypeScriptPropertyKey(pair.Key)}: {RenderTypeScriptExportedValue(pair.Value, typeRef.ValueType!, dtoTypesById)}")) + " }", 1651foreach (var (interfaceName, optionalParams) in _optionsInterfacesToGenerate.OrderBy(kvp => kvp.Key)) 3287.Where(mapping => !string.Equals(mapping.Key, mapping.Value, StringComparison.Ordinal)) 3288.Select(mapping => mapping.Key)
Aspire.Hosting.Containers.Tests (1)
ResourceFailureLoggingTests.cs (1)
125.Select(x => x.StructuredState?.SingleOrDefault(x => x.Key == "LineContent"))
Aspire.Hosting.Docker (6)
DockerComposeEnvironmentContext.cs (2)
157.Where(kvp => kvp.Value is EndpointReference epRef && epRef.Scheme == "https" && kvp.Key.StartsWith("services__", StringComparison.Ordinal)) 158.Select(kvp => kvp.Key)
DockerComposeEnvironmentResource.cs (1)
547envFile.Add(entry.Key, defaultValue, envVar.Description, onlyIfMissing: false);
DockerComposePublishingContext.cs (1)
160envFile.Add(entry.Key, value: null, envVar.Description, onlyIfMissing: true);
DockerComposeServiceResource.cs (2)
225env[kv.Key] = value?.ToString() ?? string.Empty; 232composeService.AddEnvironmentalVariable(variable.Key, variable.Value);
Aspire.Hosting.Docker.Tests (1)
DockerComposePublisherTests.cs (1)
983kv.Value.Source is ContainerMountAnnotation).Select(kv => kv.Key).ToList();
Aspire.Hosting.EntityFrameworkCore (2)
EFResourceBuilderExtensions.cs (2)
468startInfo.Environment[kvp.Key] = kvp.Value; 626yield return new KeyValuePair<string, string>(kvp.Key, kvp.Value.Processed);
Aspire.Hosting.EntityFrameworkCore.Tests (4)
EFMigrationPipelineTests.cs (4)
745Assert.DoesNotContain(result, kvp => kvp.Key == "ConnectionStrings__postgresdb"); 746Assert.Contains(result, kvp => kvp.Key == "OTHER" && kvp.Value == "value"); 764Assert.Contains(result, kvp => kvp.Key == "ConnectionStrings__postgresdb" && kvp.Value == "Host=localhost;Database=postgresdb"); 830public IEnumerable<KeyValuePair<string, string>> EnvironmentVariables => EnvironmentVariablesWithUnprocessed.Select(kvp => new KeyValuePair<string, string>(kvp.Key, kvp.Value.Processed));
Aspire.Hosting.Foundry (6)
HostedAgent\HostedAgentBuilderExtension.cs (1)
409var endpointVar = ctx.EnvironmentVariables.FirstOrDefault((item) => item.Key == "OTEL_EXPORTER_OTLP_ENDPOINT");
HostedAgent\HostedAgentConfiguration.cs (2)
144def.EnvironmentVariables[envVar.Key] = envVar.Value; 152options.Metadata[kvp.Key] = kvp.Value;
HostedAgent\HostedAgentOptions.cs (2)
69configuration.Metadata[kvp.Key] = kvp.Value; 74configuration.EnvironmentVariables[kvp.Key] = kvp.Value;
PromptAgent\AzurePromptAgentResource.cs (1)
273options.Metadata[kvp.Key] = kvp.Value;
Aspire.Hosting.Foundry.Tests (16)
HostedAgentConfigurationTests.cs (2)
179Assert.Contains(config.Metadata, kvp => kvp.Key == "DeployedBy"); 180Assert.Contains(config.Metadata, kvp => kvp.Key == "DeployedOn");
HostedAgentExtensionTests.cs (2)
377kvp.Key == "ConnectionStrings__my-project" && 380kvp.Key == "MY_PROJECT_CONNECTIONSTRING" &&
ProjectResourceTests.cs (3)
147Assert.Equal("Uri", properties[0].Key); 149Assert.Equal("ConnectionString", properties[1].Key); 150Assert.Equal("ApplicationInsightsConnectionString", properties[2].Key);
ProjectWithReferenceTests.cs (8)
26kvp.Key == "TEST_PROJECT_URI" 45kvp.Key == "TEST_PROJECT_APPLICATIONINSIGHTSCONNECTIONSTRING" 65kvp.Key.StartsWith("ConnectionStrings__", StringComparison.Ordinal)); 83kvp.Key == "CHAT_MODELNAME" && kvp.Value == "chat"); 85kvp.Key == "CHAT_FORMAT" && kvp.Value == "OpenAI"); 87kvp.Key == "CHAT_VERSION" && kvp.Value == "1"); 89kvp.Key == "CHAT_URI"); 91kvp.Key == "CHAT_AIINFERENCEURI" && kvp.Value == "{test-account.outputs.aiFoundryApiEndpoint}models");
PromptAgentTests.cs (1)
519Assert.Contains(envVars, kvp => kvp.Key is "ConnectionStrings__my-agent");
Aspire.Hosting.Garnet.Tests (4)
ConnectionPropertiesTests.cs (4)
22Assert.Equal("Host", property.Key); 27Assert.Equal("Port", property.Key); 32Assert.Equal("Password", property.Key); 37Assert.Equal("Uri", property.Key);
Aspire.Hosting.GitHub.Models.Tests (8)
ConnectionPropertiesTests.cs (8)
22Assert.Equal("Uri", property.Key); 27Assert.Equal("Key", property.Key); 32Assert.Equal("ModelName", property.Key); 36Assert.DoesNotContain(properties, property => property.Key == "Organization"); 48Assert.Contains(properties, property => property.Key == "Uri" && property.Value.ValueExpression == "https://models.github.ai/orgs/{org.value}/inference"); 49Assert.Contains(properties, property => property.Key == "Key" && property.Value.ValueExpression == "{key.value}"); 50Assert.Contains(properties, property => property.Key == "ModelName" && property.Value.ValueExpression == "gpt"); 51Assert.Contains(properties, property => property.Key == "Organization" && property.Value.ValueExpression == "{org.value}");
Aspire.Hosting.Integration.Analyzers (13)
AspireExportAnalyzer.cs (13)
1692kvp.Key.ExportId, 1693kvp.Key.TargetType)); 1703foreach (var kvp in capabilityIds.OrderBy(kvp => kvp.Key, StringComparer.Ordinal)) 1722kvp.Key, 1732foreach (var kvp in generatedMethodNames.OrderBy(kvp => kvp.Key.TargetType, StringComparer.Ordinal).ThenBy(kvp => kvp.Key.MethodName, StringComparer.Ordinal)) 1752kvp.Key.MethodName, 1753kvp.Key.TargetType, 1841if (namedArgument.Key == argumentName && 1860if (namedArgument.Key == argumentName && 1882if (namedArgument.Key == argumentName) 2107if (namedArgument.Key == RunSyncOnBackgroundThreadPropertyName && 2488if (namedArgument.Key == "Type" &&
Aspire.Hosting.Kafka.Tests (12)
AddKafkaTests.cs (10)
128Assert.Contains(config, kvp => kvp.Key == "KAFKA_LOG_DIRS" && kvp.Value == "/var/lib/kafka/data"); 146Assert.Contains(config, kvp => kvp.Key == "KAFKA_LOG_DIRS" && kvp.Value == "/var/lib/kafka/data"); 196Assert.Contains(config1, kvp => kvp.Key == "KAFKA_LISTENERS"); 197Assert.Contains(config2, kvp => kvp.Key == "KAFKA_LISTENERS"); 199config1.First(kvp => kvp.Key == "KAFKA_LISTENERS").Value, 200config2.First(kvp => kvp.Key == "KAFKA_LISTENERS").Value); 227Assert.Contains(config1, kvp => kvp.Key == "KAFKA_CLUSTERS_0_NAME"); 228Assert.Contains(config2, kvp => kvp.Key == "KAFKA_CLUSTERS_0_NAME"); 229Assert.Equal("kafka1", config1.First(kvp => kvp.Key == "KAFKA_CLUSTERS_0_NAME").Value); 230Assert.Equal("kafka1", config2.First(kvp => kvp.Key == "KAFKA_CLUSTERS_0_NAME").Value);
ConnectionPropertiesTests.cs (2)
21Assert.Equal("Host", property.Key); 26Assert.Equal("Port", property.Key);
Aspire.Hosting.Kubernetes (10)
Extensions\ResourceExtensions.cs (6)
81foreach (var kvp in context.Secrets.Where(kvp => !processedKeys.Contains(kvp.Key))) 90secret.StringData[kvp.Key] = expression.EnsureStringOutput(); 91processedKeys.Add(kvp.Key); 115foreach (var kvp in context.EnvironmentVariables.Where(kvp => !processedKeys.Contains(kvp.Key))) 122configMap.Data[kvp.Key] = expression.EnsureStringOutput(); 123processedKeys.Add(kvp.Key);
KubernetesResource.cs (4)
143resource.Metadata.Labels.TryAdd(label.Key, label.Value); 409var key = environmentVariable.Key; 492.Where(kvp => kvp.Value is EndpointReference epRef && epRef.Scheme == "https" && kvp.Key.StartsWith("services__", StringComparison.Ordinal)) 493.Select(kvp => kvp.Key)
Aspire.Hosting.Kubernetes.Tests (2)
KubernetesPublisherTests.cs (2)
232var spec = Assert.IsType<YamlMappingNode>(root.Children.Single(static entry => entry.Key is YamlScalarNode { Value: "spec" }).Value); 233var maxReplicaCount = Assert.IsType<YamlScalarNode>(spec.Children.Single(static entry => entry.Key is YamlScalarNode { Value: "maxReplicaCount" }).Value);
Aspire.Hosting.Maui (3)
Utilities\MauiEnvironmentHelper.cs (3)
52var normalizedKey = envVar.Key.ToUpperInvariant(); 97foreach (var (key, value) in environmentVariables.OrderBy(kvp => kvp.Key, StringComparer.OrdinalIgnoreCase)) 275foreach (var (key, value) in environmentVariables.OrderBy(kvp => kvp.Key, StringComparer.Ordinal))
Aspire.Hosting.Maui.Tests (5)
MauiPlatformExtensionsTests.cs (5)
213config.ExpectedMsBuildProperties?.Select(property => $"-p:{property.Key}={property.Value}").ToArray() ?? [], 321Assert.Contains(envVars, kvp => kvp.Key == "DEBUG_MODE" && kvp.Value == "true"); 322Assert.Contains(envVars, kvp => kvp.Key == "API_TIMEOUT" && kvp.Value == "30"); 550Assert.Contains(envVars, kvp => kvp.Key == "DEBUG_MODE" && kvp.Value == "true"); 551Assert.Contains(envVars, kvp => kvp.Key == "API_TIMEOUT" && kvp.Value == "30");
Aspire.Hosting.Milvus.Tests (11)
AddMilvusTests.cs (2)
114Assert.Contains(config, kvp => kvp.Key == "ConnectionStrings__my-milvus" && kvp.Value == "Endpoint=http://localhost:19530;Key=root:pass"); 125Assert.Contains(containerConfig, kvp => kvp.Key == "ConnectionStrings__my-milvus" && kvp.Value == "Endpoint=http://my-milvus.dev.internal:19530;Key=root:pass");
ConnectionPropertiesTests.cs (9)
22Assert.Equal("Host", property.Key); 27Assert.Equal("Port", property.Key); 32Assert.Equal("Token", property.Key); 37Assert.Equal("Uri", property.Key); 51Assert.Contains(properties, property => property.Key == "Host" && property.Value.ValueExpression == "{milvus.bindings.grpc.host}"); 52Assert.Contains(properties, property => property.Key == "Port" && property.Value.ValueExpression == "{milvus.bindings.grpc.port}"); 53Assert.Contains(properties, property => property.Key == "Token" && property.Value.ValueExpression == "root:{apiKey.value}"); 54Assert.Contains(properties, property => property.Key == "Uri" && property.Value.ValueExpression == "{milvus.bindings.grpc.url}"); 55Assert.Contains(properties, property => property.Key == "DatabaseName" && property.Value.ValueExpression == "Vectors");
Aspire.Hosting.MongoDB.Tests (24)
AddMongoDBTests.cs (9)
173Assert.Equal("ME_CONFIG_MONGODB_SERVER", e.Key); 178Assert.Equal("ME_CONFIG_MONGODB_PORT", e.Key); 183Assert.Equal("ME_CONFIG_BASICAUTH", e.Key); 188Assert.Equal("ME_CONFIG_MONGODB_ADMINUSERNAME", e.Key); 193Assert.Equal("ME_CONFIG_MONGODB_ADMINPASSWORD", e.Key); 325Assert.Contains(config1, kvp => kvp.Key == "ME_CONFIG_MONGODB_SERVER"); 326Assert.Contains(config2, kvp => kvp.Key == "ME_CONFIG_MONGODB_SERVER"); 328config1.First(kvp => kvp.Key == "ME_CONFIG_MONGODB_SERVER").Value, 329config2.First(kvp => kvp.Key == "ME_CONFIG_MONGODB_SERVER").Value);
ConnectionPropertiesTests.cs (15)
24Assert.Equal("Host", property.Key); 29Assert.Equal("Port", property.Key); 34Assert.Equal("Username", property.Key); 39Assert.Equal("Password", property.Key); 44Assert.Equal("AuthenticationDatabase", property.Key); 49Assert.Equal("AuthenticationMechanism", property.Key); 54Assert.Equal("Uri", property.Key); 69Assert.Contains(properties, property => property.Key == "Host" && property.Value.ValueExpression == "{mongo.bindings.tcp.host}"); 70Assert.Contains(properties, property => property.Key == "Port" && property.Value.ValueExpression == "{mongo.bindings.tcp.port}"); 71Assert.Contains(properties, property => property.Key == "Username" && property.Value.ValueExpression == "{user.value}"); 72Assert.Contains(properties, property => property.Key == "Password" && property.Value.ValueExpression == "{password.value}"); 73Assert.Contains(properties, property => property.Key == "AuthenticationDatabase" && property.Value.ValueExpression == "admin"); 74Assert.Contains(properties, property => property.Key == "AuthenticationMechanism" && property.Value.ValueExpression == "SCRAM-SHA-256"); 75Assert.Contains(properties, property => property.Key == "DatabaseName" && property.Value.ValueExpression == "Products"); 78property => property.Key == "Uri" &&
Aspire.Hosting.MySql.Tests (19)
AddMySqlTests.cs (6)
68Assert.Equal("MYSQL_ROOT_PASSWORD", env.Key); 107Assert.Equal("MYSQL_ROOT_PASSWORD", env.Key); 394Assert.Contains(config1, kvp => kvp.Key == "PMA_HOST"); 395Assert.Contains(config2, kvp => kvp.Key == "PMA_HOST"); 397config1.First(kvp => kvp.Key == "PMA_HOST").Value, 398config2.First(kvp => kvp.Key == "PMA_HOST").Value);
ConnectionPropertiesTests.cs (13)
23Assert.Equal("Host", property.Key); 28Assert.Equal("Port", property.Key); 33Assert.Equal("Username", property.Key); 38Assert.Equal("Password", property.Key); 43Assert.Equal("Uri", property.Key); 48Assert.Equal("JdbcConnectionString", property.Key); 62Assert.Contains(properties, property => property.Key == "Host" && property.Value.ValueExpression == "{mysql.bindings.tcp.host}"); 63Assert.Contains(properties, property => property.Key == "Port" && property.Value.ValueExpression == "{mysql.bindings.tcp.port}"); 64Assert.Contains(properties, property => property.Key == "Username" && property.Value.ValueExpression == "root"); 65Assert.Contains(properties, property => property.Key == "Password" && property.Value.ValueExpression == "{password.value}"); 66Assert.Contains(properties, property => property.Key == "DatabaseName" && property.Value.ValueExpression == "Orders"); 69property => property.Key == "Uri" && 73property => property.Key == "JdbcConnectionString" &&
Aspire.Hosting.Nats.Tests (5)
ConnectionPropertiesTests.cs (5)
24Assert.Equal("Host", property.Key); 29Assert.Equal("Port", property.Key); 34Assert.Equal("Username", property.Key); 39Assert.Equal("Password", property.Key); 44Assert.Equal("Uri", property.Key);
Aspire.Hosting.OpenAI.Tests (7)
ConnectionPropertiesTests.cs (7)
25Assert.Equal("Endpoint", property.Key); 30Assert.Equal("Uri", property.Key); 35Assert.Equal("Key", property.Key); 52Assert.Contains(properties, property => property.Key == "Endpoint" && property.Value.ValueExpression == "https://contoso.ai/v1"); 53Assert.Contains(properties, property => property.Key == "Uri" && property.Value.ValueExpression == "https://contoso.ai/v1"); 54Assert.Contains(properties, property => property.Key == "Key" && property.Value.ValueExpression == "{key.value}"); 55Assert.Contains(properties, property => property.Key == "ModelName" && property.Value.ValueExpression == "gpt-4o-mini");
Aspire.Hosting.Oracle.Tests (15)
AddOracleTests.cs (3)
66Assert.Equal("ORACLE_PWD", env.Key); 105Assert.Equal("ORACLE_PWD", env.Key); 187Assert.Equal("ORACLE_PWD", env.Key);
ConnectionPropertiesTests.cs (12)
23Assert.Equal("Host", property.Key); 28Assert.Equal("Port", property.Key); 33Assert.Equal("Username", property.Key); 38Assert.Equal("Password", property.Key); 43Assert.Equal("Uri", property.Key); 48Assert.Equal("JdbcConnectionString", property.Key); 62Assert.Contains(properties, property => property.Key == "Host" && property.Value.ValueExpression == "{oracle.bindings.tcp.host}"); 63Assert.Contains(properties, property => property.Key == "Port" && property.Value.ValueExpression == "{oracle.bindings.tcp.port}"); 64Assert.Contains(properties, property => property.Key == "Username" && property.Value.ValueExpression == "system"); 65Assert.Contains(properties, property => property.Key == "Password" && property.Value.ValueExpression == "{password.value}"); 66Assert.Contains(properties, property => property.Key == "DatabaseName" && property.Value.ValueExpression == "Orders"); 69property => property.Key == "JdbcConnectionString" &&
Aspire.Hosting.PostgreSQL.Tests (29)
AddPostgresTests.cs (15)
77Assert.Equal("POSTGRES_HOST_AUTH_METHOD", env.Key); 82Assert.Equal("POSTGRES_INITDB_ARGS", env.Key); 87Assert.Equal("POSTGRES_USER", env.Key); 92Assert.Equal("POSTGRES_PASSWORD", env.Key); 131Assert.Equal("POSTGRES_HOST_AUTH_METHOD", env.Key); 136Assert.Equal("POSTGRES_INITDB_ARGS", env.Key); 141Assert.Equal("POSTGRES_USER", env.Key); 146Assert.Equal("POSTGRES_PASSWORD", env.Key); 247Assert.Equal("POSTGRES_HOST_AUTH_METHOD", env.Key); 252Assert.Equal("POSTGRES_INITDB_ARGS", env.Key); 257Assert.Equal("POSTGRES_USER", env.Key); 262Assert.Equal("POSTGRES_PASSWORD", env.Key); 729Assert.True(config2.ContainsKey(kvp.Key), $"Key {kvp.Key} should exist in second call"); 730Assert.Equal(kvp.Value, config2[kvp.Key]);
ConnectionPropertiesTests.cs (13)
23Assert.Equal("Host", property.Key); 28Assert.Equal("Port", property.Key); 33Assert.Equal("Username", property.Key); 38Assert.Equal("Password", property.Key); 43Assert.Equal("Uri", property.Key); 48Assert.Equal("JdbcConnectionString", property.Key); 63Assert.Contains(properties, property => property.Key == "Host" && property.Value.ValueExpression == "{postgres.bindings.tcp.host}"); 64Assert.Contains(properties, property => property.Key == "Port" && property.Value.ValueExpression == "{postgres.bindings.tcp.port}"); 65Assert.Contains(properties, property => property.Key == "Username" && property.Value.ValueExpression == "{user.value}"); 66Assert.Contains(properties, property => property.Key == "Password" && property.Value.ValueExpression == "{password.value}"); 67Assert.Contains(properties, property => property.Key == "DatabaseName" && property.Value.ValueExpression == "Customers"); 70property => property.Key == "Uri" && 74property => property.Key == "JdbcConnectionString" &&
PostgresMcpBuilderTests.cs (1)
94var databaseUri = Assert.Single(env, e => e.Key == "DATABASE_URI");
Aspire.Hosting.Qdrant.Tests (13)
AddQdrantTests.cs (6)
78Assert.Equal("QDRANT__SERVICE__API_KEY", env.Key); 150Assert.Equal("QDRANT__SERVICE__API_KEY", env.Key); 199Assert.Contains(config, kvp => kvp.Key == "ConnectionStrings__my-qdrant" && kvp.Value == "Endpoint=http://localhost:6334;Key=pass"); 200Assert.Contains(config, kvp => kvp.Key == "ConnectionStrings__my-qdrant_http" && kvp.Value == "Endpoint=http://localhost:6333;Key=pass"); 211Assert.Contains(containerConfig, kvp => kvp.Key == "ConnectionStrings__my-qdrant" && kvp.Value == "Endpoint=http://my-qdrant.dev.internal:6334;Key=pass"); 212Assert.Contains(containerConfig, kvp => kvp.Key == "ConnectionStrings__my-qdrant_http" && kvp.Value == "Endpoint=http://my-qdrant.dev.internal:6333;Key=pass");
ConnectionPropertiesTests.cs (7)
22Assert.Equal("GrpcHost", property.Key); 27Assert.Equal("GrpcPort", property.Key); 32Assert.Equal("HttpHost", property.Key); 37Assert.Equal("HttpPort", property.Key); 42Assert.Equal("ApiKey", property.Key); 47Assert.Equal("Uri", property.Key); 52Assert.Equal("HttpUri", property.Key);
Aspire.Hosting.RabbitMQ.Tests (5)
ConnectionPropertiesTests.cs (5)
24Assert.Equal("Host", property.Key); 29Assert.Equal("Port", property.Key); 34Assert.Equal("Username", property.Key); 39Assert.Equal("Password", property.Key); 44Assert.Equal("Uri", property.Key);
Aspire.Hosting.Radius (7)
Publishing\RadiusInfrastructureBuilder.cs (6)
296kv => kv.Key, 318kv => kv.Key, 322kv => kv.Key, 324tkv => tkv.Key, tkv => tkv.Value.BicepIdentifier)), 1141&& kvp.Key.StartsWith("services__", StringComparison.Ordinal)) 1142.Select(kvp => kvp.Key)
Secrets\RadiusSecretStoreValidation.cs (1)
362var envCollision = envScoped.FirstOrDefault(kvp => string.Equals(kvp.Key.Identifier, identifier, StringComparison.Ordinal));
Aspire.Hosting.Radius.Tests (1)
Publishing\RadiusDeployParametersTests.cs (1)
39Assert.Equal("recipeSecret", binding.Key);
Aspire.Hosting.Redis.Tests (19)
AddRedisTests.cs (15)
301Assert.Equal("RI_REDIS_HOST1", item.Key); 306Assert.Equal("RI_REDIS_PORT1", item.Key); 311Assert.Equal("RI_REDIS_ALIAS1", item.Key); 316Assert.Equal("RI_REDIS_PASSWORD1", item.Key); 323Assert.Equal("RI_REDIS_HOST2", item.Key); 328Assert.Equal("RI_REDIS_PORT2", item.Key); 333Assert.Equal("RI_REDIS_ALIAS2", item.Key); 338Assert.Equal("RI_REDIS_PASSWORD2", item.Key); 345Assert.Equal("RI_REDIS_HOST3", item.Key); 350Assert.Equal("RI_REDIS_PORT3", item.Key); 355Assert.Equal("RI_REDIS_ALIAS3", item.Key); 775Assert.Contains(config1, kvp => kvp.Key == "RI_REDIS_HOST1"); 776Assert.Contains(config2, kvp => kvp.Key == "RI_REDIS_HOST1"); 778config1.First(kvp => kvp.Key == "RI_REDIS_HOST1").Value, 779config2.First(kvp => kvp.Key == "RI_REDIS_HOST1").Value);
ConnectionPropertiesTests.cs (4)
21Assert.Equal("Host", property.Key); 26Assert.Equal("Port", property.Key); 31Assert.Equal("Password", property.Key); 36Assert.Equal("Uri", property.Key);
Aspire.Hosting.RemoteHost (7)
Ats\AtsMarshaller.cs (2)
642ParameterName = $"{paramName}[{prop.Key}]" 644dict[prop.Key] = UnmarshalFromJson(prop.Value, valueType, valueContext);
Ats\PolyglotCapabilityInvocationException.cs (2)
530foreach (var alias in polyglotMethodNamesByClrName.OrderByDescending(static pair => pair.Key.Length)) 536$@"\b{Regex.Escape(alias.Key)}\b",
AtsCapabilityScanner.cs (1)
576var typeId = kvp.Key;
Diagnostics\RemoteHostProfilingTelemetry.cs (1)
491: [.. args.Select(arg => arg.Key).Order(StringComparer.Ordinal)];
src\Shared\IntegrationPackageProbeManifest.cs (1)
292static pair => pair.Key,
Aspire.Hosting.RemoteHost.Tests (3)
AtsCapabilityScannerTests.cs (1)
576m => m.Key.EndsWith("/withConfiguration", StringComparison.Ordinal)).Value;
CapabilityDispatcherTests.cs (2)
2697if (string.Equals(prop.Key, key, StringComparison.OrdinalIgnoreCase)) 2699return prop.Key;
Aspire.Hosting.Rust (4)
CargoMetadataReader.cs (2)
158.Where(static pair => pair.Value.Length >= 4 || IsSensitiveEnvironmentVariableName(pair.Key)) 161.Where(static pair => IsSensitiveEnvironmentVariableName(pair.Key) || ContainsCredentialUserInfo(pair.Value))
RustHostingExtensions.cs (2)
776dockerfile.BuildArguments[buildArgument.Key] = buildArgument.Value; 781dockerfile.BuildSecrets[buildSecret.Key] = buildSecret.Value;
Aspire.Hosting.Seq.Tests (3)
ConnectionPropertiesTests.cs (3)
21Assert.Equal("Host", property.Key); 26Assert.Equal("Port", property.Key); 31Assert.Equal("Uri", property.Key);
Aspire.Hosting.SqlServer.Tests (17)
AddSqlServerTests.cs (2)
67Assert.Equal("ACCEPT_EULA", env.Key); 72Assert.Equal("MSSQL_SA_PASSWORD", env.Key);
ConnectionPropertiesTests.cs (15)
19properties.OrderBy(p => p.Key), 22Assert.Equal("Host", property.Key); 27Assert.Equal("JdbcConnectionString", property.Key); 32Assert.Equal("Password", property.Key); 37Assert.Equal("Port", property.Key); 42Assert.Equal("Uri", property.Key); 47Assert.Equal("Username", property.Key); 62properties.OrderBy(p => p.Key), 65Assert.Equal("DatabaseName", property.Key); 70Assert.Equal("Host", property.Key); 75Assert.Equal("JdbcConnectionString", property.Key); 80Assert.Equal("Password", property.Key); 85Assert.Equal("Port", property.Key); 90Assert.Equal("Uri", property.Key); 95Assert.Equal("Username", property.Key);
Aspire.Hosting.Testing (6)
DistributedApplicationEntryPointInvoker.cs (5)
184if (value.Key == "DistributedApplicationBuilderConstructing") 190if (value.Key == "DistributedApplicationBuilderConstructed") 195if (value.Key == "DistributedApplicationBuilding") 200if (value.Key == "DistributedApplicationBuilt") 277if (value.Key == "DistributedApplicationBuilderConstructing")
DistributedApplicationFactory.cs (1)
288SetDefault("DOTNET_LAUNCH_PROFILE", firstLaunchProfile.Key);
Aspire.Hosting.Testing.Tests (4)
tests\Shared\Logging\LogTestHelpers.cs (1)
31return list?.SingleOrDefault(kvp => kvp.Key == key).Value;
tests\Shared\Logging\LogValuesAssert.cs (3)
54return string.Join(",", logValues.Select(kvp => $"[{kvp.Key} {kvp.Value}]")); 61return string.Equals(x.Key, y.Key) && object.Equals(x.Value, y.Value);
Aspire.Hosting.Tests (130)
AddParameterTests.cs (2)
647Assert.Equal("one", option.Key); 652Assert.Equal("two", option.Key);
AtsHealthCheckExportsTests.cs (1)
35Assert.Equal("custom_check", entry.Key);
Backchannel\AuxiliaryBackchannelRpcTargetTests.cs (1)
2487Assert.Equal("Chrome-Default", Assert.Single(profileInput.Options!).Key);
Backchannel\BackchannelContractTests.cs (1)
397expectedDictionary.All(item => actualDictionary.TryGetValue(item.Key, out var actualValue) && item.Value == actualValue);
ConnectionPropertiesExtensionsTests.cs (1)
30dict[property.Key] = property.Value.ValueExpression;
Dashboard\DashboardEventHandlersTests.cs (1)
308Assert.Equal("true", envVars.Single(e => e.Key == "ASPIRE_DASHBOARD_PURPLE_MONKEY_DISHWASHER").Value);
Dashboard\DashboardResourceTests.cs (30)
120.OrderBy(c => c.Key) 126Assert.Equal(KnownConfigNames.DashboardApiEnabled, e.Key); 131Assert.Equal(KnownConfigNames.DashboardOtlpGrpcEndpointUrl, e.Key); 136Assert.Equal(KnownConfigNames.ResourceServiceEndpointUrl, e.Key); 141Assert.Equal(KnownAspNetCoreConfigNames.Environment, e.Key); 146Assert.Equal(KnownAspNetCoreConfigNames.Urls, e.Key); 151Assert.Equal("DASHBOARD__API__AUTHMODE", e.Key); 156Assert.Equal("DASHBOARD__FRONTEND__AUTHMODE", e.Key); 161Assert.Equal("DASHBOARD__FRONTEND__PUBLICURL", e.Key); 166Assert.Equal("DASHBOARD__OTLP__AUTHMODE", e.Key); 171Assert.Equal("DASHBOARD__RESOURCESERVICECLIENT__AUTHMODE", e.Key); 176Assert.Equal("LOGGING__CONSOLE__FORMATTERNAME", e.Key); 384Assert.Equal("BrowserToken", config.Single(e => e.Key == DashboardConfigNames.DashboardFrontendAuthModeName.EnvVarName).Value); 385Assert.Equal("TestBrowserToken!", config.Single(e => e.Key == DashboardConfigNames.DashboardFrontendBrowserTokenName.EnvVarName).Value); 387Assert.Equal("ApiKey", config.Single(e => e.Key == DashboardConfigNames.DashboardOtlpAuthModeName.EnvVarName).Value); 388Assert.Equal("TestOtlpApiKey!", config.Single(e => e.Key == DashboardConfigNames.DashboardOtlpPrimaryApiKeyName.EnvVarName).Value); 424Assert.Equal("Unsecured", config.Single(e => e.Key == DashboardConfigNames.DashboardFrontendAuthModeName.EnvVarName).Value); 425Assert.Equal("Unsecured", config.Single(e => e.Key == DashboardConfigNames.DashboardOtlpAuthModeName.EnvVarName).Value); 460Assert.Equal("http://localhost:5000", config.Single(e => e.Key == DashboardConfigNames.ResourceServiceUrlName.EnvVarName).Value); 505Assert.Equal("http://localhost:5002", config.Single(e => e.Key == DashboardConfigNames.DashboardOtlpHttpUrlName.EnvVarName).Value); 506Assert.Equal(expectedAllowedOrigins, config.Single(e => e.Key == DashboardConfigNames.DashboardOtlpCorsAllowedOriginsKeyName.EnvVarName).Value); 507Assert.Equal("*", config.Single(e => e.Key == DashboardConfigNames.DashboardOtlpCorsAllowedHeadersKeyName.EnvVarName).Value); 508Assert.DoesNotContain(config, e => e.Key == corsAllowedOriginsKey); 551Assert.Equal("https://localhost:5001", config.Single(e => e.Key == DashboardConfigNames.DashboardOtlpGrpcUrlName.EnvVarName).Value); 552Assert.Equal("https://localhost:5002", config.Single(e => e.Key == DashboardConfigNames.DashboardOtlpHttpUrlName.EnvVarName).Value); 553Assert.Equal(expectedAllowedOrigins, config.Single(e => e.Key == DashboardConfigNames.DashboardOtlpCorsAllowedOriginsKeyName.EnvVarName).Value); 554Assert.Equal("*", config.Single(e => e.Key == DashboardConfigNames.DashboardOtlpCorsAllowedHeadersKeyName.EnvVarName).Value); 555Assert.DoesNotContain(config, e => e.Key == corsAllowedOriginsKey); 593Assert.DoesNotContain(config, e => e.Key == DashboardConfigNames.DashboardOtlpCorsAllowedOriginsKeyName.EnvVarName); 594Assert.DoesNotContain(config, e => e.Key == DashboardConfigNames.DashboardOtlpCorsAllowedHeadersKeyName.EnvVarName);
ExternalServiceTests.cs (10)
119Assert.Contains(config, kvp => kvp.Key == "services__nuget__https__0" && kvp.Value == "https://nuget.org/"); 120Assert.Contains(config, kvp => kvp.Key == "NUGET" && kvp.Value == "https://nuget.org/"); 136Assert.Contains(config, kvp => kvp.Key == "services__nuget__http__0" && kvp.Value == "http://nuget.org/"); 137Assert.Contains(config, kvp => kvp.Key == "NUGET" && kvp.Value == "http://nuget.org/"); 155Assert.Contains(config, kvp => kvp.Key == "services__nuget__https__0" && kvp.Value == "https://nuget.org/"); 156Assert.Contains(config, kvp => kvp.Key == "NUGET_HTTPS" && kvp.Value == "https://nuget.org/"); 175Assert.Contains(config, kvp => kvp.Key == "services__nuget__default__0"); 178Assert.Contains(config, kvp => kvp.Key == "NUGET" && kvp.Value == urlValue); 563Assert.Contains(config, kvp => kvp.Key == "services__gateway__https__0" && kvp.Value == "https://gateway.example.com/orders-service/"); 564Assert.Contains(config, kvp => kvp.Key == "GATEWAY" && kvp.Value == "https://gateway.example.com/orders-service/");
InteractionServiceTests.cs (2)
942Assert.Equal("loaded", inputsInteractionInfo.Inputs["Dynamic"].Options![0].Key); 1008Assert.Equal("loaded", inputsInteractionInfo.Inputs["Dynamic"].Options![0].Key);
KestrelConfigTests.cs (5)
147config.Where(envVar => envVar.Key.StartsWith("Kestrel__")), 150Assert.Equal("Kestrel__Endpoints__FirstHttpEndpoint__Url", envVar.Key); 155Assert.Equal("Kestrel__Endpoints__SecondHttpEndpoint__Url", envVar.Key); 161Assert.Equal("Kestrel__Endpoints__ExplicitProxiedHttp__Url", envVar.Key); 166Assert.Equal("Kestrel__Endpoints__ExplicitNoProxyHttp__Url", envVar.Key);
Orchestrator\ApplicationOrchestratorTests.cs (1)
1262string.Join(';', kvConnectionString.Select(kv => $"{kv.Key}={kv.Value}"));
ProjectResourceTests.cs (16)
142Assert.Equal("OTEL_DOTNET_EXPERIMENTAL_OTLP_RETRY", env.Key); 147Assert.Equal("OTEL_DOTNET_EXPERIMENTAL_ASPNETCORE_DISABLE_URL_QUERY_REDACTION", env.Key); 152Assert.Equal("OTEL_DOTNET_EXPERIMENTAL_HTTPCLIENT_DISABLE_URL_QUERY_REDACTION", env.Key); 157Assert.Equal("OTEL_EXPORTER_OTLP_ENDPOINT", env.Key); 162Assert.Equal("OTEL_EXPORTER_OTLP_PROTOCOL", env.Key); 167Assert.Equal("OTEL_RESOURCE_ATTRIBUTES", env.Key); 172Assert.Equal("OTEL_SERVICE_NAME", env.Key); 177Assert.Equal("OTEL_EXPORTER_OTLP_HEADERS", env.Key); 184Assert.Equal("OTEL_BLRP_SCHEDULE_DELAY", env.Key); 189Assert.Equal("OTEL_BSP_SCHEDULE_DELAY", env.Key); 194Assert.Equal("OTEL_METRIC_EXPORT_INTERVAL", env.Key); 199Assert.Equal("OTEL_TRACES_SAMPLER", env.Key); 204Assert.Equal("OTEL_METRICS_EXEMPLAR_FILTER", env.Key); 209Assert.Equal("OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT", env.Key); 214Assert.Equal("DOTNET_SYSTEM_CONSOLE_ALLOW_ANSI_COLOR_REDIRECTION", env.Key); 219Assert.Equal("LOGGING__CONSOLE__FORMATTERNAME", env.Key);
ResourceExtensionsTests.cs (8)
229Assert.Equal("discovery.type", env.Key); 234Assert.Equal("xpack.security.enabled", env.Key); 239Assert.Equal("ELASTIC_PASSWORD", env.Key); 264Assert.Equal("discovery.type", env.Key); 269Assert.Equal("xpack.security.enabled", env.Key); 274Assert.Equal("ELASTIC_PASSWORD", env.Key); 299Assert.Equal("discovery.type", env.Key); 304Assert.Equal("xpack.security.enabled", env.Key);
ResourceFailureLoggingTests.cs (1)
83.Select(x => x.StructuredState?.SingleOrDefault(x => x.Key == "LineContent"))
SecretsStoreTests.cs (1)
91.ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
StableConnectionStringBuilderTests.cs (3)
298Assert.Equal("A", keys[0].Key); 299Assert.Equal("B", keys[1].Key); 300Assert.Equal("c", keys[2].Key);
UserSecretsParameterDefaultTests.cs (5)
116var key = kvp.Key; 134Assert.True(userSecrets.ContainsKey(kvp.Key), $"Secret '{kvp.Key}' was not found in user secrets"); 135Assert.Equal(kvp.Value, userSecrets[kvp.Key]); 404secrets[kvp.Key] = kvp.Value;
WithEnvironmentTests.cs (3)
326Assert.Equal("TARGET_PORT", pair.Key); 350Assert.Single(runConfig, kvp => kvp.Key == envVarName && kvp.Value == sourceCon); 356Assert.Single(publishConfig, kvp => kvp.Key == envVarName && kvp.Value == "{sourceService.connectionString}");
WithReferenceTests.cs (36)
416Assert.Contains(config, kvp => kvp.Key == "ConnectionStrings__resource" && kvp.Value == "123"); 520Assert.Contains(config, kvp => kvp.Key == "ConnectionStrings__bob" && kvp.Value == "123"); 544Assert.Contains(config, kvp => kvp.Key == "services__petstore__default__0" && kvp.Value == "https://petstore.swagger.io/v2"); 545Assert.Contains(config, kvp => kvp.Key == "petstore" && kvp.Value == "https://petstore.swagger.io/v2"); 561Assert.Contains(config, kvp => kvp.Key == "services__petstore__default__0" && kvp.Value == "https://petstore.swagger.io/"); 562Assert.Contains(config, kvp => kvp.Key == "petstore" && kvp.Value == "https://petstore.swagger.io/"); 583Assert.Contains(config, kvp => kvp.Key == "ConnectionStrings__resource" && kvp.Value == "Server=localhost;Database=mydb"); 586Assert.Contains(config, kvp => kvp.Key == "RESOURCE_HOST" && kvp.Value == "localhost"); 587Assert.Contains(config, kvp => kvp.Key == "RESOURCE_PORT" && kvp.Value == "5432"); 608Assert.Contains(config, kvp => kvp.Key == "ConnectionStrings__resource" && kvp.Value == "Server=localhost;Database=mydb"); 611Assert.Contains(config, kvp => kvp.Key == "RESOURCE_HOST" && kvp.Value == "localhost"); 612Assert.Contains(config, kvp => kvp.Key == "RESOURCE_PORT" && kvp.Value == "5432"); 633Assert.Contains(config, kvp => kvp.Key == "ConnectionStrings__resource" && kvp.Value == "Server=localhost;Database=mydb"); 636Assert.Contains(config, kvp => kvp.Key == "RESOURCE_HOST" && kvp.Value == "localhost"); 637Assert.Contains(config, kvp => kvp.Key == "RESOURCE_PORT" && kvp.Value == "5432"); 660Assert.Contains(config, kvp => kvp.Key == "ConnectionStrings__resource" && kvp.Value == "Server=localhost;Database=mydb"); 663Assert.Contains(config, kvp => kvp.Key == "RESOURCE_HOST" && kvp.Value == "localhost"); 664Assert.Contains(config, kvp => kvp.Key == "RESOURCE_PORT" && kvp.Value == "5432"); 685Assert.Contains(config, kvp => kvp.Key == "ConnectionStrings__resource" && kvp.Value == "Server=localhost;Database=mydb"); 688Assert.Contains(config, kvp => kvp.Key == "RESOURCE_HOST"); 689Assert.Contains(config, kvp => kvp.Key == "RESOURCE_PORT"); 712Assert.DoesNotContain(config, kvp => kvp.Key == "ConnectionStrings__resource"); 715Assert.Contains(config, kvp => kvp.Key == "RESOURCE_HOST" && kvp.Value == "localhost"); 716Assert.Contains(config, kvp => kvp.Key == "RESOURCE_PORT" && kvp.Value == "5432"); 741Assert.Contains(config, kvp => kvp.Key == "ConnectionStrings__resource" && kvp.Value == "Server=localhost;Database=mydb"); 744Assert.DoesNotContain(config, kvp => kvp.Key == "RESOURCE_HOST"); 745Assert.DoesNotContain(config, kvp => kvp.Key == "RESOURCE_PORT"); 763Assert.Contains(config, kvp => kvp.Key == "ConnectionStrings__bob" && kvp.Value == "Server=localhost;Database=mydb"); 764Assert.Contains(config, kvp => kvp.Key == "BOB_HOST" && kvp.Value == "localhost"); 765Assert.Contains(config, kvp => kvp.Key == "BOB_PORT" && kvp.Value == "5432"); 766Assert.DoesNotContain(config, kvp => kvp.Key == "RESOURCE_HOST"); 767Assert.DoesNotContain(config, kvp => kvp.Key == "RESOURCE_PORT"); 785Assert.Contains(config, kvp => kvp.Key == "RESOURCE_WITH_DASH_HOST" && kvp.Value == "localhost"); 786Assert.Contains(config, kvp => kvp.Key == "RESOURCE_WITH_DASH_PORT" && kvp.Value == "5432"); 787Assert.DoesNotContain(config, kvp => kvp.Key == "RESOURCE-WITH-DASH_HOST"); 788Assert.DoesNotContain(config, kvp => kvp.Key == "RESOURCE-WITH-DASH_PORT");
WithTerminalTests.cs (2)
1189environment.Single(pair => pair.Key == KnownConfigNames.TerminalHostParentProcessId).Value); 1193environment.Single(pair => pair.Key == KnownConfigNames.TerminalHostParentProcessStartedStable).Value);
Aspire.Hosting.TestUtilities (4)
tests\Shared\Logging\LogTestHelpers.cs (1)
31return list?.SingleOrDefault(kvp => kvp.Key == key).Value;
tests\Shared\Logging\LogValuesAssert.cs (3)
54return string.Join(",", logValues.Select(kvp => $"[{kvp.Key} {kvp.Value}]")); 61return string.Equals(x.Key, y.Key) && object.Equals(x.Value, y.Value);
Aspire.Hosting.Valkey.Tests (4)
ConnectionPropertiesTests.cs (4)
22Assert.Equal("Host", property.Key); 27Assert.Equal("Port", property.Key); 32Assert.Equal("Password", property.Key); 37Assert.Equal("Uri", property.Key);
Aspire.Hosting.Yarp (2)
YarpEnvConfigGenerator.cs (2)
49FlattenToEnvVars(environmentVariables, kvp.Value, $"{prefix}__{kvp.Key}"); 56FlattenToEnvVars(environmentVariables, kvp.Value, $"{prefix}__{kvp.Key}");
Aspire.Hosting.Yarp.Tests (1)
YarpConfigGeneratorTests.cs (1)
239sb.AppendLine($"{variable.Key}={variable.Value}");
Aspire.Microsoft.Extensions.Configuration.AzureAppConfiguration.Tests (2)
tests\Aspire.Azure.Security.KeyVault.Tests\MockTransport.cs (2)
116protected override IEnumerable<HttpHeader> EnumerateHeaders() => _headers.Select(h => new HttpHeader(h.Key, JoinHeaderValue(h.Value))); 207protected override IEnumerable<HttpHeader> EnumerateHeaders() => _headers.Select(h => new HttpHeader(h.Key, JoinHeaderValue(h.Value)));
Aspire.Milvus.Client.Tests (1)
AspireMilvusExtensionTests.cs (1)
141Assert.Contains(healthCheckReport.Entries, x => x.Key == healthCheckName);
Aspire.MongoDB.Driver.Tests (2)
AspireMongoDBDriverExtensionsTests.cs (2)
138Assert.Contains(healthCheckReport.Entries, x => x.Key == healthCheckName); 182Assert.Contains(healthCheckReport.Entries, x => x.Key == healthCheckName);
Aspire.MongoDB.Driver.v2.Tests (2)
tests\Aspire.MongoDB.Driver.Tests\AspireMongoDBDriverExtensionsTests.cs (2)
138Assert.Contains(healthCheckReport.Entries, x => x.Key == healthCheckName); 182Assert.Contains(healthCheckReport.Entries, x => x.Key == healthCheckName);
Aspire.NATS.Net.Tests (2)
AspireNatsClientExtensionsTests.cs (2)
176Assert.Contains(healthCheckReport.Entries, x => x.Key == healthCheckName); 271Assert.Contains(activity.Tags, kvp => kvp.Key == "messaging.system" && kvp.Value == "nats");
Aspire.Oracle.EntityFrameworkCore.Tests (2)
ConformanceTests.cs (2)
178Assert.Contains(exportedActivities, activity => activity.Tags.Any(x => x.Key == "server.address")); 179Assert.Contains(exportedActivities, activity => activity.Tags.Any(x => x.Key == "db.system"));
Aspire.Playground.Tests (4)
tests\Shared\Logging\LogTestHelpers.cs (1)
31return list?.SingleOrDefault(kvp => kvp.Key == key).Value;
tests\Shared\Logging\LogValuesAssert.cs (3)
54return string.Join(",", logValues.Select(kvp => $"[{kvp.Key} {kvp.Value}]")); 61return string.Equals(x.Key, y.Key) && object.Equals(x.Value, y.Value);
Aspire.Qdrant.Client.Tests (1)
AspireQdrantClientExtensionsTest.cs (1)
55Assert.Contains(healthCheckReport.Entries, x => x.Key == healthCheckName);
Aspire.RabbitMQ.Client.Tests (7)
AspireRabbitMQLoggingTests.cs (7)
171Assert.Equal("exception.type", errorEvent[0].Key); 174Assert.Equal("exception.message", errorEvent[1].Key); 177Assert.Equal("exception.stacktrace", errorEvent[2].Key); 217Assert.Equal("exception.type", errorEvent[0].Key); 220Assert.Equal("exception.message", errorEvent[1].Key); 223Assert.Equal("exception.stacktrace", errorEvent[2].Key); 226Assert.Equal("exception.innerexception", errorEvent[3].Key);
Aspire.RabbitMQ.Client.v6.Tests (7)
tests\Aspire.RabbitMQ.Client.Tests\AspireRabbitMQLoggingTests.cs (7)
171Assert.Equal("exception.type", errorEvent[0].Key); 174Assert.Equal("exception.message", errorEvent[1].Key); 177Assert.Equal("exception.stacktrace", errorEvent[2].Key); 217Assert.Equal("exception.type", errorEvent[0].Key); 220Assert.Equal("exception.message", errorEvent[1].Key); 223Assert.Equal("exception.stacktrace", errorEvent[2].Key); 226Assert.Equal("exception.innerexception", errorEvent[3].Key);
Aspire.StackExchange.Redis (2)
src\Vendoring\OpenTelemetry.Instrumentation.StackExchangeRedis\StackExchangeRedisConnectionInstrumentation.cs (2)
140this.Cache.TryRemove((entry.Key.TraceId, entry.Key.SpanId), out _);
Aspire.StackExchange.Redis.DistributedCaching.Tests (3)
DistributedCacheConformanceTests.cs (3)
74Assert.Contains(activity.Tags, kvp => kvp.Key == "db.system" && kvp.Value == "redis"); 79Assert.Contains(activity.Tags, kvp => kvp.Key == "db.system" && kvp.Value == "redis"); 84Assert.Contains(activity.Tags, kvp => kvp.Key == "db.system" && kvp.Value == "redis");
Aspire.StackExchange.Redis.OutputCaching.Tests (3)
OutputCacheConformanceTests.cs (3)
74Assert.Contains(activity.Tags, kvp => kvp.Key == "db.system" && kvp.Value == "redis"); 79Assert.Contains(activity.Tags, kvp => kvp.Key == "db.system" && kvp.Value == "redis"); 84Assert.Contains(activity.Tags, kvp => kvp.Key == "db.system" && kvp.Value == "redis");
Aspire.StackExchange.Redis.Tests (1)
AspireRedisExtensionsTests.cs (1)
296Assert.Contains(activity.Tags, kvp => kvp.Key == "db.system" && kvp.Value == "redis");
Aspire.Templates.Tests (4)
tests\Shared\TemplatesTesting\AspireProject.cs (2)
194AppHostProcess.StartInfo.Environment[item.Key] = item.Value; 195_testOutput.WriteLine($"\t[{item.Key}] = {item.Value}");
tests\Shared\TemplatesTesting\ToolCommand.cs (2)
249_testOutput.WriteLine($"{_msgPrefix}\t[{item.Key}] = {item.Value}"); 250psi.Environment[item.Key] = item.Value;
Binding.Http.IntegrationTests (4)
BasicHttpBindingTests.4.0.0.cs (4)
168if (!header.Key.Equals("Content-Length") && message.Content.Headers.Contains(header.Key)) 170message.Content.Headers.Remove(header.Key); 173message.Content.Headers.Add(header.Key, header.Value);
BlazorHosted.ClientServiceDefaults (2)
BackgroundExportHandler.cs (2)
93headers.Add(new(header.Key, header.Value.ToArray())); 112clone.Headers.TryAddWithoutValidation(header.Key, header.Value);
BlazorStandalone.ClientServiceDefaults (2)
BackgroundExportHandler.cs (2)
97headers.Add(new(header.Key, header.Value.ToArray())); 116clone.Headers.TryAddWithoutValidation(header.Key, header.Value);
Client.ClientBase.IntegrationTests (1)
ClientBaseTestHelpers.cs (1)
21string headerFullName = keyValue.Key;
ConfigurationSchemaGenerator (2)
ConfigSchemaEmitter.cs (2)
744obj.OrderBy(p => p.Key, StringComparer.Ordinal) : 749writer.WritePropertyName(pair.Key);
crossgen2 (9)
Program.cs (9)
126if (String.Compare(inputFile.Key, "System.Private.CoreLib", StringComparison.OrdinalIgnoreCase) == 0) 137if (String.Compare(inputFile.Key, "System.Private.CoreLib", StringComparison.OrdinalIgnoreCase) == 0) 185_allInputFilePaths.Add(inputFile.Key, inputFile.Value); 186inputFilePaths.Add(inputFile.Key, inputFile.Value); 204if (!_allInputFilePaths.ContainsKey(unrootedInputFile.Key)) 206_allInputFilePaths.Add(unrootedInputFile.Key, unrootedInputFile.Value); 207unrootedInputFilePaths.Add(unrootedInputFile.Key, unrootedInputFile.Value); 287singleCompilationInputFilePaths.Add(inputFile.Key, inputFile.Value); 292bool singleCompilationVersionBubbleIncludesCoreLib = versionBubbleIncludesCoreLib || (String.Compare(inputFile.Key, "System.Private.CoreLib", StringComparison.OrdinalIgnoreCase) == 0);
csc (4)
src\roslyn\src\Compilers\Shared\BuildProtocol.cs (1)
378WriteLengthPrefixedString(writer, pair.Key);
src\roslyn\src\Compilers\Shared\BuildServerConnection.cs (3)
480foreach (var kvp in environmentVariables.OrderBy(kvp => kvp.Key, StringComparer.OrdinalIgnoreCase)) 482envBlock.Append(kvp.Key); 647startInfo.EnvironmentVariables[kvp.Key] = kvp.Value;
dotnet (67)
_generated\103\WorkloadSearchVersionsJsonSerializerContext.DictionaryStringDictionaryStringString.g.cs (1)
59writer.WritePropertyName(entry.Key);
_generated\104\WorkloadSearchVersionsJsonSerializerContext.DictionaryStringString.g.cs (1)
59writer.WriteString(entry.Key, entry.Value);
_generated\113\WorkloadHistoryJsonSerializerContext.DictionaryStringString.g.cs (1)
59writer.WriteString(entry.Key, entry.Value);
_generated\165\TelemetryDiskLoggerJsonSerializerContext.DictionaryStringString.g.cs (1)
59writer.WriteString(entry.Key, entry.Value);
_generated\28\RunFileApiJsonSerializerContext.IReadOnlyDictionaryStringString.g.cs (1)
59writer.WriteString(entry.Key, entry.Value);
_generated\6\CliSchemaJsonSerializerContext.DictionaryStringArgumentDetails.g.cs (1)
59writer.WritePropertyName(entry.Key);
_generated\7\CliSchemaJsonSerializerContext.DictionaryStringCommandDetails.g.cs (1)
59writer.WritePropertyName(entry.Key);
_generated\72\GlobalJsonWorkloadSetsJsonSerializerContext.DictionaryStringString.g.cs (1)
59writer.WriteString(entry.Key, entry.Value);
_generated\8\CliSchemaJsonSerializerContext.DictionaryStringOptionDetails.g.cs (1)
59writer.WritePropertyName(entry.Key);
_generated\90\InstallStateJsonSerializerContext.DictionaryStringString.g.cs (1)
59writer.WriteString(entry.Key, entry.Value);
CommandFactory\CommandFactoryUsingResolver.cs (2)
112if (!psi.Environment.ContainsKey(environmentVariable.Key)) 114psi.Environment.Add(environmentVariable.Key, environmentVariable.Value);
CommandFactory\CommandSpec.cs (1)
23EnvironmentVariables.Add(environmentVariable.Key, environmentVariable.Value);
Commands\MSBuild\MSBuildLogger.cs (4)
267stringProperties[kvp.Key] = kvp.Value.ToString(CultureInfo.InvariantCulture); 286if (!eventData.ContainsKey(kvp.Key)) 288eventData[kvp.Key] = count; 292eventData[kvp.Key] += count;
Commands\New\BuiltInTemplatePackageProvider.cs (1)
105bestVersionsByBucket[coreAppVersion] = (dirInfo.Key, dirInfo.Value);
Commands\Restore\RestoringCommand.cs (2)
122.Where(kvp => !IsPropertyExcludedFromRestore(kvp.Key))? 123.ToDictionary(kvp => kvp.Key, kvp => kvp.Value, StringComparer.OrdinalIgnoreCase) is { } filteredList ? new(filteredList) : ReadOnlyDictionary<string, string>.Empty;
Commands\Test\MTP\IPC\Serializers\HandshakeMessageSerializer.cs (1)
44WriteField(stream, property.Key);
Commands\Test\MTP\MicrosoftTestingPlatformTestCommand.Help.cs (3)
168bool isBuiltIn = group.Key; 193groupedModules.Add(([.. kvp.Value], kvp.Key.Split(','))); 250Utils.Reporter.Output.WriteLine((groupedModules.Key ? CliCommandStrings.HelpUnavailableOptions : CliCommandStrings.HelpUnavailableExtensionOptions).Yellow());
Commands\Test\MTP\SolutionAndProjectUtility.cs (4)
225if (!(globalProperties ??= new Dictionary<string, string>()).ContainsKey(property.Key)) 227globalProperties.Add(property.Key, property.Value); 237if (!(globalProperties ??= new Dictionary<string, string>()).ContainsKey(property.Key)) 239globalProperties.Add(property.Key, property.Value);
Commands\Test\MTP\Terminal\TestProgressState.cs (3)
170if (IsFlakyCore(entry.Key)) 384if (IsFlakyCore(entry.Key)) 386flaky.Add((entry.Value, _testUidToResults[entry.Key].Attempts));
Commands\Test\MTP\TestApplication.cs (2)
302processStartInfo.Environment[entry.Key] = entry.Value; 1123messageBuilder.AppendLine($"{kvp.Key}: {kvp.Value}");
Commands\Test\MTP\TestApplicationHandler.cs (1)
662logMessageBuilder.AppendLine($"{GetHandshakePropertyName(property.Key)}: {property.Value}");
Commands\Test\VSTest\VSTestFeatureFlag.cs (2)
30VSTestTrace.SafeWriteTrace(() => $"Feature {flag.Key}: {IsSet(flag.Key)}");
Commands\Tool\Restore\ToolRestoreCommand.cs (2)
199.Select(pair => (pair.Key.PackageId, pair.Key.CommandName))
Commands\Workload\GlobalJsonWorkloadSetFile.cs (2)
70var updatedVersion = GetWorkloadVersionFromGlobalJson(kvp.Key); 77globalJsonWorkloadSetVersions.Remove(kvp.Key);
Commands\Workload\Install\WorkloadGarbageCollector.cs (3)
59WorkloadSetsToKeep.AddRange(_workloadSets.Where(kvp => kvp.Value != GCAction.Collect).Select(kvp => kvp.Key)); 60ManifestsToKeep.AddRange(_manifests.Where(kvp => kvp.Value != GCAction.Collect).Select(kvp => kvp.Key)); 81_workloadSets = installedWorkloadSets.ToDictionary(kvp => kvp.Key, kvp => kvp.Value.IsBaselineWorkloadSet ? GCAction.KeepWithoutPacks : GCAction.Collect);
Commands\Workload\Install\WorkloadManifestUpdater.Managed.cs (3)
170new ManifestId(m.Key), 179kvp => (kvp.Key, new ManifestVersionWithBand(kvp.Value.Version, kvp.Value.FeatureBand)))); 205return versions.Select(kvp => (kvp.Key, new ManifestVersionWithBand(kvp.Value.Version, kvp.Value.FeatureBand)));
Commands\Workload\InstallingWorkloadCommand.cs (1)
348!currentInstallState.Manifests.All(m => oldInstallState.Manifests.TryGetValue(m.Key, out var val) && val.Equals(m.Value))))
Commands\Workload\List\WorkloadListCommand.cs (3)
111table.AddColumn(CliCommandStrings.WorkloadIdColumn, workload => workload.Key); 114var m = _workloadListHelper.WorkloadResolver.GetManifestFromWorkload(new WorkloadId(workload.Key)); 121table.PrintRows(installedWorkloads.AsEnumerable().OrderBy(workload => workload.Key), l => Reporter.WriteLine(l));
Commands\Workload\Search\WorkloadSearchVersionsCommand.cs (1)
146table.AddColumn(CliCommandStrings.WorkloadManifestIdColumn, manifest => manifest.Key.ToString());
Commands\Workload\WorkloadHistoryRecord.cs (1)
78hc.Add(kvp.Key);
Commands\Workload\WorkloadInfoHelper.cs (3)
145installed.AsEnumerable().Select(t => new WorkloadId(t.Key))); 207var workloadManifest = WorkloadResolver.GetManifestFromWorkload(new WorkloadId(workload.Key)); 213reporter.WriteLine($" [{workload.Key}]");
ShellShim\ShellShimRepository.cs (1)
153FileAccessRetrier.RetryOnMoveAccessFailure(() => _fileSystem.File.Move(kvp.Value, kvp.Key));
src\sdk\artifacts\.packages\microsoft.codeanalysis.buildclient\5.11.0-1.26424.106\contentFiles\cs\net11.0\BuildProtocol.cs (1)
378WriteLengthPrefixedString(writer, pair.Key);
src\sdk\artifacts\.packages\microsoft.codeanalysis.buildclient\5.11.0-1.26424.106\contentFiles\cs\net11.0\BuildServerConnection.cs (3)
480foreach (var kvp in environmentVariables.OrderBy(kvp => kvp.Key, StringComparer.OrdinalIgnoreCase)) 482envBlock.Append(kvp.Key); 647startInfo.EnvironmentVariables[kvp.Key] = kvp.Value;
Telemetry\TelemetryClient.cs (3)
371.Select(p => new KeyValuePair<string, object?>(p.Key, p.Value)); 374.Select(p => new KeyValuePair<string, object?>(p.Key, p.Value)) 375.OrderBy(p => p.Key);
ToolPackage\LocalToolsResolverCache.cs (4)
37foreach (var distinctPackageIdAndRestoredCommandMap in restoredCommandMap.GroupBy(x => x.Key.PackageId)) 47pair.Key, 49.Select(pair => ConvertToCacheRow(pair.Key, pair.Value)); 61mapWithSamePackageId.Key,
dotnet-aot (16)
_generated\24\TelemetryDiskLoggerJsonSerializerContext.DictionaryStringString.g.cs (1)
59writer.WriteString(entry.Key, entry.Value);
_generated\60\InstallStateJsonSerializerContext.DictionaryStringString.g.cs (1)
59writer.WriteString(entry.Key, entry.Value);
_generated\7\CliSchemaJsonSerializerContext.DictionaryStringArgumentDetails.g.cs (1)
59writer.WritePropertyName(entry.Key);
_generated\8\CliSchemaJsonSerializerContext.DictionaryStringCommandDetails.g.cs (1)
59writer.WritePropertyName(entry.Key);
_generated\9\CliSchemaJsonSerializerContext.DictionaryStringOptionDetails.g.cs (1)
59writer.WritePropertyName(entry.Key);
src\sdk\src\Cli\dotnet\CommandFactory\CommandFactoryUsingResolver.cs (2)
112if (!psi.Environment.ContainsKey(environmentVariable.Key)) 114psi.Environment.Add(environmentVariable.Key, environmentVariable.Value);
src\sdk\src\Cli\dotnet\Commands\Workload\WorkloadInfoHelper.cs (2)
207var workloadManifest = WorkloadResolver.GetManifestFromWorkload(new WorkloadId(workload.Key)); 213reporter.WriteLine($" [{workload.Key}]");
src\sdk\src\Cli\dotnet\Telemetry\TelemetryClient.cs (3)
371.Select(p => new KeyValuePair<string, object?>(p.Key, p.Value)); 374.Select(p => new KeyValuePair<string, object?>(p.Key, p.Value)) 375.OrderBy(p => p.Key);
src\sdk\src\Cli\dotnet\ToolPackage\LocalToolsResolverCache.cs (4)
37foreach (var distinctPackageIdAndRestoredCommandMap in restoredCommandMap.GroupBy(x => x.Key.PackageId)) 47pair.Key, 49.Select(pair => ConvertToCacheRow(pair.Key, pair.Value)); 61mapWithSamePackageId.Key,
dotnet-format (2)
Analyzers\AnalyzerFormatter.cs (1)
172return result.Diagnostics.ToImmutableDictionary(kvp => kvp.Key.Id, kvp => kvp.Value.Select(diagnostic => diagnostic.Id).ToImmutableHashSet());
Utilities\ProcessRunner.cs (1)
186processStartInfo.EnvironmentVariables[pair.Key] = pair.Value;
dotnet-openapi (2)
Commands\BaseCommand.cs (1)
197var packageId = kvp.Key;
ProjectExtensions.cs (1)
17item.Xml.AddMetadata(kvp.Key, kvp.Value, expressAsAttribute: true);
dotnet-svcutil-lib (68)
CommandProcessorOptions.cs (1)
670invalidNamespaces.Select(n => $"'{n.Key},{n.Value}'").Aggregate((msg, n) => $"{msg}, {n}")));
FrameworkFork\Microsoft.Xml\Xml\Dom\DocumentSchemaValidator.cs (1)
491defaultPrefix = pair.Key;
FrameworkFork\Microsoft.Xml\Xml\schema\SchemaInfo.cs (4)
361if (!_elementDecls.ContainsKey(entry.Key)) 363_elementDecls.Add(entry.Key, entry.Value); 368if (!_elementDeclsByType.ContainsKey(entry.Key)) 370_elementDeclsByType.Add(entry.Key, entry.Value);
FrameworkFork\Microsoft.Xml\Xml\schema\XmlSchemaValidator.cs (1)
2175defaultPrefix = pair.Key;
FrameworkFork\Microsoft.Xml\Xml\Serialization\CodeGenerator.cs (1)
2710Tuple<Type, string> key = new Tuple<Type, string>(item.Value.LocalType, item.Key);
FrameworkFork\Microsoft.Xml\Xml\Serialization\Types.cs (2)
1186replaceList.Add(pair.Key, replacedInfo); 1194memberInfos[pair.Key] = pair.Value;
FrameworkFork\Microsoft.Xml\Xml\XPath\XPathNavigator.cs (2)
1983if (pair.Key != "xmlns") 1984mngr.AddNamespace(pair.Key, pair.Value);
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\CodeExporter.cs (5)
79string dataContractNamespace = pair.Key; 988if (dataContract.StableName != pair.Key && !dataContract.KnownDataContracts.ContainsKey(pair.Key) && !pair.Value.IsBuiltInDataContract) 989dataContract.KnownDataContracts.Add(pair.Key, pair.Value); 1318memberNames.Add(pair.Key, pair.Value);
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\CollectionDataContract.cs (2)
28_kvpKey = kvPair.Key; 1512return new KeyValue<K, V>(current.Key, current.Value);
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\DataContractSet.cs (2)
45Add(pair.Key, pair.Value); 52ProcessedContracts.Add(pair.Key, pair.Value);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\AddressHeaderCollection.cs (1)
131if (otherHeaders.TryGetValue(pair.Key, out count))
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\ConnectionPool.cs (1)
103endpointKeysToRemove.Add(poolEntry.Key);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpRequestMessageExtensionMethods.cs (4)
36if (!httpHeaders.TryAddWithoutValidation(header.Key, header.Value)) 40header.Key, 54string key = property.Key; 117webHeaders[header.Key] = String.Join(",", header.Value);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\MessageProperties.cs (7)
428this[property.Key] = property.Value; 768UpdateProperty(pair.Key, pair.Value, true); 778if (pair.Key == null) 781if (!TryGetValue(pair.Key, out value)) 840if (pair.Key == null) 844if (!TryGetValue(pair.Key, out value)) 852Remove(pair.Key);
FrameworkFork\System.ServiceModel\System\ServiceModel\Configuration\SecurityElementBase.cs (2)
161if (!b2.OperationSupportingTokenParameters.ContainsKey(operation1.Key)) 164SupportingTokenParameters stp2 = b2.OperationSupportingTokenParameters[operation1.Key];
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\ImportedPolicyConversionContext.cs (11)
67_operationBindingAssertions[entry.Key].AddRange(new MaxItemsEnumerable<XmlElement>(entry.Value, remainingAssertionsAllowed)); 68remainingAssertionsAllowed -= _operationBindingAssertions[entry.Key].Count; 73_messageBindingAssertions[entry.Key].AddRange(new MaxItemsEnumerable<XmlElement>(entry.Value, remainingAssertionsAllowed)); 74remainingAssertionsAllowed -= _messageBindingAssertions[entry.Key].Count; 79_faultBindingAssertions[entry.Key].AddRange(new MaxItemsEnumerable<XmlElement>(entry.Value, remainingAssertionsAllowed)); 80remainingAssertionsAllowed -= _faultBindingAssertions[entry.Key].Count; 261digits[i] = new KeyValuePair<K, IEnumerator<V>>(kvp.Key, kvp.Value.GetEnumerator()); 267counterValue[digits[i].Key] = digits[i].Value.Current; 284IEnumerator<V> newDigit = sets[digits[currentDigit].Key].GetEnumerator(); 285digits[currentDigit] = new KeyValuePair<K, IEnumerator<V>>(digits[currentDigit].Key, newDigit); 300counterValue[digits[i].Key] = digits[i].Value.Current;
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\WsdlImporter.cs (1)
2366string key = CreateKeyFromPolicy(policyDocument.Key, policyDocument.Value);
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\DataContractSerializerOperationFormatter.cs (3)
283if (multipleHeaderValues[headerDescription.Index].Key == null) 318if (multipleHeaderValues[i].Key != null) 319parameters[i] = multipleHeaderValues[i].Value.ToArray(multipleHeaderValues[i].Key);
ImportModule.cs (5)
224contractGenerator.NamespaceMappings.Add(namespaceMapping.Key, namespaceMapping.Value); 325Debug.Assert(!dcOptions.Namespaces.ContainsKey(namespaceMapping.Key), $"Key '{namespaceMapping.Key}' already added to dictionary!"); 326dcOptions.Namespaces[namespaceMapping.Key] = namespaceMapping.Value; 348importOptions.ClrNamespace = options.NamespaceMappings.FirstOrDefault(m => m.Key == "*").Value;
Shared\MSBuildProj.cs (5)
965if (!this.GlobalProperties.Any(p => p.Key == "TargetFramework")) 970if (!this.GlobalProperties.Any(p => p.Key == "SdkVersion")) 977var propertyTable = this._resolvedProperties.Where(p => propertyNames.Contains(p.Key)); 985this._resolvedProperties[entry.Key] = entry.Value; 990return this._resolvedProperties.Where(p => propertyNames.Contains(p.Key));
Shared\Options\OptionsSerializer.cs (5)
55bool optionFound = options.TryGetOption(jPropInfo.Key, out var option); 68option.Deserialize(new JValue(jPropInfo.Key)); 82options.AddWarning(string.Format(CultureInfo.CurrentCulture, Shared.Resources.WarningUnrecognizedOptionFormat, jPropInfo.Key)); 108if (options.TryGetOption(jProperty.Key, out var option)) 114options.AddWarning(string.Format(CultureInfo.CurrentCulture, Shared.Resources.WarningUnrecognizedOptionFormat, jProperty.Key));
Shared\Options\OptionValueParser.cs (1)
135value = $"{pair.Key}, {pair.Value}";
Shared\Utilities\ProcessRunner.cs (1)
79foreach (var environmentVar in environmentVariables.Where(e => !string.IsNullOrWhiteSpace(e.Key)))
dotnet-svcutil-lib.Tests (1)
TestInit.cs (1)
416failureMessage += string.Format(g_DiffBaselineErrorFormat, diffLines.Value.Key, diffLines.Value.Value, baseline, generated);
dotnet-user-jwts (5)
_generated\5\JwtSerializerContext.IDictionaryStringJwt.g.cs (1)
59writer.WritePropertyName(entry.Key);
_generated\6\JwtSerializerContext.IDictionaryStringString.g.cs (1)
59writer.WriteString(entry.Key, entry.Value);
Commands\CreateCommand.cs (1)
218optionsString += $"{Resources.JwtPrint_CustomClaims}: [{string.Join(", ", claims.Select(kvp => $"{kvp.Key}={kvp.Value}"))}]{Environment.NewLine}";
Helpers\DevJwtCliHelpers.cs (1)
281: string.Join(", ", jwt.CustomClaims.Select(kvp => $"{kvp.Key}={kvp.Value}"));
Helpers\JwtIssuer.cs (1)
46identity.AddClaims(claimsToAdd.Select(kvp => new Claim(kvp.Key, kvp.Value)));
dotnet-user-secrets (5)
_generated\0\SecretManagerJsonSerializerContext.IDictionaryStringString.g.cs (1)
59writer.WriteString(entry.Key, entry.Value);
Internal\ListCommand.cs (2)
48context.Reporter.Output(Resources.FormatMessage_Secret_Value_Format(secret.Key, secret.Value)); 58secrets[item.Key] = item.Value;
Internal\SecretsStore.cs (1)
93.ToDictionary(i => i.Key, i => i.Value, StringComparer.OrdinalIgnoreCase);
Internal\SetCommand.cs (1)
78context.SecretStore.Set(k.Key, k.Value);
dotnet-watch (3)
Program.cs (1)
367foreach (var (filePath, _) in evaluationResult.Files.OrderBy(e => e.Key))
Watch\MSBuildFileSetResult.cs (1)
31.Select(entry => new StaticFileItem() { FilePath = entry.Key, StaticWebAssetPath = entry.Value }));
Watch\StaticFileHandler.cs (1)
59var tasks = refreshRequests.Select(request => request.Key.UpdateStaticAssetsAsync(request.Value, cancellationToken).AsTask());
DotNetWatchTasks (1)
src\sdk\src\Dotnet.Watch\dotnet-watch\Watch\MSBuildFileSetResult.cs (1)
31.Select(entry => new StaticFileItem() { FilePath = entry.Key, StaticWebAssetPath = entry.Value }));
EventSourceGenerator (1)
EventSourceGenerator.Parser.cs (1)
110string argName = arg.Key;
GenerateDocumentationAndConfigFiles (60)
Program.cs (4)
555string ruleId = ruleById.Key; 656writer.Write("name", assemblymetadata.Key); 670var ruleId = rule.Key; 794string ruleId = ruleById.Key;
src\b310f676f7308b7f\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (1)
241foreach (var (symbol, write) in SymbolsWriteBuilder.SelectAsArray(kvp => !kvp.Value, kvp => kvp.Key))
src\roslyn\src\Compilers\Core\Portable\Collections\SmallDictionary.cs (1)
57this.Add(kv.Key, kv.Value);
src\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (1)
740var oldPrefix = kv.Key;
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\ConcurrentSet.cs (2)
125public T Current => _kvpEnumerator.Current.Key; 157yield return kvp.Key;
src\roslyn\src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (2)
833result.Add(entry.Key, createMembers(entry.Value)); 878dictionary.Add(entry.Key, namedTypes);
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (2)
185return TryGetValue(pair.Key, out var value) 240result[item.Key] = item.Value;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Enumerator.cs (2)
49readonly DictionaryEntry IDictionaryEnumerator.Entry => new(Current.Key, Current.Value); 51readonly object IDictionaryEnumerator.Key => Current.Key;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+KeyCollection+Enumerator.cs (1)
25public readonly TKey Current => _enumerator.Current.Key;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueBuilder.cs (6)
119=> Add(item.Key, item.Value); 127Add(pair.Key, pair.Value); 148return TryGetValue(item.Key, out var value) 192GetOrCreateMutableDictionary().Remove(item.Key); 213if (KeyComparer.Equals(pair.Key, equalKey)) 215actualKey = pair.Key;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (10)
210Add(pair.Key, pair.Value); 218Add(pair.Key, pair.Value); 271=> Add(keyValuePair.Key, keyValuePair.Value); 275ref var value = ref FindValue(keyValuePair.Key); 286ref var value = ref FindValue(keyValuePair.Key); 289Remove(keyValuePair.Key); 1234return new DictionaryEntry(_current.Key, _current.Value); 1237return new KeyValuePair<TKey, TValue>(_current.Key, _current.Value); 1261return new DictionaryEntry(_current.Key, _current.Value); 1274return _current.Key;
src\roslyn\src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
650dictionary.Add(pair.Key, pair.Value.ToImmutableAndFree());
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\SymbolNamesWithValueOption.cs (7)
139wildcardNamesBuilder.ToImmutableDictionaryAndFree(x => x.Key, x => x.Value.ToImmutableDictionaryAndFree(), wildcardNamesBuilder.Comparer)); 311names.FirstOrDefault(kvp => symbolDeclarationId.StartsWith(kvp.Key, StringComparison.Ordinal)) is var prefixedFirstMatchOrDefault && 312!string.IsNullOrWhiteSpace(prefixedFirstMatchOrDefault.Key)) 321value.FirstOrDefault(kvp => symbolDeclarationId.StartsWith(kvp.Key, StringComparison.Ordinal)) is var unprefixedFirstMatchOrDefault && 322!string.IsNullOrWhiteSpace(unprefixedFirstMatchOrDefault.Key)) 331allKindsValue.FirstOrDefault(kvp => symbol.Name.StartsWith(kvp.Key, StringComparison.Ordinal)) is var partialFirstMatchOrDefault && 332!string.IsNullOrWhiteSpace(partialFirstMatchOrDefault.Key))
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledConcurrentDictionary.cs (1)
81var added = instance.TryAdd(kvp.Key, kvp.Value);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledConcurrentSet.cs (2)
122yield return kvp.Key; 152public T Current => _kvpEnumerator.Current.Key;
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledDictionary.cs (1)
81instance.Add(kvp.Key, kvp.Value);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (2)
77foreach (var kvp in ruleset.SpecificDiagnosticOptions.OrderBy(kvp => kvp.Key)) 79var id = kvp.Key;
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\SmallDictionary.cs (1)
59this.Add(kv.Key, kv.Value);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageResult.cs (4)
48=> SymbolWritesMap.SelectAsArray(kvp => !kvp.Value, kvp => kvp.Key); 59if (kvp.Key.write == null && Equals(kvp.Key.symbol, parameter)) 76if (Equals(kvp.Key.symbol, symbol))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser.cs (2)
97where kvp.Key.Trim().StartsWith("dotnet_naming_rule.", StringComparison.Ordinal) 98let nameSplit = kvp.Key.Split('.')
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BidirectionalMap.cs (1)
25backwardMap: ImmutableDictionary.CreateRange(valueComparer, pairs.Select(static p => KeyValuePair.Create(p.Value, p.Key))))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IDictionaryExtensions.cs (2)
239if (predicate(entry.Key, entry.Value, arg)) 241dictionary.Remove(entry.Key);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\INamedTypeSymbolExtensions.cs (3)
612comparer.Equals(member.Name, kvp.Key.Name) && 613SignatureComparer.Instance.HaveSameSignature(member, kvp.Key, caseSensitive)); 617result.Remove(match.Key);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (1)
246predicate: kvp => safeImportsToAdd.Contains(kvp.Key),
GetDocument.Insider (4)
Commands\GetDocumentCommand.cs (1)
78keyValuePair.Value.Assembly = Assembly.Load(new AssemblyName(keyValuePair.Key));
src\44e1214b125d320f\HostFactoryResolver.cs (3)
341if (value.Key == "HostBuilding") 345else if (value.Key == "HostBuilt") 355else if (_arbitraryActions?.TryGetValue(value.Key, out var arbitraryAction) == true)
ILAssembler (1)
GrammarVisitor.cs (1)
3400string labelName = undefinedLabel.Key;
ILCompiler.Compiler (62)
Compiler\AnalysisBasedMetadataManager.cs (3)
190yield return pair.Key; 210MethodDesc method = pair.Key; 219FieldDesc field = pair.Key;
Compiler\BodySubstitutionParser.cs (2)
251_bodySubstitutions[kvp.Key] = kvp.Value; 254_fieldSubstitutions[kvp.Key] = kvp.Value;
Compiler\Dataflow\ArrayValue.cs (3)
81if (!otherArr.IndexValues.TryGetValue(kvp.Key, out ValueBasicBlockPair value) || !kvp.Value.Equals(value)) 101newValue.IndexValues.Add(kvp.Key, new ValueBasicBlockPair(kvp.Value.Value.DeepCopy(), kvp.Value.BasicBlockIndex)); 115$"({element.Key},({string.Join(",", element.Value.Value.AsEnumerable())}))")));
Compiler\DependencyAnalysis\DehydratedDataNode.cs (2)
101relocSort[i] = new KeyValuePair<ISymbolNode, int>(relocSort[i].Key, i); 315builder.EmitReloc(relocSort[i].Key, RelocType.IMAGE_REL_BASED_RELPTR32);
Compiler\DependencyAnalysis\ExternalTypeMapNode.cs (1)
93yield return (entry.Key, targetNode);
Compiler\DependencyAnalysis\GenericVirtualMethodTableNode.cs (3)
102Debug.Assert(!gvmEntry.Key.OwningType.IsInterface); 106MethodDesc callingMethod = gvmEntry.Key; 107TypeDesc implementationType = implementationEntry.Key;
Compiler\DependencyAnalysis\InterfaceGenericVirtualMethodTableNode.cs (3)
147Debug.Assert(gvmEntry.Key.OwningType.IsInterface); 149MethodDesc callingMethod = gvmEntry.Key; 197TypeDesc implementationType = currentImpl.Key;
Compiler\DependencyAnalysis\NativeLayoutVertexNode.cs (4)
844return left.Key - right.Key; 1002return left.Key - right.Key;
Compiler\ManifestResourceBlockingPolicy.cs (3)
57if (!result.TryGetValue(item.Key, out HashSet<string> set)) 58result.Add(item.Key, set = new HashSet<string>()); 69copy.Add(moduleSet.Key, moduleSet.Value);
Compiler\MetadataManager.cs (1)
853methodMetadataMappings[methodMapping.Key] = writer.GetRecordHandle(methodMapping.Value);
Compiler\MstatObjectDumper.cs (2)
179blobs.LoadString(_emitter.GetUserStringHandle(b.Key)); 187deduplicatedMethods.Token(_emitter.EmitMetadataHandleForTypeSystemEntity(d.Key));
Compiler\ReachabilityInstrumentationProvider.cs (4)
175Array.Sort(useInfos, (a, b) => TypeSystemComparer.Instance.Compare(a.Key, b.Key)); 184Guid mvid = item.Key.MetadataReader.GetGuid(item.Key.MetadataReader.GetModuleDefinition().Mvid);
Compiler\TypePreinit.cs (2)
108values.Add(new KeyValuePair<FieldDesc, ISerializableValue>(kvp.Key, kvp.Value)); 3795_fieldValues.Add(field.Key, field.Value);
Compiler\UsageBasedMetadataManager.cs (1)
1002yield return new ReflectableEntity<T>(entry.Key, entry.Value);
src\runtime\src\coreclr\tools\Common\Compiler\GenericCycleDetection\ModuleCycleInfo.cs (4)
299TypeSystemEntity referent = actualProblem.Key.Referent; 300TypeSystemEntity owner = actualProblem.Key.Owner; 323logger.LogWarning(actualProblem.Key.Owner, DiagnosticId.GenericRecursionCycle, actualProblem.Key.Referent.GetDisplayName(), message);
src\runtime\src\coreclr\tools\Common\Compiler\ObjectDataInterner.cs (1)
70if (!b.TryGetValue(kvp.Key, out ISymbolNode value) || value != kvp.Value)
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\OutputInfoBuilder.cs (1)
196OutputNode node = _nodeSymbolMap[symbolMethodPair.Key];
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\PEObjectWriter.cs (1)
688uint pageRva = kv.Key;
src\runtime\src\coreclr\tools\Common\Compiler\TypeMapMetadata.cs (2)
170AddAssociatedTypeMapEntry(kvp.Key, kvp.Value); 200AddExternalTypeMapEntry(kvp.Key, kvp.Value.type, kvp.Value.trimmingTarget);
src\runtime\src\coreclr\tools\Common\Compiler\Win32Resources\ResourceData.cs (12)
138return _resTypeHeadID.SelectMany(typeIdPair => SelectResType(typeIdPair.Key, typeIdPair.Value)) 139.Concat(_resTypeHeadName.SelectMany(typeNamePair => SelectResType(typeNamePair.Key, typeNamePair.Value))); 143return resType.NameHeadID.SelectMany(nameIdPair => SelectResName(type, nameIdPair.Key, nameIdPair.Value)) 145SelectResName(type, nameNamePair.Key, nameNamePair.Value))); 150return resType.Languages.Select((lang) => (name, type, lang.Key, lang.Value.DataEntry)); 206resTypes.Add(new Tuple<ResType, ObjectDataBuilder.Reservation>(res.Value, IMAGE_RESOURCE_DIRECTORY_ENTRY.Write(ref dataBuilder, res.Key, nameTable))); 210resTypes.Add(new Tuple<ResType, ObjectDataBuilder.Reservation>(res.Value, IMAGE_RESOURCE_DIRECTORY_ENTRY.Write(ref dataBuilder, res.Key))); 220resNames.Add(new Tuple<ResName, ObjectDataBuilder.Reservation>(res.Value, IMAGE_RESOURCE_DIRECTORY_ENTRY.Write(ref dataBuilder, res.Key, nameTable))); 224resNames.Add(new Tuple<ResName, ObjectDataBuilder.Reservation>(res.Value, IMAGE_RESOURCE_DIRECTORY_ENTRY.Write(ref dataBuilder, res.Key))); 234resLanguages.Add(new Tuple<ResLanguage, ObjectDataBuilder.Reservation>(res.Value, IMAGE_RESOURCE_DIRECTORY_ENTRY.Write(ref dataBuilder, res.Key))); 247dataBuilder.EmitUShort(checked((ushort)name.Key.Length)); 248foreach (char c in name.Key)
src\runtime\src\coreclr\tools\Common\TypeSystem\MetadataEmitter\TypeSystemMetadataEmitter.cs (3)
184yield return new KeyValuePair<TypeSystemEntity, EntityHandle>(item.Key, item.Value); 189yield return new KeyValuePair<TypeSystemEntity, EntityHandle>(item.Key, item.Value); 194yield return new KeyValuePair<TypeSystemEntity, EntityHandle>(item.Key, item.Value);
src\runtime\src\tools\illink\src\ILLink.Shared\DataFlow\DefaultValueDictionary.cs (3)
63if (!Get(kvp.Key).Equals(kvp.Value)) 88sb.AppendLine().Append('\t').Append(kvp.Key.ToString()).Append(" -> ").Append(kvp.Value.ToString()); 104var key = kvp.Key;
src\runtime\src\tools\illink\src\ILLink.Shared\DataFlow\DictionaryLattice.cs (1)
32TKey key = kvp.Key;
ILCompiler.MetadataTransform (2)
ILCompiler\Metadata\MetadataTransformResult.cs (1)
104yield return new KeyValuePair<Cts.MethodDesc, Method>(entry.Key, m);
Internal\Metadata\NativeFormat\Writer\NativeMetadataWriter.cs (1)
214res.Add(kv.Key, Visit(src, kv.Value, true));
ILCompiler.ReadyToRun (72)
Compiler\CallChainProfile.cs (4)
72var resolvedKeyMethod = CachedResolveMethodName(nameToMethodDescMap, keyAndMethods.Key, context); 80var resolvedCalledMethod = CachedResolveMethodName(nameToMethodDescMap ,methodAndHitCount.Key, context); 312Console.WriteLine($"{key.Key.ToString()}"); 316Console.WriteLine($"\t{calledMethodAndCount.Key.ToString()} -> {calledMethodAndCount.Value} calls");
Compiler\DependencyAnalysis\ReadyToRun\CopiedMethodILDeduplicator.cs (1)
54symbolRemapping.TryAdd(entry.Key, entry.Value);
Compiler\DependencyAnalysis\ReadyToRun\InliningInfoNode.cs (1)
144MethodDesc inlinee = inlineeWithInliners.Key;
Compiler\DependencyAnalysis\ReadyToRun\ManifestMetadataTableNode.cs (2)
302foreach (var idAndAssemblyName in _moduleIdToAssemblyNameMap.OrderBy(x => x.Key)) 307Debug.Assert(((handle.Value & 0xFFFFFF) + (_assemblyRefCount)) == (idAndAssemblyName.Key - 1));
Compiler\FileLayoutOptimizer.cs (4)
290foreach (KeyValuePair<MethodDesc, Dictionary<MethodDesc, int>> methodProfile in _profileData.CallChainProfile.ResolvedProfileData.Where(kvp => methodMap.ContainsKey(kvp.Key))) 292foreach (KeyValuePair<MethodDesc, int> callee in methodProfile.Value.Where(kvp => methodMap.ContainsKey(kvp.Key))) 294callList.Add(new CallerCalleeCount(methodProfile.Key, callee.Key, callee.Value));
Compiler\PettisHansenSort\PettisHansen.cs (16)
46AddEdge(i, kvp.Key.Index, kvp.Value); 47AddEdge(kvp.Key.Index, i, kvp.Value); 55Debug.Assert(phEdges[kvp.Key][i] == phEdges[i][kvp.Key]); 64if (kvp.Key > i) 66queue.Enqueue((i, kvp.Key), -kvp.Value); // PriorityQueue gives lowest prio first 123Debug.Assert(phEdges[loser].Count(e => unionFind.FindSet(e.Key) == winner) == 1); 133bool removed = phEdges[edge.Key].Remove(loser); 137AddEdge(winner, edge.Key, edge.Value); 138AddEdge(edge.Key, winner, edge.Value); 140long weight = phEdges[winner][edge.Key]; 141queue.Enqueue((winner, edge.Key), -weight); // Priority queue gives lowest priority first 152Debug.Assert(unionFind.FindSet(i) == i && unionFind.FindSet(edge.Key) == edge.Key); 153Debug.Assert(phEdges[edge.Key][i] == phEdges[i][edge.Key]);
Compiler\ProfileData.cs (3)
84if (mergedCallWeights.TryGetValue(entry.Key, out var initialWeight)) 86mergedCallWeights[entry.Key] = initialWeight + entry.Value; 90mergedCallWeights[entry.Key] = entry.Value;
Compiler\ProfileDataManager.cs (2)
478_delegateTargets = delegateTargets.ToDictionary(kvp => kvp.Key, kvp => 485_implementers = implementers.ToDictionary(kvp => kvp.Key, kvp =>
Compiler\ReadyToRunExternalTypeMapNode.cs (1)
81yield return new DependencyListEntry(importProvider.GetImportToType(entry.Value.type, TriggeringModule), $"External type map entry target for key '{entry.Key}'");
Compiler\ReadyToRunProxyTypeMapNode.cs (2)
81yield return new DependencyListEntry(importProvider.GetImportToType(entry.Key, TriggeringModule), $"Key type of Proxy type map entry"); 82yield return new DependencyListEntry(importProvider.GetImportToType(entry.Value, TriggeringModule), $"Proxy type map entry target for key '{entry.Key}'");
Compiler\ReadyToRunTypeMapManager.cs (2)
42yield return new ReadyToRunExternalTypeMapNode(triggeringModule, map.Key, map.Value, _importReferenceProvider); 50yield return new ReadyToRunProxyTypeMapNode(triggeringModule, map.Key, map.Value, _importReferenceProvider);
Compiler\TypeMapAssemblyTargetsNode.cs (2)
50var groupType = map.Key; 81var groupType = map.Key;
IBC\IBCProfileData.cs (1)
35switch (kvPair.Key)
ObjectWriter\MapFileBuilder.cs (1)
177writer.WriteLine(relocTypeCount.Key.ToString());
ObjectWriter\ProfileFileBuilder.cs (5)
138_symbolMethodMap.Add(kvpSymbolMethod.Value.Method, kvpSymbolMethod.Key); 157if (_symbolMethodMap.TryGetValue(kvpCallerCalleeCount.Key, out ISymbolDefinitionNode callerSymbol) && 167if (_symbolMethodMap.TryGetValue(kvpCalleeCount.Key, out ISymbolDefinitionNode calleeSymbol) && 177caller: kvpCallerCalleeCount.Key, 180callee: kvpCalleeCount.Key,
src\runtime\src\coreclr\tools\aot\ILCompiler.Reflection.ReadyToRun\PEReaderExtensions.cs (1)
119Console.Error.WriteLine($" '{kvp.Key}': {kvp.Value}");
src\runtime\src\coreclr\tools\Common\Compiler\ObjectDataInterner.cs (1)
70if (!b.TryGetValue(kvp.Key, out ISymbolNode value) || value != kvp.Value)
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\OutputInfoBuilder.cs (1)
196OutputNode node = _nodeSymbolMap[symbolMethodPair.Key];
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\PEObjectWriter.cs (1)
688uint pageRva = kv.Key;
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\WebCilObjectWriter.cs (1)
315uint pageRva = kv.Key;
src\runtime\src\coreclr\tools\Common\Compiler\TypeMapMetadata.cs (2)
170AddAssociatedTypeMapEntry(kvp.Key, kvp.Value); 200AddExternalTypeMapEntry(kvp.Key, kvp.Value.type, kvp.Value.trimmingTarget);
src\runtime\src\coreclr\tools\Common\Compiler\Win32Resources\ResourceData.cs (12)
138return _resTypeHeadID.SelectMany(typeIdPair => SelectResType(typeIdPair.Key, typeIdPair.Value)) 139.Concat(_resTypeHeadName.SelectMany(typeNamePair => SelectResType(typeNamePair.Key, typeNamePair.Value))); 143return resType.NameHeadID.SelectMany(nameIdPair => SelectResName(type, nameIdPair.Key, nameIdPair.Value)) 145SelectResName(type, nameNamePair.Key, nameNamePair.Value))); 150return resType.Languages.Select((lang) => (name, type, lang.Key, lang.Value.DataEntry)); 206resTypes.Add(new Tuple<ResType, ObjectDataBuilder.Reservation>(res.Value, IMAGE_RESOURCE_DIRECTORY_ENTRY.Write(ref dataBuilder, res.Key, nameTable))); 210resTypes.Add(new Tuple<ResType, ObjectDataBuilder.Reservation>(res.Value, IMAGE_RESOURCE_DIRECTORY_ENTRY.Write(ref dataBuilder, res.Key))); 220resNames.Add(new Tuple<ResName, ObjectDataBuilder.Reservation>(res.Value, IMAGE_RESOURCE_DIRECTORY_ENTRY.Write(ref dataBuilder, res.Key, nameTable))); 224resNames.Add(new Tuple<ResName, ObjectDataBuilder.Reservation>(res.Value, IMAGE_RESOURCE_DIRECTORY_ENTRY.Write(ref dataBuilder, res.Key))); 234resLanguages.Add(new Tuple<ResLanguage, ObjectDataBuilder.Reservation>(res.Value, IMAGE_RESOURCE_DIRECTORY_ENTRY.Write(ref dataBuilder, res.Key))); 247dataBuilder.EmitUShort(checked((ushort)name.Key.Length)); 248foreach (char c in name.Key)
src\runtime\src\coreclr\tools\Common\JitInterface\JitConfigProvider.cs (1)
103_config[param.Key] = param.Value;
src\runtime\src\coreclr\tools\Common\TypeSystem\MetadataEmitter\TypeSystemMetadataEmitter.cs (3)
184yield return new KeyValuePair<TypeSystemEntity, EntityHandle>(item.Key, item.Value); 189yield return new KeyValuePair<TypeSystemEntity, EntityHandle>(item.Key, item.Value); 194yield return new KeyValuePair<TypeSystemEntity, EntityHandle>(item.Key, item.Value);
TypeSystem\Mutable\MutableModule.cs (2)
222Entities.Add(MetadataTokens.GetToken(item.Value), item.Key); 223ExistingEntities.Add(item.Key, MetadataTokens.GetToken(item.Value));
ILCompiler.RyuJit (21)
src\runtime\src\coreclr\tools\aot\ILCompiler.ReadyToRun\Compiler\PettisHansenSort\PettisHansen.cs (16)
46AddEdge(i, kvp.Key.Index, kvp.Value); 47AddEdge(kvp.Key.Index, i, kvp.Value); 55Debug.Assert(phEdges[kvp.Key][i] == phEdges[i][kvp.Key]); 64if (kvp.Key > i) 66queue.Enqueue((i, kvp.Key), -kvp.Value); // PriorityQueue gives lowest prio first 123Debug.Assert(phEdges[loser].Count(e => unionFind.FindSet(e.Key) == winner) == 1); 133bool removed = phEdges[edge.Key].Remove(loser); 137AddEdge(winner, edge.Key, edge.Value); 138AddEdge(edge.Key, winner, edge.Value); 140long weight = phEdges[winner][edge.Key]; 141queue.Enqueue((winner, edge.Key), -weight); // Priority queue gives lowest priority first 152Debug.Assert(unionFind.FindSet(i) == i && unionFind.FindSet(edge.Key) == edge.Key); 153Debug.Assert(phEdges[edge.Key][i] == phEdges[i][edge.Key]);
src\runtime\src\coreclr\tools\aot\ILCompiler.ReadyToRun\Compiler\ProfileData.cs (3)
84if (mergedCallWeights.TryGetValue(entry.Key, out var initialWeight)) 86mergedCallWeights[entry.Key] = initialWeight + entry.Value; 90mergedCallWeights[entry.Key] = entry.Value;
src\runtime\src\coreclr\tools\aot\ILCompiler.ReadyToRun\IBC\IBCProfileData.cs (1)
35switch (kvPair.Key)
src\runtime\src\coreclr\tools\Common\JitInterface\JitConfigProvider.cs (1)
103_config[param.Key] = param.Value;
illink (13)
ILLink.RoslynAnalyzer (11)
DataFlow\LocalDataFlowVisitor.cs (1)
1153new CapturedTargetKey(evaluatedTargetValue.Key),
DataFlow\LValueFlowCaptureProvider.cs (1)
84var captureId = kvp.Key;
ISymbolExtensions.cs (1)
234if (namedArgument.Key == "EntryPoint")
RequiresAnalyzerBase.cs (1)
318var url = requiresAttribute?.NamedArguments.FirstOrDefault(na => na.Key == "Url").Value.Value?.ToString();
RequiresISymbolExtensions.cs (1)
46if (namedArg.Key == "ExcludeStatics" && namedArg.Value.Value is bool b)
src\runtime\src\tools\illink\src\ILLink.Shared\DataFlow\DefaultValueDictionary.cs (3)
63if (!Get(kvp.Key).Equals(kvp.Value)) 88sb.AppendLine().Append('\t').Append(kvp.Key.ToString()).Append(" -> ").Append(kvp.Value.ToString()); 104var key = kvp.Key;
src\runtime\src\tools\illink\src\ILLink.Shared\DataFlow\DictionaryLattice.cs (1)
32TKey key = kvp.Key;
TrimAnalysis\ArrayValue.cs (2)
62if (!otherArr.IndexValues.TryGetValue(kvp.Key, out MultiValue value) || !kvp.Value.Equals(value)) 84newArray.IndexValues.Add(kvp.Key, kvp.Value.DeepCopy());
ILLink.Tasks (3)
CreateRuntimeRootDescriptorFile.cs (3)
351foreach ((var fs, var members) in featureSwitchMembers.Select(kv => (kv.Key, kv.Value))) 376AddXmlTypeNode(doc, featureAssemblyNode, type.Key, type.Value); 386AddXmlTypeNode(doc, assemblyNode, type.Key, type.Value);
Infrastructure.Tests (10)
Pipelines\NixCliPackageTests.cs (1)
36systems.Select(system => system.Key).Order(StringComparer.Ordinal));
Pipelines\NpmCliPackageTests.cs (2)
722property => property.Key, 723property => property.Value?.GetValue<string>() ?? throw new InvalidOperationException($"JSON property '{property.Key}' is not a string."),
PowerShellScripts\PowerShellCommand.cs (2)
235_testOutput.WriteLine($"{_msgPrefix}\t[{item.Key}] = {item.Value}"); 236psi.Environment[item.Key] = item.Value;
TestTriggerMap\TestTriggerMapTests.cs (2)
299var broken = expected.Where(kvp => referenced.Contains(kvp.Key) && !kvp.Value()) 300.Select(kvp => kvp.Key).Order(StringComparer.Ordinal).ToList();
tools\GenerateCITimeline\GitHubApi.cs (1)
121return $"\"{kv.Key}\":{val}";
tools\GenerateCITimeline\TimelineRenderer.cs (1)
295.Select(kv => $"<code>{E(kv.Key)}</code>: {kv.Value}")
WorkflowScripts\ExtensionChangelogFinalizedWorkflowTests.cs (1)
43Assert.Equal("contents", ((YamlScalarNode)entry.Key).Value);
installer.tasks (4)
GenerateFileVersionProps.cs (3)
107p.Key.EndsWith(".exe", StringComparison.OrdinalIgnoreCase) || 108p.Key.EndsWith(".dll", StringComparison.OrdinalIgnoreCase)) 140var name = fileData.Key;
GenerateTestSharedFrameworkDepsFile.cs (1)
118foreach (string rid in runtimeGraph.Runtimes.Select(p => p.Key))
Microsoft.Analyzers.Extra (3)
CallAnalyzer.Registrar.cs (3)
70var type = Compilation.GetTypeByMetadataName(pair.Key); 148var type = Compilation.GetTypeByMetadataName(pair.Key); 204var type = Compilation.GetTypeByMetadataName(pair.Key);
Microsoft.Analyzers.Local (4)
CallAnalyzer.Registrar.cs (3)
70var type = Compilation.GetTypeByMetadataName(pair.Key); 148var type = Compilation.GetTypeByMetadataName(pair.Key); 204var type = Compilation.GetTypeByMetadataName(pair.Key);
JsonObject.cs (1)
168keys[i] = new KeyValuePair(property.Key, property.Value);
Microsoft.Arcade.Common (1)
Helpers.cs (1)
81public static void Deconstruct<TKey, TValue>(this KeyValuePair<TKey, TValue> pair, out TKey key, out TValue value) { key = pair.Key; value = pair.Value; }
Microsoft.AspNetCore (1)
WebApplicationBuilder.cs (1)
552app.Properties[item.Key] = item.Value;
Microsoft.AspNetCore.Analyzers (1)
StartupAnalysisBuilder.cs (1)
36k => k.Key,
Microsoft.AspNetCore.App.Analyzers (5)
Mvc\DetectOverriddenAuthorizeAttribute.cs (1)
124if (arg.Key == nameof(AttributeUsageAttribute.Inherited))
RouteEmbeddedLanguage\Infrastructure\RoutePatternParametersDetector.cs (1)
53if (namedArgument.Key == "Name")
RouteHandlers\DetectAmbiguousRoutes.cs (2)
30.Select(kvp => new { MapOperation = kvp.Key, ResolvedOperation = ResolveOperation(kvp.Key.Operation, wellKnownTypes) })
src\aspnetcore\src\Shared\RoslynUtils\SymbolExtensions.cs (1)
285if (string.Equals(namedArgument.Key, argumentName, StringComparison.Ordinal))
Microsoft.AspNetCore.App.CodeFixes (5)
Dependencies\ExtensionMethodsCompletionProvider.cs (5)
77displayText: item.Key.ExtensionMethod, 78sortText: item.Key.ExtensionMethod, 79filterText: item.Key.ExtensionMethod 115return SymbolEqualityComparer.Default.Equals(pair.Key.ThisType, symbolType) && 116(!isIdentifierToken || pair.Key.ExtensionMethod.Contains(token.ValueText));
Microsoft.AspNetCore.Authentication (2)
PropertiesSerializer.cs (1)
55writer.Write(item.Key ?? string.Empty);
TicketSerializer.cs (1)
148writer.Write(property.Key ?? string.Empty);
Microsoft.AspNetCore.Authentication.Cookies (1)
CookieAuthenticationHandler.cs (1)
145newProperties.Items[item.Key] = item.Value;
Microsoft.AspNetCore.Authentication.OAuth (1)
OAuthHandler.cs (1)
333parameters.Add(additionalParameter.Key, additionalParameter.Value);
Microsoft.AspNetCore.Authentication.OpenIdConnect (6)
OpenIdConnectHandler.cs (6)
121message = new OpenIdConnectMessage(Request.Query.Select(pair => new KeyValuePair<string, string[]>(pair.Key, pair.Value.ToArray()))); 136message = new OpenIdConnectMessage(form.Select(pair => new KeyValuePair<string, string[]>(pair.Key, pair.Value.ToArray()))); 325var message = new OpenIdConnectMessage(Request.Query.Select(pair => new KeyValuePair<string, string[]>(pair.Key, pair.Value.ToArray()))); 464message.Parameters.Add(additionalParameter.Key, additionalParameter.Value); 648authorizationResponse = new OpenIdConnectMessage(Request.Query.Select(pair => new KeyValuePair<string, string[]>(pair.Key, pair.Value.ToArray()))); 675authorizationResponse = new OpenIdConnectMessage(form.Select(pair => new KeyValuePair<string, string[]>(pair.Key, pair.Value.ToArray())));
Microsoft.AspNetCore.Authentication.Twitter (5)
TwitterHandler.cs (5)
205signatureParts.Add(queryParameter.Key, queryParameter.Value); 212signatureParts.Add(formItem.Key, formItem.Value); 219stringBuilder.AppendFormat(CultureInfo.InvariantCulture, "{0}={1}&", Uri.EscapeDataString(signaturePart.Key), Uri.EscapeDataString(signaturePart.Value)); 241stringBuilder.AppendFormat(CultureInfo.InvariantCulture, "{0}={1}&", queryParam.Key, queryParam.Value); 251stringBuilder.AppendFormat(CultureInfo.InvariantCulture, "{0}=\"{1}\",", authorizationPart.Key, Uri.EscapeDataString(authorizationPart.Value));
Microsoft.AspNetCore.Authentication.WsFederation (2)
WsFederationHandler.cs (2)
164wsFederationMessage = new WsFederationMessage(form.Select(pair => new KeyValuePair<string, string[]>(pair.Key, pair.Value.ToArray()))); 474var message = new WsFederationMessage(Request.Query.Select(pair => new KeyValuePair<string, string[]>(pair.Key, pair.Value.ToArray())));
Microsoft.AspNetCore.Authorization (1)
src\aspnetcore\src\Shared\Debugger\DebuggerHelpers.cs (1)
62sb.Append(kvp.Key);
Microsoft.AspNetCore.Components (29)
DynamicComponent.cs (1)
101builder.AddComponentParameter(1, entry.Key, entry.Value);
ParameterView.cs (1)
308builder.Add(kvp.Key, kvp.Value);
Rendering\RenderTreeBuilder.cs (1)
456AddAttribute(sequence, attribute.Key, attribute.Value);
RouteView.cs (1)
92builder.AddComponentParameter(1, kvp.Key, kvp.Value);
Routing\RouteTable.cs (2)
49routeValueDictionary[kvp.Key] = value.Replace("%2F", "/", StringComparison.OrdinalIgnoreCase); 99routeValues[kvp.Key] = value.Replace("%2F", "/", StringComparison.OrdinalIgnoreCase);
src\aspnetcore\src\Http\Http.Abstractions\src\Routing\RouteValueDictionary.cs (8)
258Add(kvp.Key, kvp.Value); 328keys[i] = array[i].Key; 360Add(item.Key, item.Value); 411return TryGetValue(item.Key, out var value) && EqualityComparer<object>.Default.Equals(value, item.Value); 493var index = FindIndex(item.Key); 715if (string.Equals(array[i].Key, key, StringComparison.OrdinalIgnoreCase)) 735if (string.Equals(array[i].Key, key, StringComparison.OrdinalIgnoreCase)) 758if (string.Equals(array[i].Key, key, StringComparison.OrdinalIgnoreCase))
src\aspnetcore\src\Http\Routing\src\Patterns\RoutePatternFactory.cs (5)
465updatedDefaults.Add(kvp.Key, kvp.Value); 506if (string.Equals(kvp.Key, parameters[i].Name, StringComparison.OrdinalIgnoreCase)) 517updatedDefaults.TryGetValue(kvp.Key, out var defaultValue) && 527$"'{kvp.Key}={kvp.Value}'. A non-null required value must correspond to a route parameter or the " + 537? parameterPolicyReferences.ToDictionary(kvp => kvp.Key, kvp => (IReadOnlyList<RoutePatternParameterPolicyReference>)kvp.Value.ToArray())
src\aspnetcore\src\Http\Routing\src\Patterns\RoutePatternMatcher.cs (3)
192if (!values.ContainsKey(kvp.Key)) 194values.Add(kvp.Key, kvp.Value); 495values[item.Key] = item.Value;
src\aspnetcore\src\Http\Routing\src\RouteConstraintBuilder.cs (3)
67if (_optionalParameters.Contains(kvp.Key)) 70constraints.Add(kvp.Key, optionalConstraint); 74constraints.Add(kvp.Key, constraint);
src\aspnetcore\src\Http\Routing\src\RouteConstraintMatcher.cs (1)
67if (!constraint.Match(kvp.Key, routeValues))
src\aspnetcore\src\Shared\Components\ComponentsActivityLinkStore.cs (2)
48if (kvp.Key != exceptCategory) 58targetActivity.SetTag(tag.Value.Key, tag.Value.Value);
src\aspnetcore\src\Shared\Debugger\DictionaryItemDebugView.cs (1)
23Key = keyValue.Key;
Microsoft.AspNetCore.Components.AI.SourceGenerators (1)
ToolBlockParser.cs (1)
229if (namedArg.Key == "Name" && namedArg.Value.Value is string nameOverride && !string.IsNullOrEmpty(nameOverride))
Microsoft.AspNetCore.Components.Analyzers (2)
ComponentFacts.cs (1)
66if (string.Equals(kvp.Key, ComponentsApi.ParameterAttribute.CaptureUnmatchedValues, StringComparison.Ordinal))
StateHasChangedAnalyzer.cs (1)
152var method = methodAndLocations.Key;
Microsoft.AspNetCore.Components.Endpoints (28)
_generated\2\ImportMapSerializerContext.IReadOnlyDictionaryStringIReadOnlyDictionaryStringString.g.cs (1)
59writer.WritePropertyName(entry.Key);
_generated\25\BrowserOptionsJsonContext.IDictionaryStringJsonElement.g.cs (1)
59writer.WritePropertyName(entry.Key);
_generated\26\BrowserOptionsJsonContext.IDictionaryStringString.g.cs (1)
59writer.WriteString(entry.Key, entry.Value);
_generated\3\ImportMapSerializerContext.IReadOnlyDictionaryStringString.g.cs (1)
59writer.WriteString(entry.Key, entry.Value);
_generated\56\PrerenderComponentApplicationStoreSerializerContext.DictionaryStringByteArray.g.cs (1)
59writer.WritePropertyName(entry.Key);
Assets\ImportMapDefinition.cs (4)
40_imports = imports?.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); 41_integrity = integrity?.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); 43kvp => kvp.Key, 44kvp => kvp.Value.ToDictionary(scopeKvp => scopeKvp.Key, scopeKvp => scopeKvp.Value) as IReadOnlyDictionary<string, string>);
BrowserConfiguration\ConfigureBrowser.cs (2)
54target.InteractiveWebAssembly.EnvironmentVariables[kvp.Key] = kvp.Value; 63target.InteractiveServer.Extensions[kvp.Key] = kvp.Value;
CacheView\CacheViewKeyResolver.cs (1)
191names.Add(pair.Key);
FormMapping\FormDataReader.cs (1)
119var key = kvp.Key.Value;
Forms\DataAnnotationsClientValidationProvider.cs (1)
107writer.Param(kvp.Key, kvp.Value);
RazorComponentEndpointHost.cs (1)
59builder.AddComponentParameter(1, kvp.Key, kvp.Value);
Rendering\EndpointHtmlRenderer.PrerenderingState.cs (2)
87server.Saved.Add(kvp.Key, kvp.Value); 88webAssembly.Saved.Add(kvp.Key, kvp.Value);
src\aspnetcore\src\Shared\Components\ComponentsActivityLinkStore.cs (2)
48if (kvp.Key != exceptCategory) 58targetActivity.SetTag(tag.Value.Key, tag.Value.Value);
TempData\TempData.cs (9)
103_data[kvp.Key] = kvp.Value; 104_retainedKeys.Add(kvp.Key); 139((IDictionary<string, object?>)this).Add(item.Key, item.Value); 144return ContainsKey(item.Key) && Equals(Peek(item.Key), item.Value); 154if (ContainsKey(item.Key) && Equals(Peek(item.Key), item.Value)) 156return Remove(item.Key); 188_keysToRemove.Add(kvp.Key);
Microsoft.AspNetCore.Components.Media (2)
FileDownload.cs (2)
82if (kvp.Key == "href") 86copy.Add(kvp.Key, kvp.Value!);
Microsoft.AspNetCore.Components.SdkAnalyzers (1)
ComponentFacts.cs (1)
66if (string.Equals(kvp.Key, ComponentsApi.ParameterAttribute.CaptureUnmatchedValues, StringComparison.Ordinal))
Microsoft.AspNetCore.Components.Server (6)
_generated\42\PrerenderComponentApplicationStoreSerializerContext.DictionaryStringByteArray.g.cs (1)
59writer.WritePropertyName(entry.Key);
Circuits\CircuitPersistenceManager.cs (1)
170rootComponentDescriptors.Add(marker.Key, descriptor);
src\aspnetcore\src\Components\Shared\src\RootComponentOperation.cs (1)
38var parameters = string.Join(", ", Parameters.Parameters.ToDictionary().Select(p => $"{p.Key}: {p.Value}"));
src\aspnetcore\src\Shared\Components\ComponentsActivityLinkStore.cs (2)
48if (kvp.Key != exceptCategory) 58targetActivity.SetTag(tag.Value.Key, tag.Value.Value);
src\aspnetcore\src\SignalR\common\Protocols.MessagePack\src\Protocol\MessagePackHubProtocolWorker.cs (1)
601writer.Write(header.Key);
Microsoft.AspNetCore.Components.Testing (6)
_generated\5\E2EManifestJsonContext.DictionaryStringE2EAppEntry.g.cs (1)
59writer.WritePropertyName(entry.Key);
_generated\6\E2EManifestJsonContext.DictionaryStringString.g.cs (1)
59writer.WriteString(entry.Key, entry.Value);
Infrastructure\PlaywrightExtensions.cs (1)
38var headers = options.ExtraHTTPHeaders?.ToDictionary(h => h.Key, h => h.Value)
Infrastructure\ServerInstance.cs (2)
185foreach (var kvp in options.EnvironmentVariables.OrderBy(x => x.Key)) 187sb.Append('|').Append(kvp.Key).Append('=').Append(kvp.Value);
Infrastructure\TestServiceOverrideObserver.cs (1)
47if (value.Key == "HostBuilding" &&
Microsoft.AspNetCore.Components.Web (3)
_generated\6\WebRendererSerializerContext.DictionaryStringJSComponentParameterArray.g.cs (1)
59writer.WritePropertyName(entry.Key);
_generated\7\WebRendererSerializerContext.DictionaryStringListString.g.cs (1)
59writer.WritePropertyName(entry.Key);
Forms\InputBase.cs (1)
399result.Add(item.Key, item.Value);
Microsoft.AspNetCore.Components.WebAssembly (2)
_generated\24\PrerenderComponentApplicationStoreSerializerContext.DictionaryStringByteArray.g.cs (1)
59writer.WritePropertyName(entry.Key);
src\aspnetcore\src\Components\Shared\src\RootComponentOperation.cs (1)
38var parameters = string.Join(", ", Parameters.Parameters.ToDictionary().Select(p => $"{p.Key}: {p.Value}"));
Microsoft.AspNetCore.Components.WebAssembly.Authentication (1)
Services\AccountClaimsPrincipalFactory.cs (1)
48var name = kvp.Key;
Microsoft.AspNetCore.Components.WebView (5)
_generated\6\SourceGenerationContext.DictionaryStringStaticWebAssetNode.g.cs (1)
61writer.WritePropertyName(entry.Key);
_generated\7\SourceGenerationContext.IDictionaryStringStaticWebAssetNode.g.cs (1)
61writer.WritePropertyName(entry.Key);
src\aspnetcore\src\Shared\StaticWebAssets\ManifestStaticWebAssetFileProvider.cs (3)
127var file = new StaticWebAssetsDirectoryInfo(child.Key); 140files.Add(string.Equals(child.Key, match.Path, _fsComparison) ? file : 143new StaticWebAssetsFileInfo(child.Key, file));
Microsoft.AspNetCore.Components.WebView.WindowsForms (1)
src\BlazorWebView\src\SharedSource\WebView2WebViewManager.cs (1)
393 string.Join(Environment.NewLine, headers.Select(kvp => $"{kvp.Key}: {kvp.Value}"));
Microsoft.AspNetCore.Components.WebView.Wpf (1)
src\BlazorWebView\src\SharedSource\WebView2WebViewManager.cs (1)
393 string.Join(Environment.NewLine, headers.Select(kvp => $"{kvp.Key}: {kvp.Value}"));
Microsoft.AspNetCore.Connections.Abstractions (3)
ConnectionItems.cs (2)
116if (Items.TryGetValue(item.Key, out var value) && Equals(item.Value, value)) 118return Items.Remove(item.Key);
src\aspnetcore\src\Shared\Debugger\DictionaryItemDebugView.cs (1)
23Key = keyValue.Key;
Microsoft.AspNetCore.CookiePolicy (2)
ResponseCookiesWrapper.cs (2)
146var key = keyValuePair.Key; 155_logger.CookieSuppressed(keyValuePair.Key);
Microsoft.AspNetCore.Cors (1)
src\aspnetcore\src\Shared\Debugger\DebuggerHelpers.cs (1)
62sb.Append(kvp.Key);
Microsoft.AspNetCore.DataProtection (3)
KeyManagement\XmlKeyManager.cs (1)
103keyRepository = keyRepositoryEncryptorPair.Key;
XmlEncryption\XmlEncryptionExtensions.cs (2)
65entry.Key.ReplaceWith(entry.Value); 149entry.Key.ReplaceWith(
Microsoft.AspNetCore.Diagnostics (17)
_generated\2\ExtensionsExceptionJsonContext.IHeaderDictionary.g.cs (1)
59writer.WritePropertyName(entry.Key);
DeveloperExceptionPage\DeveloperExceptionPageMiddlewareImpl.cs (1)
242sb.AppendLine(FormattableString.Invariant($"{pair.Key}: {pair.Value}"));
DeveloperExceptionPage\Views\ErrorPage.Designer.cs (8)
897foreach (var kv in Model.Query.OrderBy(kv => kv.Key)) 908Write(kv.Key); 984foreach (var kv in Model.Cookies.OrderBy(kv => kv.Key)) 993Write(kv.Key); 1068foreach (var kv in Model.Headers.OrderBy(kv => kv.Key)) 1079Write(kv.Key); 1421foreach (var kv in Model.RouteValues.OrderBy(kv => kv.Key)) 1430Write(kv.Key);
src\aspnetcore\src\Shared\Diagnostics\ActivityCreator.cs (2)
84activity.AddTag(tag.Key, tag.Value); 122activity.AddBaggage(baggageItem.Key, baggageItem.Value);
src\aspnetcore\src\Shared\Metrics\MetricsExtensions.cs (5)
41if (list[i].Key == name) 52if (tag.Key == name) 70if (tag.Key == name) 80if (tag.Key == name) 95if (tags[i].Key == name)
Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore (2)
src\aspnetcore\src\Shared\Diagnostics\ActivityCreator.cs (2)
84activity.AddTag(tag.Key, tag.Value); 122activity.AddBaggage(baggageItem.Key, baggageItem.Value);
Microsoft.AspNetCore.Diagnostics.Middleware (4)
Logging\HeaderNormalizer.cs (1)
16normalizedHeaders[i] = prefix + Normalize(headers[i].Key);
Logging\HeaderReader.cs (1)
40if (headers.TryGetValue(header.Key, out var headerValue))
Logging\IncomingHttpRouteUtility.cs (1)
39parametersToRedact.Add(defaultParameter.Key, defaultParameter.Value);
Logging\RequestHeadersLogEnricher.cs (1)
69if (request.Headers.TryGetValue(header.Key, out var headerValue) && !string.IsNullOrEmpty(headerValue))
Microsoft.AspNetCore.Diagnostics.Middleware.PerformanceTests (4)
RedactionBenchmark.cs (4)
89if (_routeParameterDataClasses.TryGetValue(item.Key, out DataClassification classification)) 136newDict.Add((string)item.Value, item.Key); 204if (_routeParameterDataClasses.TryGetValue(item.Key, out DataClassification classification)) 282if (_routeParameterDataClasses.TryGetValue(item.Key, out DataClassification classification))
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (127)
Latency\Internal\HttpLatencyLogEnricherTests.cs (1)
87httpContextMock.Request.Headers[header.Key] = header.Value;
Logging\AcceptanceTests.cs (91)
230Assert.DoesNotContain(state, x => x.Key == HttpLoggingTagNames.RequestBody); 231Assert.DoesNotContain(state, x => x.Key.StartsWith(HttpLoggingTagNames.RequestHeaderPrefix)); 232Assert.DoesNotContain(state, x => x.Key.StartsWith(HttpLoggingTagNames.ResponseHeaderPrefix)); 233Assert.Single(state, x => x.Key == HttpLoggingTagNames.Host && !string.IsNullOrEmpty(x.Value)); 234Assert.Single(state, x => x.Key == HttpLoggingTagNames.Path && x.Value == TelemetryConstants.Unknown); 235Assert.Single(state, x => x.Key == HttpLoggingTagNames.StatusCode && x.Value == responseStatus); 236Assert.Single(state, x => x.Key == HttpLoggingTagNames.Method && x.Value == HttpMethod.Post.ToString()); 237Assert.Single(state, x => x.Key == HttpLoggingTagNames.Duration && 243Assert.Single(state, x => x.Key == HttpLoggingTagNames.ResponseBody && x.Value == "Server: hello!Server: world!"); 248Assert.DoesNotContain(state, x => x.Key == HttpLoggingTagNames.ResponseBody); 290Assert.DoesNotContain(state, x => x.Key == HttpLoggingTagNames.ResponseBody); 291Assert.DoesNotContain(state, x => x.Key.StartsWith(HttpLoggingTagNames.RequestHeaderPrefix)); 292Assert.DoesNotContain(state, x => x.Key.StartsWith(HttpLoggingTagNames.ResponseHeaderPrefix)); 293Assert.Single(state, x => x.Key == HttpLoggingTagNames.Host && !string.IsNullOrEmpty(x.Value)); 294Assert.Single(state, x => x.Key == HttpLoggingTagNames.Path && x.Value == TelemetryConstants.Unknown); 295Assert.Single(state, x => x.Key == HttpLoggingTagNames.StatusCode && x.Value == responseStatus); 296Assert.Single(state, x => x.Key == HttpLoggingTagNames.Method && x.Value == HttpMethod.Post.ToString()); 297Assert.Single(state, x => x.Key == HttpLoggingTagNames.Duration && 303Assert.Single(state, x => x.Key == HttpLoggingTagNames.RequestBody && x.Value == Content); 308Assert.DoesNotContain(state, x => x.Key == HttpLoggingTagNames.RequestBody); 343Assert.DoesNotContain(state, x => x.Key == HttpLoggingTagNames.ResponseBody); 344Assert.DoesNotContain(state, x => x.Key.StartsWith(HttpLoggingTagNames.RequestHeaderPrefix)); 345Assert.DoesNotContain(state, x => x.Key.StartsWith(HttpLoggingTagNames.ResponseHeaderPrefix)); 346Assert.Single(state, x => x.Key == HttpLoggingTagNames.Host && !string.IsNullOrEmpty(x.Value)); 347Assert.Single(state, x => x.Key == HttpLoggingTagNames.Path && x.Value == "/myroute/123"); 348Assert.Single(state, x => x.Key == HttpLoggingTagNames.StatusCode && x.Value == responseStatus); 349Assert.Single(state, x => x.Key == HttpLoggingTagNames.Method && x.Value == HttpMethod.Post.ToString()); 350Assert.Single(state, x => x.Key == HttpLoggingTagNames.Duration && 403Assert.DoesNotContain(requestState, x => x.Key.StartsWith(HttpLoggingTagNames.ResponseHeaderPrefix)); 404Assert.DoesNotContain(requestState, x => x.Key == HttpLoggingTagNames.StatusCode); 405Assert.DoesNotContain(requestState, x => x.Key == HttpLoggingTagNames.Duration); 406Assert.Single(requestState, x => x.Key == HttpLoggingTagNames.RequestHeaderPrefix + NormalizedRequestHeader); 407Assert.Single(requestState, x => x.Key == HttpLoggingTagNames.Host && !string.IsNullOrEmpty(x.Value)); 408Assert.Single(requestState, x => x.Key == HttpLoggingTagNames.Path && x.Value == TelemetryConstants.Unknown); 409Assert.Single(requestState, x => x.Key == HttpLoggingTagNames.Method && x.Value == HttpMethod.Post.ToString()); 410Assert.Single(requestState, x => x.Key == "Protocol" && x.Value == "HTTP/1.1"); 413Assert.Single(requestBodyState, x => x.Key == "Body" && x.Value == Content); 416Assert.Single(responseState, x => x.Key == HttpLoggingTagNames.ResponseHeaderPrefix + NormalizedResponseHeader); 417Assert.Single(responseState, x => x.Key == HttpLoggingTagNames.StatusCode && x.Value == responseStatus); 420Assert.Single(responseBodyState, x => x.Key == "Body" && x.Value == "Server: hello!Server: world!"); 423Assert.Single(durationState, x => x.Key == HttpLoggingTagNames.Duration && x.Value != null); 461Assert.Single(state, x => x.Key == HttpLoggingTagNames.RequestHeaderPrefix + NormalizedRequestHeader); 462Assert.Single(state, x => x.Key == HttpLoggingTagNames.ResponseHeaderPrefix + NormalizedResponseHeader); 463Assert.Single(state, x => x.Key == HttpLoggingTagNames.Host && !string.IsNullOrEmpty(x.Value)); 464Assert.Single(state, x => x.Key == HttpLoggingTagNames.Path && x.Value == TelemetryConstants.Unknown); 465Assert.Single(state, x => x.Key == HttpLoggingTagNames.StatusCode && x.Value == responseStatus); 466Assert.Single(state, x => x.Key == HttpLoggingTagNames.Duration && 470Assert.Single(state, x => x.Key == HttpLoggingTagNames.Method && x.Value == HttpMethod.Get.ToString()); 471Assert.DoesNotContain(state, x => x.Key == HttpLoggingTagNames.RequestBody); 472Assert.DoesNotContain(state, x => x.Key == HttpLoggingTagNames.ResponseBody); 474x.Key.StartsWith(HttpLoggingTagNames.RequestHeaderPrefix) && !x.Key.EndsWith(NormalizedRequestHeader)); 477x.Key.StartsWith(HttpLoggingTagNames.ResponseHeaderPrefix) && !x.Key.EndsWith(NormalizedResponseHeader)); 507Assert.Single(state, x => x.Key == TestHttpLogEnricher.Key1 && x.Value == TestHttpLogEnricher.Value1); 508Assert.Single(state, x => x.Key == TestHttpLogEnricher.Key2 && x.Value == TestHttpLogEnricher.Value2.ToString(CultureInfo.InvariantCulture)); 509Assert.Single(state, x => x.Key == HttpLoggingTagNames.Method && x.Value == HttpMethod.Delete.ToString()); 510Assert.DoesNotContain(state, x => x.Key == HttpLoggingTagNames.RequestBody); 511Assert.DoesNotContain(state, x => x.Key == HttpLoggingTagNames.ResponseBody); 512Assert.DoesNotContain(state, x => x.Key.StartsWith(HttpLoggingTagNames.RequestHeaderPrefix)); 513Assert.DoesNotContain(state, x => x.Key.StartsWith(HttpLoggingTagNames.ResponseHeaderPrefix)); 549Assert.Single(state, x => x.Key == HttpLoggingTagNames.Path && x.Value == RequestPath); 581Assert.DoesNotContain(firstState, x => x.Key == TestHttpLogEnricher.Key1 && x.Value == TestHttpLogEnricher.Value1); 582Assert.DoesNotContain(firstState, x => x.Key == TestHttpLogEnricher.Key2 && x.Value == TestHttpLogEnricher.Value2.ToString(CultureInfo.InvariantCulture)); 585Assert.Single(secondState, x => x.Key == TestHttpLogEnricher.Key1 && x.Value == TestHttpLogEnricher.Value1); 586Assert.Single(secondState, x => x.Key == TestHttpLogEnricher.Key2 && x.Value == TestHttpLogEnricher.Value2.ToString(CultureInfo.InvariantCulture)); 626Assert.DoesNotContain(firstRecord, x => x.Key == HttpLoggingTagNames.StatusCode); 627Assert.DoesNotContain(firstRecord, x => x.Key == HttpLoggingTagNames.Duration); 628Assert.DoesNotContain(secondRecord!, x => x.Key == HttpLoggingTagNames.Duration); 629Assert.DoesNotContain(fourthRecord, x => x.Key == HttpLoggingTagNames.StatusCode); 630Assert.DoesNotContain(fourthRecord, x => x.Key == HttpLoggingTagNames.Duration); 631Assert.DoesNotContain(fithRecord!, x => x.Key == HttpLoggingTagNames.Duration); 635Assert.Single(secondRecord!, x => x.Key == HttpLoggingTagNames.StatusCode && x.Value == responseStatus); 636Assert.Single(fithRecord!, x => x.Key == HttpLoggingTagNames.StatusCode && x.Value == responseStatus); 640Assert.Single(thirdRecord, x => x.Key == HttpLoggingTagNames.Duration && x.Value != null); 641Assert.Single(sixthRecord, x => x.Key == HttpLoggingTagNames.Duration && x.Value != null); 666Assert.DoesNotContain(state, x => x.Key.StartsWith(HttpLoggingTagNames.RequestHeaderPrefix)); 667Assert.DoesNotContain(state, x => x.Key.StartsWith(HttpLoggingTagNames.ResponseHeaderPrefix)); 668Assert.Single(state, x => x.Key == HttpLoggingTagNames.Method && x.Value == HttpMethod.Get.ToString()); 669Assert.Single(state, x => x.Key == HttpLoggingTagNames.Host && !string.IsNullOrEmpty(x.Value)); 670Assert.Single(state, x => x.Key == HttpLoggingTagNames.Path && x.Value == TelemetryConstants.Unknown); 671Assert.Single(state, x => x.Key == HttpLoggingTagNames.StatusCode && x.Value == expectedStatus); 672Assert.Single(state, x => x.Key == HttpLoggingTagNames.Duration && 707Assert.DoesNotContain(state, x => x.Key.StartsWith(HttpLoggingTagNames.RequestHeaderPrefix)); 708Assert.DoesNotContain(state, x => x.Key.StartsWith(HttpLoggingTagNames.ResponseHeaderPrefix)); 709Assert.Single(state, x => x.Key == HttpLoggingTagNames.Method && x.Value == HttpMethod.Put.ToString()); 710Assert.Single(state, x => x.Key == HttpLoggingTagNames.RequestBody && x.Value == Content); 711Assert.Single(state, x => x.Key == HttpLoggingTagNames.ResponseBody && x.Value == "test body"); 741Assert.DoesNotContain(state, x => x.Key.StartsWith(HttpLoggingTagNames.RequestHeaderPrefix)); 742Assert.DoesNotContain(state, x => x.Key.StartsWith(HttpLoggingTagNames.ResponseHeaderPrefix)); 743Assert.Single(state, x => x.Key == HttpLoggingTagNames.Method && x.Value == HttpMethod.Put.ToString());
Logging\AcceptanceTests.Mvc.cs (33)
80Assert.DoesNotContain(state, x => x.Key == QueryParamName); 81Assert.Single(state, x => x.Key == HttpLoggingTagNames.Host && !string.IsNullOrEmpty(x.Value)); 82Assert.Single(state, x => x.Key == HttpLoggingTagNames.Path && x.Value == redactedPath); 83Assert.Single(state, x => x.Key == HttpLoggingTagNames.StatusCode && x.Value == responseStatus); 84Assert.Single(state, x => x.Key == HttpLoggingTagNames.Method && x.Value == HttpMethod.Get.ToString()); 85Assert.Single(state, x => x.Key == HttpLoggingTagNames.Duration && 116Assert.Single(state, x => x.Key == UserIdParamName && x.Value == redactedUserId); 117Assert.Single(state, x => x.Key == NoDataClassParamName && x.Value == TelemetryConstants.Redacted); 118Assert.DoesNotContain(state, x => x.Key == QueryParamName); 119Assert.Single(state, x => x.Key == HttpLoggingTagNames.Host && !string.IsNullOrEmpty(x.Value)); 120Assert.Single(state, x => x.Key == HttpLoggingTagNames.Path && x.Value == ActionRouteTemplate); 121Assert.Single(state, x => x.Key == HttpLoggingTagNames.StatusCode && x.Value == responseStatus); 122Assert.Single(state, x => x.Key == HttpLoggingTagNames.Method && x.Value == HttpMethod.Get.ToString()); 123Assert.Single(state, x => x.Key == HttpLoggingTagNames.Duration && 165Assert.Single(state, x => x.Key == UserIdParamName && x.Value == redactedUserId); 166Assert.Single(state, x => x.Key == NoDataClassParamName && x.Value == NoDataClassParamValue); 169Assert.DoesNotContain(state, x => x.Key == QueryParamName); 170Assert.Single(state, x => x.Key == HttpLoggingTagNames.Host && !string.IsNullOrEmpty(x.Value)); 172Assert.Single(state, x => x.Key == HttpLoggingTagNames.Path && x.Value == expectedPath); 173Assert.Single(state, x => x.Key == HttpLoggingTagNames.StatusCode && x.Value == responseStatus); 174Assert.Single(state, x => x.Key == HttpLoggingTagNames.Method && x.Value == HttpMethod.Get.ToString()); 175Assert.Single(state, x => x.Key == HttpLoggingTagNames.Duration && 205Assert.DoesNotContain(state, x => x.Key == QueryParamName); 206Assert.Single(state, x => x.Key == HttpLoggingTagNames.Host && !string.IsNullOrEmpty(x.Value)); 207Assert.Single(state, x => x.Key == HttpLoggingTagNames.Path && x.Value == $"/api/users/testUserId/someTestData"); 208Assert.Single(state, x => x.Key == HttpLoggingTagNames.StatusCode && x.Value == responseStatus); 209Assert.Single(state, x => x.Key == HttpLoggingTagNames.Method && x.Value == HttpMethod.Get.ToString()); 210Assert.Single(state, x => x.Key == HttpLoggingTagNames.Duration && 248Assert.DoesNotContain(state, x => x.Key == QueryParamName); 249Assert.Single(state, x => x.Key == HttpLoggingTagNames.Host && !string.IsNullOrEmpty(x.Value)); 250Assert.Single(state, x => x.Key == HttpLoggingTagNames.Path && x.Value == expectedPath); 251Assert.Single(state, x => x.Key == HttpLoggingTagNames.StatusCode && x.Value == responseStatus); 252Assert.Single(state, x => x.Key == HttpLoggingTagNames.Method && x.Value == HttpMethod.Get.ToString());
Logging\HeaderReaderTests.cs (1)
62Assert.Equal(NormalizedHeader, redacted.Key);
Logging\TestLogEnrichmentTagCollector.cs (1)
19_tags.Add(kvp.Key, kvp.Value);
Microsoft.AspNetCore.Grpc.JsonTranscoding (10)
Internal\Json\EnumNameHelpers.cs (1)
98removeEnumPrefixMapping[item.Key] = item.Value;
Internal\Json\MessageTypeInfoResolver.cs (1)
56var propertyInfo = CreatePropertyInfo(typeInfo, mapping.Key, mapping.Value, isSerializable: false);
Internal\JsonRequestHelpers.cs (3)
282var routeValue = serverCallContext.HttpContext.Request.RouteValues[parameterDescriptor.Key]; 291if (CanBindQueryStringVariable(serverCallContext, item.Key)) 293var pathDescriptors = GetPathDescriptors(serverCallContext, requestMessage, item.Key);
Internal\JsonTranscodingServerCallContext.cs (5)
151if (header.Key.StartsWith(':') || GrpcProtocolConstants.FilteredHeaders.Contains(header.Key)) 155else if (header.Key.EndsWith(Metadata.BinaryHeaderSuffix, StringComparison.OrdinalIgnoreCase)) 157_requestHeaders.Add(header.Key, GrpcProtocolHelpers.ParseBinaryHeader(header.Value!)); 161_requestHeaders.Add(header.Key, header.Value!);
Microsoft.AspNetCore.HeaderParsing (1)
HeaderParsingOptionsManualValidator.cs (1)
19$"Negative cached value count of {item.Value} specified for the {item.Key} header",
Microsoft.AspNetCore.Hosting (12)
_generated\6\SourceGenerationContext.DictionaryStringStaticWebAssetNode.g.cs (1)
61writer.WritePropertyName(entry.Key);
_generated\7\SourceGenerationContext.IDictionaryStringStaticWebAssetNode.g.cs (1)
61writer.WritePropertyName(entry.Key);
src\aspnetcore\src\Shared\Diagnostics\ActivityCreator.cs (2)
84activity.AddTag(tag.Key, tag.Value); 122activity.AddBaggage(baggageItem.Key, baggageItem.Value);
src\aspnetcore\src\Shared\Metrics\MetricsExtensions.cs (5)
41if (list[i].Key == name) 52if (tag.Key == name) 70if (tag.Key == name) 80if (tag.Key == name) 95if (tags[i].Key == name)
src\aspnetcore\src\Shared\StaticWebAssets\ManifestStaticWebAssetFileProvider.cs (3)
127var file = new StaticWebAssetsDirectoryInfo(child.Key); 140files.Add(string.Equals(child.Key, match.Path, _fsComparison) ? file : 143new StaticWebAssetsFileInfo(child.Key, file));
Microsoft.AspNetCore.Hosting.Abstractions (1)
HostingAbstractionsWebHostBuilderExtensions.cs (1)
28hostBuilder.UseSetting(setting.Key, setting.Value);
Microsoft.AspNetCore.Http (21)
Features\QueryFeature.cs (1)
210_accumulator[entry.Key] = new StringValues(entry.Value.ToArray());
Features\RequestCookiesFeature.cs (1)
86headers.Add(new CookieHeaderValue(pair.Key, pair.Value).ToString());
HeaderDictionary.cs (5)
196if (item.Key == null) 202Store.Add(item.Key, item.Value); 235!Store.TryGetValue(item.Key, out var value) || 289if (Store.TryGetValue(item.Key, out var value) && StringValues.Equals(item.Value, value)) 291return Store.Remove(item.Key);
Internal\ItemsDictionary.cs (2)
122if (_items.TryGetValue(item.Key, out var value) && Equals(item.Value, value)) 124return _items.Remove(item.Key);
Internal\RequestCookieCollection.cs (1)
203return new KeyValuePair<string, string>(current.Key, (string)current.Value!);
Internal\ResponseCookies.cs (2)
85Log.SameSiteCookieNotSecure(_logger, keyValuePair.Key); 96cookies[position] = string.Concat(keyValuePair.Key, "=", Uri.EscapeDataString(keyValuePair.Value), cookieSuffix);
src\aspnetcore\src\Shared\Debugger\DictionaryItemDebugView.cs (1)
23Key = keyValue.Key;
src\aspnetcore\src\Shared\Debugger\StringValuesDictionaryDebugView.cs (1)
28keyValuePairs.Add(new DictionaryItemDebugView<string, string>(kvp.Key, kvp.Value.ToString()));
src\aspnetcore\src\Shared\Dictionary\AdaptiveCapacityDictionary.cs (7)
164keys[i] = array[i].Key; 206Add(item.Key, item.Value); 270return TryGetValue(item.Key, out var value) && EqualityComparer<object>.Default.Equals(value, item.Value); 354var index = FindIndex(item.Key); 521_dictionaryStorage[item.Key] = item.Value; 562if (_comparer.Equals(localSpan[i].Key, key)) 582if (_comparer.Equals(item.Key, key))
Microsoft.AspNetCore.Http.Abstractions (16)
QueryString.cs (3)
131AppendKeyValuePair(builder, pair.Key, pair.Value, first); 153AppendKeyValuePair(builder, pair.Key, null, first); 160AppendKeyValuePair(builder, pair.Key, value, first);
Routing\RouteValueDictionary.cs (11)
75if (items[start].Key != null) 79else if (items[end].Key != null) 219Add(kvp.Key, kvp.Value); 258Add(kvp.Key, kvp.Value); 328keys[i] = array[i].Key; 360Add(item.Key, item.Value); 411return TryGetValue(item.Key, out var value) && EqualityComparer<object>.Default.Equals(value, item.Value); 493var index = FindIndex(item.Key); 715if (string.Equals(array[i].Key, key, StringComparison.OrdinalIgnoreCase)) 735if (string.Equals(array[i].Key, key, StringComparison.OrdinalIgnoreCase)) 758if (string.Equals(array[i].Key, key, StringComparison.OrdinalIgnoreCase))
src\aspnetcore\src\Shared\Debugger\DebuggerHelpers.cs (1)
62sb.Append(kvp.Key);
src\aspnetcore\src\Shared\Debugger\DictionaryItemDebugView.cs (1)
23Key = keyValue.Key;
Microsoft.AspNetCore.Http.Connections (1)
Internal\HttpConnectionDispatcher.cs (1)
1023requestHeaders[header.Key] = header.Value;
Microsoft.AspNetCore.Http.Connections.Client (8)
HttpConnection.cs (7)
665if (string.Equals(header.Key, Constants.UserAgent, StringComparison.OrdinalIgnoreCase)) 670httpClient.DefaultRequestHeaders.Remove(header.Key); 672else if (httpClient.DefaultRequestHeaders.Contains(header.Key)) 674httpClient.DefaultRequestHeaders.Remove(header.Key); 675httpClient.DefaultRequestHeaders.Add(header.Key, header.Value); 679httpClient.DefaultRequestHeaders.Add(header.Key, header.Value); 684httpClient.DefaultRequestHeaders.Add(header.Key, header.Value);
Internal\WebSocketsTransport.cs (1)
124webSocket.Options.SetRequestHeader(header.Key, header.Value);
Microsoft.AspNetCore.Http.Extensions (5)
_generated\4\ProblemDetailsJsonContext.IDictionaryStringStringArray.g.cs (1)
59writer.WritePropertyName(entry.Key);
QueryBuilder.cs (2)
42: this(parameters.SelectMany(kvp => kvp.Value, (kvp, v) => KeyValuePair.Create(kvp.Key, v ?? string.Empty))) 79builder.Append(UrlEncoder.Default.Encode(pair.Key));
RequestDelegateFactory.cs (1)
2958errorMessage.AppendLine(FormattableString.Invariant($"{kv.Key,-19} | {kv.Value,-15}"));
src\aspnetcore\src\Components\Endpoints\src\FormMapping\FormDataReader.cs (1)
119var key = kvp.Key.Value;
Microsoft.AspNetCore.Http.Features (1)
IResponseCookies.cs (1)
36Append(keyValuePair.Key, keyValuePair.Value, options);
Microsoft.AspNetCore.Http.RequestDelegateGenerator (2)
src\aspnetcore\src\Shared\RoslynUtils\IncrementalValuesProviderExtensions.cs (1)
33result.Add((entry.Key, index, entry.Value.ToImmutable()));
src\aspnetcore\src\Shared\RoslynUtils\SymbolExtensions.cs (1)
285if (string.Equals(namedArgument.Key, argumentName, StringComparison.Ordinal))
Microsoft.AspNetCore.Http.Results (2)
Results.cs (1)
826problemDetails.Extensions[extension.Key] = extension.Value;
TypedResults.cs (1)
880problemDetails.Extensions[extension.Key] = extension.Value;
Microsoft.AspNetCore.HttpLogging (2)
HttpLog.cs (2)
50builder.Append(kvp.Key); 59builder.Append(kvp.Key);
Microsoft.AspNetCore.InternalTesting (5)
Logging\LogValuesAssert.cs (3)
56return string.Join(",", logValues.Select(kvp => $"[{kvp.Key} {kvp.Value}]")); 63return string.Equals(x.Key, y.Key) && object.Equals(x.Value, y.Value);
xunit\AspNetTestCollectionRunner.cs (2)
44CollectionFixtureMappings.Add(mapping.Key, mapping.Value); 53CollectionFixtureMappings.Remove(mapping.Key);
Microsoft.AspNetCore.Mvc.Abstractions (3)
ModelBinding\ModelStateDictionary.cs (2)
454var target = GetOrAddNode(source.Key); 1166Current = current.Key;
src\aspnetcore\src\Shared\Debugger\DictionaryItemDebugView.cs (1)
23Key = keyValue.Key;
Microsoft.AspNetCore.Mvc.Analyzers (2)
TopLevelParameterNameAnalyzer.cs (2)
163if (string.Equals(namedArgument.Key, nameProperty, StringComparison.Ordinal) && 186if (string.Equals(namedArgument.Key, "BinderType", StringComparison.Ordinal) &&
Microsoft.AspNetCore.Mvc.ApiExplorer (3)
ApiResponseTypeProvider.cs (2)
121.Where(kvp => !attributeStatusCodes.Contains(kvp.Key.StatusCode)) 123.ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
DefaultApiDescriptionProvider.cs (1)
295Name = routeParameter.Key,
Microsoft.AspNetCore.Mvc.Core (33)
ApplicationModels\ApplicationModelFactory.cs (2)
139routeValues.TryAdd(kvp.Key, kvp.Value); 144routeValues.TryAdd(kvp.Key, kvp.Value);
ApplicationModels\ControllerActionDescriptorBuilder.cs (7)
153actionDescriptor.Properties[item.Key] = item.Value; 158actionDescriptor.Properties[item.Key] = item.Value; 163actionDescriptor.Properties[item.Key] = item.Value; 225if (!actionDescriptor.RouteValues.ContainsKey(kvp.Key)) 227actionDescriptor.RouteValues.Add(kvp.Key, kvp.Value); 234if (!actionDescriptor.RouteValues.ContainsKey(kvp.Key)) 236actionDescriptor.RouteValues.Add(kvp.Key, kvp.Value);
ControllerBase.cs (2)
1896problemDetails.Extensions[extension.Key] = extension.Value; 2021validationProblem.Extensions[extension.Key] = extension.Value;
Infrastructure\DefaultApiProblemDetailsWriter.cs (1)
68problemDetails.Extensions[extension.Key] = extension.Value;
ModelBinding\Binders\DictionaryModelBinder.cs (3)
169convertedKey = ModelBindingHelper.ConvertTo<TKey>(kvp.Key, culture: null); 196bindingContext.ModelName = ModelNames.CreatePropertyModelName(prefix, kvp.Key); 200bindingContext.ModelName = ModelNames.CreateIndexModelName(prefix, kvp.Key);
ModelBinding\JQueryKeyValuePairNormalizer.cs (1)
25var normalizedKey = NormalizeJQueryToMvc(builder, originalValue.Key);
ModelBinding\ModelBindingHelper.cs (2)
405if (kvp.Key.Length > 0 && kvp.Key[0] == '[')
ModelBinding\Validation\ShortFormDictionaryValidationStrategy.cs (1)
105_entry = new ValidationEntry(_metadata, _keyMappingEnumerator.Current.Key, value);
MvcCoreLoggerExtensions.cs (1)
94.Select(pair => pair.Key + "=" + Convert.ToString(pair.Value, CultureInfo.InvariantCulture))
Routing\ActionEndpointFactory.cs (2)
283var parameter = attributeRoutePattern.GetParameter(routeValue.Key); 301updatedDefaults[routeValue.Key] = routeValue.Value;
Routing\AttributeRoute.cs (3)
84defaults.Add(kvp.Key, kvp.Value); 211if (string.Equals(kvp.Key, parameter.Name, StringComparison.OrdinalIgnoreCase)) 215kvp.Key,
Routing\ControllerActionEndpointDataSource.cs (1)
108keys.Add(kvp.Key);
Routing\DynamicControllerEndpointMatcherPolicy.cs (2)
123"{ " + string.Join(", ", dynamicValues.Select(kvp => $"{kvp.Key}: {kvp.Value}")) + " }."); 140values.TryAdd(kvp.Key, kvp.Value);
Routing\MvcAttributeRouteHandler.cs (1)
65context.RouteData.Values[kvp.Key] = kvp.Value;
Routing\UrlHelperBase.cs (2)
86_routeValueDictionary.Add(kvp.Key, kvp.Value); 97_routeValueDictionary.Add(kvp.Key, kvp.Value);
SerializableError.cs (1)
40var key = keyModelStatePair.Key;
ValidationProblemDetails.cs (1)
41var key = keyModelStatePair.Key;
Microsoft.AspNetCore.Mvc.Formatters.Xml (3)
ProblemDetailsWrapper.cs (1)
154var key = keyValuePair.Key;
SerializableErrorWrapper.cs (1)
89var key = keyValuePair.Key;
ValidationProblemDetailsWrapper.cs (1)
91var key = keyValuePair.Key;
Microsoft.AspNetCore.Mvc.NewtonsoftJson (10)
AnnotatedProblemDetails.cs (2)
25Extensions[kvp.Key] = kvp.Value; 57problemDetails.Extensions[kvp.Key] = kvp.Value;
BsonTempDataSerializer.cs (6)
75convertedDictionary[item.Key] = result; 87convertedDictionary[item.Key] = null; 102convertedDictionary[item.Key] = result; 116convertedDictionary[item.Key] = (int)longValue; 232convertedDictionary.Add(item.Key, jObject.Value<TVal>(item.Key));
ValidationProblemDetailsConverter.cs (2)
61Errors[kvp.Key] = kvp.Value; 74problemDetails.Errors[kvp.Key] = kvp.Value;
Microsoft.AspNetCore.Mvc.Razor (2)
ViewLocationCacheKey.cs (2)
110if (!y.ViewLocationExpanderValues.TryGetValue(item.Key, out var yValue) || 140hashCode.Add(item.Key, StringComparer.Ordinal);
Microsoft.AspNetCore.Mvc.RazorPages (4)
Infrastructure\DynamicPageEndpointMatcherPolicy.cs (2)
122"{ " + string.Join(", ", dynamicValues.Select(kvp => $"{kvp.Key}: {kvp.Value}")) + " }."); 139values.TryAdd(kvp.Key, kvp.Value);
Infrastructure\PageActionDescriptorProvider.cs (2)
112if (!descriptor.RouteValues.ContainsKey(kvp.Key)) 114descriptor.RouteValues.Add(kvp.Key, kvp.Value);
Microsoft.AspNetCore.Mvc.TagHelpers (7)
Cache\CacheTagKey.cs (4)
319.Append(item.Key) 339hashCode.Add(item.Key); 359if (!string.Equals(values1[i].Key, values2[i].Key, StringComparison.Ordinal) ||
TagHelperOutputExtensions.cs (3)
92if (!tagHelperOutput.Attributes.ContainsName(attribute.Key)) 94tagHelperOutput.Attributes.Add(attribute.Key, attribute.Value); 96else if (string.Equals(attribute.Key, "class", StringComparison.OrdinalIgnoreCase))
Microsoft.AspNetCore.Mvc.Testing (10)
_generated\0\CustomJsonSerializerContext.IDictionaryStringString.g.cs (1)
61writer.WriteString(entry.Key, entry.Value);
DeferredHostBuilder.cs (1)
32b.Properties[pair.Key] = pair.Value;
Handlers\RedirectHandler.cs (5)
90contentCopy.Headers.TryAddWithoutValidation(header.Key, header.Value); 91newRequestContent.Headers.TryAddWithoutValidation(header.Key, header.Value); 104if (!header.Key.Equals(HeaderNames.Authorization, StringComparison.OrdinalIgnoreCase)) 106redirectRequestHeaders.TryAddWithoutValidation(header.Key, header.Value); 162var key = new HttpRequestOptionsKey<object?>(property.Key);
src\44e1214b125d320f\HostFactoryResolver.cs (3)
341if (value.Key == "HostBuilding") 345else if (value.Key == "HostBuilt") 355else if (_arbitraryActions?.TryGetValue(value.Key, out var arbitraryAction) == true)
Microsoft.AspNetCore.Mvc.ViewFeatures (36)
AttributeDictionary.cs (16)
83Debug.Assert(value.Key != null); 96Debug.Assert(value.Key != null); 133var compare = StringComparer.OrdinalIgnoreCase.Compare(Get(pivot).Key, key); 160if (item.Key == null) 164nameof(KeyValuePair<string, string?>.Key), 169var index = Find(item.Key); 176throw new InvalidOperationException(Resources.FormatDictionary_DuplicateKey(item.Key)); 191if (item.Key == null) 195nameof(KeyValuePair<string, string?>.Key), 200var index = Find(item.Key); 249if (item.Key == null) 253nameof(KeyValuePair<string, string?>.Key), 258var index = Find(item.Key); 395if (string.Equals(item, _attributes.Get(i).Key, StringComparison.OrdinalIgnoreCase)) 415array[arrayIndex + i] = _attributes.Get(i).Key; 452public string Current => _attributes.Get(_index).Key;
DefaultHtmlGenerator.cs (1)
1016.Select(kvp => kvp.Key);
HtmlHelper.cs (5)
1387Text = keyValuePair.Key.Name, 1391if (!string.IsNullOrEmpty(keyValuePair.Key.Group)) 1393if (!groupList.TryGetValue(keyValuePair.Key.Group, out var group)) 1395group = new SelectListGroup() { Name = keyValuePair.Key.Group }; 1396groupList[keyValuePair.Key.Group] = group;
Infrastructure\DefaultTempDataSerializer.cs (1)
204writer.WriteString(element.Key, element.Value);
ModelExplorerExtensions.cs (1)
59return kvp.Key.Name;
ModelStateDictionaryExtensions.cs (2)
132modelState.Remove(entry.Key); 141modelState.Remove(entry.Key);
Rendering\TagBuilder.cs (2)
241var key = attribute.Key; 312var key = Convert.ToString(entry.Key, CultureInfo.InvariantCulture)!;
TempDataDictionary.cs (6)
169if (!_initialKeys.Contains(entry.Key) && !_retainedKeys.Contains(entry.Key)) 171_data.Remove(entry.Key); 251_initialKeys.Add(keyValuePair.Key); 264_initialKeys.Remove(keyValuePair.Key); 294_tempData._initialKeys.Remove(kvp.Key);
TemplateBuilder.cs (2)
113formattedModelValue = kvp.Key.Name; 126viewData[kvp.Key] = kvp.Value;
Microsoft.AspNetCore.OpenApi (7)
Schemas\OpenApiJsonSchema.Helpers.cs (2)
296schema.Properties = props?.ToDictionary(p => p.Key, p => p.Value.Schema as IOpenApiSchema); 335schema.Discriminator.Mapping[kvp.Key] = new OpenApiSchemaReference(kvp.Value);
Services\OpenApiDocumentService.cs (1)
98document.Components.Schemas.OrderBy(kvp => kvp.Key),
Services\OpenApiGenerator.cs (1)
198var statusCode = annotation.Key;
Services\Schemas\OpenApiSchemaService.cs (3)
450discriminator.Mapping[mapping.Key] = ResolveSchemaReference(document, mapping.Value); 623newObject[property.Key] = processedValue?.DeepClone(); 627newObject[property.Key] = null;
Microsoft.AspNetCore.OpenApi.SourceGenerators (1)
src\aspnetcore\src\Shared\RoslynUtils\IncrementalValuesProviderExtensions.cs (1)
33result.Add((entry.Key, index, entry.Value.ToImmutable()));
Microsoft.AspNetCore.OutputCaching (8)
Memory\MemoryOutputCacheStore.cs (1)
24internal Dictionary<string, HashSet<string>> TaggedEntries => _taggedEntries.ToDictionary(kvp => kvp.Key, kvp => kvp.Value.Select(t => t.Key).ToHashSet());
OutputCacheEntry.cs (2)
93if (OutputCacheEntryFormatter.ShouldStoreHeader(header.Key)) 95arr[index++] = (header.Key, header.Value);
OutputCacheKeyProvider.cs (4)
213if (ContainsDelimiters(queryArray[i].Key)) 220.AppendUpperInvariant(queryArray[i].Key) 372public int Compare(KeyValuePair<string, StringValues> x, KeyValuePair<string, StringValues> y) => _stringComparer.Compare(x.Key, y.Key);
Policies\VaryByValuePolicy.cs (1)
23rules.VaryByValues[result.Key] = result.Value;
Microsoft.AspNetCore.Owin (10)
DictionaryStringArrayWrapper.cs (2)
20private static KeyValuePair<string, StringValues> Convert(KeyValuePair<string, string[]> item) => new(item.Key, item.Value); 22private static KeyValuePair<string, string[]> Convert(KeyValuePair<string, StringValues> item) => new(item.Key, item.Value);
DictionaryStringValuesWrapper.cs (2)
21private static KeyValuePair<string, StringValues> Convert(KeyValuePair<string, string[]> item) => new(item.Key, item.Value); 23private static KeyValuePair<string, string[]> Convert(KeyValuePair<string, StringValues> item) => new(item.Key, item.Value);
OwinEnvironment.cs (6)
86.Where(pair => pair.Value.TryGet(_context, out _)).Select(pair => pair.Key) 216yield return new KeyValuePair<string, object>(entryPair.Key, value); 221yield return new KeyValuePair<string, object>(Convert.ToString(entryPair.Key, CultureInfo.InvariantCulture), entryPair.Value); 578if (_deletedKeys?.Contains(entry.Key) == true) 588if (_deletedKeys?.Contains(entry.Key) == true) 616_contextEntries[entry.Key] = entry.Value;
Microsoft.AspNetCore.RateLimiting (1)
RateLimitingMiddleware.cs (1)
52_policyMap.Add(unactivatedPolicy.Key, unactivatedPolicy.Value(serviceProvider));
Microsoft.AspNetCore.Razor.Runtime (1)
src\aspnetcore\src\Shared\Debugger\DictionaryItemDebugView.cs (1)
23Key = keyValue.Key;
Microsoft.AspNetCore.Razor.Utilities.Shared (1)
src\roslyn\src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
650dictionary.Add(pair.Key, pair.Value.ToImmutableAndFree());
Microsoft.AspNetCore.ResponseCaching (8)
CacheEntry\CacheEntryHelpers.cs (1)
27size += (item.Key.Length * sizeof(char)) + EstimateStringValuesSize(item.Value);
ResponseCachingKeyProvider.cs (4)
156ThrowIfContainsDelimiters(queryArray[i].Key); 159.AppendUpperInvariant(queryArray[i].Key) 231public int Compare(KeyValuePair<string, StringValues> x, KeyValuePair<string, StringValues> y) => _stringComparer.Compare(x.Key, y.Key);
ResponseCachingMiddleware.cs (3)
175response.Headers[header.Key] = header.Value; 351if (!string.Equals(header.Key, HeaderNames.Age, StringComparison.OrdinalIgnoreCase)) 353context.CachedResponse.Headers[header.Key] = header.Value;
Microsoft.AspNetCore.Routing (87)
DataTokensMetadata.cs (1)
36return DebuggerHelpers.GetDebugText(nameof(DataTokens), DataTokens.Select(t => $"{t.Key}={t.Value ?? "(null)"}"));
DecisionTree\DecisionTreeBuilder.cs (6)
119if (context.CurrentCriteria.Contains(kvp.Key)) 126if (!criteria.TryGetValue(kvp.Key, out var criterion)) 129criteria.Add(kvp.Key, criterion); 170childContext.CurrentCriteria.Add(criterion.Key); 173reducedBranches.Add(branch.Key.Value, newBranch); 181Key = criterion.Key,
DefaultLinkGenerator.cs (2)
450foreach (var kvp in values.OrderBy(kvp => kvp.Key)) 453builder.Append(kvp.Key);
DefaultLinkParser.cs (3)
95var parameter = endpoint.RoutePattern.GetParameter(kvp.Key); 107constraints.Add(kvp.Key, constraintsForParameter); 135if (!constraint.Match(httpContext: null, NullRouter.Instance, kvp.Key, values, RouteDirection.IncomingRequest))
EndpointNameAddressScheme.cs (2)
80if (group.Key is not null && group.Value.Length > 1) 83builder.AppendLine(Resources.FormatDuplicateEndpointNameEntry(group.Key));
Internal\DfaGraphWriter.cs (2)
77writer.WriteLine($"{label} -> {visited[literal.Value]} [label=\"/{literal.Key}\"]"); 95writer.WriteLine($"{label} -> {visited[policy.Value]} [label=\"{policy.Key}\"]");
Matching\AcceptsMatcherPolicy.cs (2)
195var edgeKey = new ReadOnlyMediaTypeHeaderValue(kvp.Key); 243result[index] = new PolicyNodeEdge(kvp.Key, kvp.Value);
Matching\Candidate.cs (1)
84if (slots[i].Key != null)
Matching\DfaMatcher.cs (3)
306if (!constraint.Value.Match(httpContext, NullRouter.Instance, constraint.Key, values, RouteDirection.IncomingRequest)) 308Log.CandidateRejectedByConstraint(_logger, httpContext.Request.Path, endpoint, constraint.Key, constraint.Value, values[constraint.Key]);
Matching\DfaMatcherBuilder.cs (5)
604pathEntries[index++] = (kvp.Key, transition); 641policyEntries[index++] = new PolicyJumpTableEdge(kvp.Key, Transition(kvp.Value)); 749_assignments.Add(kvp.Key, _assignments.Count); 813var parameter = routeEndpoint.RoutePattern.GetParameter(kvp.Key); // may be null, that's ok 821_constraints.Add(new KeyValuePair<string, IRouteConstraint>(kvp.Key, routeConstraint));
Matching\DfaNode.cs (1)
124builder.AppendJoin(", ", Literals.Select(kvp => $"{kvp.Key}->({FormatNode(kvp.Value)})"));
Matching\DictionaryJumpTable.cs (1)
50builder.AppendJoin(", ", _dictionary.Select(kvp => $"{kvp.Key}: {kvp.Value}"));
Matching\HostMatcherPolicy.cs (2)
249var edgeKey = kvp.Key; 275result[index] = new PolicyNodeEdge(kvp.Key, kvp.Value);
Matching\HttpMethodMatcherPolicy.cs (3)
237if (acceptCorsPreFlight || !kvp.Key.IsCorsPreflightRequest) 293policyNodeEdges[index++] = new PolicyNodeEdge(kvp.Key, kvp.Value); 338var method = httpMethodDestination.Key;
Matching\NegotiationMatcherPolicy.cs (1)
317new NegotiationEdgeKey(kvp.Key, CalculateEndpointQualities(kvp.Value)),
Patterns\DefaultRoutePatternTransformer.cs (12)
56if (original.GetParameter(kvp.Key) != null) 65else if (original.Defaults.TryGetValue(kvp.Key, out var defaultValue) && 83if (original.GetParameter(kvp.Key) == null && 84original.Defaults.TryGetValue(kvp.Key, out var defaultValue) && 98else if ((parameter = original.GetParameter(kvp.Key)) != null) 102if (!MatchesConstraints(original, parameter, kvp.Key, requiredValues)) 115else if (original.Defaults.TryGetValue(kvp.Key, out var defaultValue) && 121if (!MatchesConstraints(original, parameter: null, kvp.Key, requiredValues)) 159var parameter = original.GetParameter(kvp.Key); 168original.Defaults.TryGetValue(kvp.Key, out var defaultValue) && 178updatedDefaults.Remove(kvp.Key); 185requiredValues.TryAdd(kvp.Key, kvp.Value);
Patterns\RoutePatternFactory.cs (6)
465updatedDefaults.Add(kvp.Key, kvp.Value); 506if (string.Equals(kvp.Key, parameters[i].Name, StringComparison.OrdinalIgnoreCase)) 517updatedDefaults.TryGetValue(kvp.Key, out var defaultValue) && 527$"'{kvp.Key}={kvp.Value}'. A non-null required value must correspond to a route parameter or the " + 537? parameterPolicyReferences.ToDictionary(kvp => kvp.Key, kvp => (IReadOnlyList<RoutePatternParameterPolicyReference>)kvp.Value.ToArray()) 683updatedParameterPolicies.Add(kvp.Key, policyReferences);
Patterns\RoutePatternMatcher.cs (3)
192if (!values.ContainsKey(kvp.Key)) 194values.Add(kvp.Key, kvp.Value); 495values[item.Key] = item.Value;
RouteBase.cs (3)
191pathData.DataTokens.Add(dataToken.Key, dataToken.Value); 215constraintBuilder.AddConstraint(kvp.Key, kvp.Value); 284destination[kvp.Key] = kvp.Value;
RouteConstraintBuilder.cs (3)
67if (_optionalParameters.Contains(kvp.Key)) 70constraints.Add(kvp.Key, optionalConstraint); 74constraints.Add(kvp.Key, constraint);
RouteConstraintMatcher.cs (3)
65if (!constraint.Match(httpContext, route, kvp.Key, routeValues, routeDirection)) 73routeValues.TryGetValue(kvp.Key, out var routeValue); 75Log.ConstraintNotMatched(logger, routeValue!, kvp.Key, kvp.Value);
RouteValuesAddress.cs (1)
33_toString ??= $"{RouteName}({string.Join(',', ExplicitValues.Select(kv => $"{kv.Key}=[{kv.Value}]"))})";
src\aspnetcore\src\Shared\Debugger\DebuggerHelpers.cs (1)
62sb.Append(kvp.Key);
Template\DefaultTemplateBinderFactory.cs (1)
42var parameterName = kvp.Key;
Template\TemplateBinder.cs (13)
176var key = slots[i].Key; 257var key = slots[i].Key; 358var key = filters[i].Key; 391if (!_defaults!.ContainsKey(kvp.Key)) 396if (!acceptedValues.ContainsKey(kvp.Key)) 398acceptedValues.Add(kvp.Key, kvp.Value); 596if (_defaults != null && _defaults.ContainsKey(kvp.Key)) 607wroteFirst |= AddQueryKeyValueToContext(context, kvp.Key, value, wroteFirst); 612wroteFirst |= AddQueryKeyValueToContext(context, kvp.Key, kvp.Value, wroteFirst); 711var parameter = _pattern.GetParameter(kvp.Key); 712if (parameter == null && !acceptedValues.ContainsKey(kvp.Key)) 714combinedValues.Add(kvp.Key, kvp.Value); 731slots[i + pattern.Parameters.Count] = new KeyValuePair<string, object?>(filters[i].Key, null);
Tree\LinkGenerationDecisionTree.cs (2)
179results.Add(kvp.Key, new DecisionCriterionValue(kvp.Value ?? string.Empty)); 256branchStack.Push($" => {criterion.Key}: {branch.Key}");
Tree\TreeRouter.cs (3)
299if (entry.RequiredLinkValues.ContainsKey(kvp.Key)) 301var parameter = entry.RouteTemplate.GetParameter(kvp.Key); 309inputValues.Add(kvp.Key, kvp.Value);
ValidationEndpointFilterFactory.cs (1)
84keySelector: kvp => kvp.Key,
Microsoft.AspNetCore.Routing.Abstractions (5)
RouteData.cs (4)
172Values[kvp.Key] = kvp.Value; 181DataTokens[kvp.Key] = kvp.Value; 246_routeData._dataTokens.Add(kvp.Key, kvp.Value); 308_routeData._values.Add(kvp.Key, kvp.Value);
src\aspnetcore\src\Shared\Debugger\DictionaryItemDebugView.cs (1)
23Key = keyValue.Key;
Microsoft.AspNetCore.Server.HttpSys (14)
RequestProcessing\Response.cs (1)
652var headerName = headerPair.Key;
src\aspnetcore\src\Shared\Debugger\DictionaryItemDebugView.cs (1)
23Key = keyValue.Key;
src\aspnetcore\src\Shared\Debugger\StringValuesDictionaryDebugView.cs (1)
28keyValuePairs.Add(new DictionaryItemDebugView<string, string>(kvp.Key, kvp.Value.ToString()));
src\aspnetcore\src\Shared\HttpSys\RequestProcessing\HeaderCollection.cs (3)
167ValidateRestrictedTrailers(item.Key); 169ValidateHeaderCharacters(item.Key); 300public KeyValuePair<string, string>[] Items => _collection.Select(pair => new KeyValuePair<string, string>(pair.Key, pair.Value.ToString())).ToArray();
src\aspnetcore\src\Shared\HttpSys\RequestProcessing\RequestHeaders.cs (4)
99destination[knownHeadersCount++] = item.Key; 147((IDictionary<string, StringValues>)this).Add(item.Key, item.Value); 161return ((IDictionary<string, StringValues>)this).TryGetValue(item.Key, out var value) && Equals(value, item.Value); 242((IDictionary<string, StringValues>)this).Remove(item.Key);
StandardFeatureCollection.cs (1)
103yield return new KeyValuePair<Type, object>(featureFunc.Key, feature);
UrlPrefixCollection.cs (3)
155id = pair.Key; 201FindHttpPortUnsynchronized(pair.Key, urlPrefix); 206_urlGroup.RegisterPrefix(pair.Value.FullPrefix, pair.Key);
Microsoft.AspNetCore.Server.IIS (17)
Core\IISHttpContext.cs (5)
656var isKnownHeader = HttpApiTypes.KnownResponseHeaders.TryGetValue(headerPair.Key, out var knownHeaderIndex); 673var headerNameBytes = Encoding.UTF8.GetBytes(headerPair.Key); 700var headerNameBytes = Encoding.ASCII.GetBytes(headerPair.Key); 769await entry.Key.Invoke(entry.Value); 793await entry.Key.Invoke(entry.Value);
Core\IISHttpContext.FeatureCollection.cs (3)
68if (kv.Key == key) 86if (MaybeExtra[i].Key == key) 101if (MaybeExtra[i].Key == key)
src\aspnetcore\src\Shared\Debugger\DictionaryItemDebugView.cs (1)
23Key = keyValue.Key;
src\aspnetcore\src\Shared\Debugger\StringValuesDictionaryDebugView.cs (1)
28keyValuePairs.Add(new DictionaryItemDebugView<string, string>(kvp.Key, kvp.Value.ToString()));
src\aspnetcore\src\Shared\HttpSys\RequestProcessing\HeaderCollection.cs (3)
167ValidateRestrictedTrailers(item.Key); 169ValidateHeaderCharacters(item.Key); 300public KeyValuePair<string, string>[] Items => _collection.Select(pair => new KeyValuePair<string, string>(pair.Key, pair.Value.ToString())).ToArray();
src\aspnetcore\src\Shared\HttpSys\RequestProcessing\RequestHeaders.cs (4)
99destination[knownHeadersCount++] = item.Key; 147((IDictionary<string, StringValues>)this).Add(item.Key, item.Value); 161return ((IDictionary<string, StringValues>)this).TryGetValue(item.Key, out var value) && Equals(value, item.Value); 242((IDictionary<string, StringValues>)this).Remove(item.Key);
Microsoft.AspNetCore.Server.IntegrationTesting (4)
Deployers\RemoteWindowsDeployer\RemoteWindowsDeployer.cs (2)
176environmentVariable.SetAttributeValue("name", envVariablePair.Key); 233var environmentVariables = string.Join("`,", _deploymentParameters.EnvironmentVariables.Select(envVariable => $"{envVariable.Key}={envVariable.Value}"));
ProcessHelpers.cs (1)
17SetEnvironmentVariable(environment, environmentVariable.Key, environmentVariable.Value, logger);
src\aspnetcore\src\Shared\Process\ProcessEx.cs (1)
118startInfo.EnvironmentVariables[envVar.Key] = envVar.Value;
Microsoft.AspNetCore.Server.Kestrel.Core (34)
Internal\ConfigSectionClone.cs (1)
40if (!other.Children.TryGetValue(kvp.Key, out var child))
Internal\Http\HttpHeaders.cs (5)
119ICollection<string> IDictionary<string, StringValues>.Keys => ((IDictionary<string, StringValues>)this).Select(pair => pair.Key).ToHashSet(StringComparer.OrdinalIgnoreCase); 186((IDictionary<string, StringValues>)this).Add(item.Key, item.Value); 218TryGetValueFast(item.Key, out var value) && 248TryGetValueFast(item.Key, out var value) && 250RemoveFast(item.Key);
Internal\Http\HttpProtocol.cs (2)
846await entry.Key.Invoke(entry.Value); 874await entry.Key.Invoke(entry.Value);
Internal\Http\HttpProtocol.Generated.cs (3)
140if (kv.Key == key) 158if (MaybeExtra[i].Key == key) 173if (MaybeExtra[i].Key == key)
Internal\Http\HttpResponseHeaders.cs (3)
66buffer.WriteAscii(kv.Key); 79var encoding = encodingSelector(kv.Key); 85buffer.WriteAscii(kv.Key);
Internal\Http3\Http3HeadersEnumerator.cs (4)
72if (_hasMultipleValues && MoveNextOnStringEnumerator(Current.Key)) 80? SetCurrent(_headersEnumerator.Current.Key, _headersEnumerator.Current.Value, _headersEnumerator.CurrentKnownType) 86? SetCurrent(_trailersEnumerator.Current.Key, _trailersEnumerator.Current.Value, _trailersEnumerator.CurrentKnownType) 92? SetCurrent(_genericEnumerator.Current.Key, _genericEnumerator.Current.Value, default)
Internal\Http3\QPackHeaderWriter.cs (1)
66var name = headersEnumerator.Current.Key;
Internal\Infrastructure\ConnectionManager.cs (1)
77else if (_connectionReferences.TryRemove(kvp.Key, out reference))
Internal\Infrastructure\KestrelConnection.cs (2)
113var task = entry.Key.Invoke(entry.Value); 143await entry.Key.Invoke(entry.Value);
Internal\PinnedBlockMemoryPoolFactory.cs (1)
46pool.Key.TryScheduleEviction(now);
src\aspnetcore\src\Servers\Kestrel\shared\HPackHeaderWriter.cs (1)
124var name = headersEnumerator.Current.Key;
src\aspnetcore\src\Servers\Kestrel\shared\Http2HeadersEnumerator.cs (3)
87if (_hasMultipleValues && MoveNextOnStringEnumerator(Current.Key)) 95? SetCurrent(_headersEnumerator.Current.Key, _headersEnumerator.Current.Value, _headersEnumerator.CurrentKnownType) 101? SetCurrent(_trailersEnumerator.Current.Key, _trailersEnumerator.Current.Value, _trailersEnumerator.CurrentKnownType)
src\aspnetcore\src\Shared\Debugger\DictionaryItemDebugView.cs (1)
23Key = keyValue.Key;
src\aspnetcore\src\Shared\Debugger\StringValuesDictionaryDebugView.cs (1)
28keyValuePairs.Add(new DictionaryItemDebugView<string, string>(kvp.Key, kvp.Value.ToString()));
src\aspnetcore\src\Shared\Metrics\MetricsExtensions.cs (5)
41if (list[i].Key == name) 52if (tag.Key == name) 70if (tag.Key == name) 80if (tag.Key == name) 95if (tags[i].Key == name)
Microsoft.AspNetCore.Server.Kestrel.Transport.DirectTls (4)
src\aspnetcore\src\Servers\Kestrel\shared\TransportConnection.Generated.cs (3)
82if (kv.Key == key) 100if (MaybeExtra[i].Key == key) 115if (MaybeExtra[i].Key == key)
TlsEventPump.cs (1)
1116expired[count++] = kvp.Key;
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (3)
src\aspnetcore\src\Servers\Kestrel\shared\TransportConnection.Generated.cs (3)
82if (kv.Key == key) 100if (MaybeExtra[i].Key == key) 115if (MaybeExtra[i].Key == key)
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (8)
src\aspnetcore\src\Servers\Kestrel\shared\ConnectionCompletion.cs (2)
28var task = entry.Key.Invoke(entry.Value); 58await entry.Key.Invoke(entry.Value);
src\aspnetcore\src\Servers\Kestrel\shared\TransportConnection.Generated.cs (3)
82if (kv.Key == key) 100if (MaybeExtra[i].Key == key) 115if (MaybeExtra[i].Key == key)
src\aspnetcore\src\Servers\Kestrel\shared\TransportMultiplexedConnection.Generated.cs (3)
69if (kv.Key == key) 87if (MaybeExtra[i].Key == key) 102if (MaybeExtra[i].Key == key)
Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (3)
src\aspnetcore\src\Servers\Kestrel\shared\TransportConnection.Generated.cs (3)
82if (kv.Key == key) 100if (MaybeExtra[i].Key == key) 115if (MaybeExtra[i].Key == key)
Microsoft.AspNetCore.Session (1)
DistributedSession.cs (1)
325var keyBytes = entry.Key.KeyBytes;
Microsoft.AspNetCore.SignalR.Client.Core (2)
HubConnection.cs (2)
1111kvp.Key.ToString(), 1123kvp.Key.ToString(),
Microsoft.AspNetCore.SignalR.Core (2)
src\aspnetcore\src\Shared\Diagnostics\ActivityCreator.cs (2)
84activity.AddTag(tag.Key, tag.Value); 122activity.AddBaggage(baggageItem.Key, baggageItem.Value);
Microsoft.AspNetCore.SignalR.Protocols.Json (1)
Protocol\JsonHubProtocol.cs (1)
586writer.WriteString(value.Key, value.Value);
Microsoft.AspNetCore.SignalR.Protocols.MessagePack (1)
Protocol\MessagePackHubProtocolWorker.cs (1)
601writer.Write(header.Key);
Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson (1)
Protocol\NewtonsoftJsonHubProtocol.cs (1)
584writer.WritePropertyName(value.Key);
Microsoft.AspNetCore.SignalR.StackExchangeRedis (2)
Internal\AckHandler.cs (2)
58if (_acks.TryRemove(pair.Key, out var ack)) 76if (_acks.TryRemove(pair.Key, out var ack))
Microsoft.AspNetCore.SpaServices.Extensions (9)
Npm\NodeScriptRunner.cs (1)
56processStartInfo.Environment[keyValuePair.Key] = keyValuePair.Value;
Proxying\SpaProxy.cs (8)
147if (NotForwardedHttpHeaders.Contains(header.Key)) 152if (!requestMessage.Headers.TryAddWithoutValidation(header.Key, header.Value.ToArray()) && requestMessage.Content != null) 154requestMessage.Content?.Headers.TryAddWithoutValidation(header.Key, header.Value.ToArray()); 171&& InvalidH2H3Headers.Contains(header.Key)) 175context.Response.Headers[header.Key] = header.Value.ToArray(); 180context.Response.Headers[header.Key] = header.Value.ToArray(); 222if (!NotForwardedWebSocketHeaders.Contains(headerEntry.Key)) 226client.Options.SetRequestHeader(headerEntry.Key, headerEntry.Value);
Microsoft.AspNetCore.TestHost (11)
ClientHandler.cs (7)
147req.Headers.Append(header.Key, header.Value.ToArray()); 160if (string.Equals(header.Key, HeaderNames.UserAgent, StringComparison.OrdinalIgnoreCase)) 162req.Headers.Append(header.Key, string.Join(' ', header.Value)); 166req.Headers.Append(header.Key, header.Value.ToArray()); 204bool success = response.TrailingHeaders.TryAddWithoutValidation(trailer.Key, (IEnumerable<string>)trailer.Value); 221if (!response.Headers.TryAddWithoutValidation(header.Key, (IEnumerable<string>)header.Value)) 223bool success = response.Content.Headers.TryAddWithoutValidation(header.Key, (IEnumerable<string>)header.Value);
HttpContextBuilder.cs (1)
235newFeatures[pair.Key] = pair.Value;
src\44e1214b125d320f\HostFactoryResolver.cs (3)
341if (value.Key == "HostBuilding") 345else if (value.Key == "HostBuilt") 355else if (_arbitraryActions?.TryGetValue(value.Key, out var arbitraryAction) == true)
Microsoft.AspNetCore.WebUtilities (3)
KeyValueAccumulator.cs (1)
101_accumulator[entry.Key] = new StringValues(entry.Value.ToArray());
QueryHelpers.cs (2)
65return AddQueryString(uri, queryString.SelectMany(kvp => kvp.Value, (kvp, v) => KeyValuePair.Create<string, string?>(kvp.Key, v))); 106sb.Append(UrlEncoder.Default.Encode(parameter.Key));
Microsoft.Build (299)
BackEnd\BuildManager\BuildManager.cs (1)
2670result.AddResultsForTarget(cacheResultInner.Key, cacheResultInner.Value);
BackEnd\BuildManager\BuildParameters.cs (2)
521_globalProperties[property.Key] = ProjectPropertyInstance.Create(property.Key, property.Value);
BackEnd\BuildManager\BuildRequestData.cs (1)
152GlobalPropertiesDictionary.Set(ProjectPropertyInstance.Create(propertyPair.Key, propertyPair.Value));
BackEnd\BuildManager\GlobalPropertiesLookup.cs (1)
34.Select(p => new KeyValuePair<string, string?>(p.Key, ExtractEscapedValue(p.Value)))
BackEnd\BuildManager\RequestedProjectState.cs (2)
52kvp => kvp.Key, 97if (!another.ItemFilters.TryGetValue(kvp.Key, out List<string> metadata))
BackEnd\Client\MSBuildClient.cs (1)
642envVars[pair.Key] = pair.Value;
BackEnd\Components\BuildRequestEngine\BuildRequestEntry.cs (1)
444_outstandingResults[requestEntry.Key] = new BuildResult(requestEntry.Value, new BuildAbortedException());
BackEnd\Components\Caching\ConfigCache.cs (2)
187smallestId = Math.Min(smallestId, kvp.Key); 217configurationsToKeep.ByMetadata[metadata.Key] = configuration;
BackEnd\Components\Communications\LogMessagePacket.cs (3)
131WriteEvaluationLocation(translator, item.Key); 206writer.Write(item.Key); 276writer.Write(kvp.Key ?? string.Empty);
BackEnd\Components\Communications\NodeProviderOutOfProcBase.cs (1)
887CommunicationsUtilities.Trace($"Writing handshake part {component.Key} ({component.Value}) to pipe {pipeName}");
BackEnd\Components\Logging\LoggingService.cs (6)
1244sinkId = sinkPair.Key; 1796loggingEventKeyValuePair = new KeyValuePair<int, BuildEventArgs>(loggingEventKeyValuePair.Key, buildEventArgs); 1811bool gotSink = _eventSinkDictionary.TryGetValue(nodeEvent.Key, out IBuildEventSink sink); 1815sink.Consume(nodeEvent.Value, nodeEvent.Key); 1851sink.Consume(eventArg, pair.Key); 1869sink.Consume(eventArg, (int)pair.Key);
BackEnd\Components\Logging\ProjectTelemetry.cs (1)
224string propertyName = kvp.Key.Replace(".", "_");
BackEnd\Components\ProjectCache\Experimental\ProxyTargets.cs (1)
38_proxyTargetToRealTargetMap = proxyTargetToRealTargetMap.ToDictionary(kvp => kvp.Key, kvp => kvp.Value, StringComparer.OrdinalIgnoreCase);
BackEnd\Components\ProjectCache\ProjectCacheDescriptorEqualityComparer.cs (1)
55dictHash ^= (pluginSetting.Key.GetHashCode() * -1521134295) + pluginSetting.Value.GetHashCode();
BackEnd\Components\ProjectCache\ProxyTargets.cs (1)
37_proxyTargetToRealTargetMap = proxyTargetToRealTargetMap.ToDictionary(kvp => kvp.Key, kvp => kvp.Value, StringComparer.OrdinalIgnoreCase);
BackEnd\Components\RequestBuilder\BatchingEngine.cs (2)
313string itemName = entry.Key; 403string metadataQualifiedName = consumedMetadataReference.Key;
BackEnd\Components\RequestBuilder\IntrinsicTasks\ItemGroupLoggingHelper.cs (3)
226keyValuePairList.Sort((l, r) => StringComparer.OrdinalIgnoreCase.Compare(l.Key, r.Key)); 233sb.Append(kvp.Key);
BackEnd\Components\RequestBuilder\IntrinsicTasks\MSBuild.cs (3)
615if (!additionalProjectPropertiesTable.ContainsKey(entry.Key)) 617combinedTable.Add(entry.Key, entry.Value); 624combinedTable.Add(entry.Key, entry.Value);
BackEnd\Components\RequestBuilder\Lookup.cs (15)
340if (SecondaryModifyTable.TryGetValue(entry.Key, out modifiesOfType)) 350SecondaryModifyTable.Add(entry.Key, entry.Value); 382_baseItems.ImportItemsOfType(kvp.Key, kvp.Value); 390_baseItems.RemoveItemsOfType(kvp.Key, kvp.Value); 398ApplyModificationsToTable(_baseItems, entry.Key, entry.Value); 941if (modificationsToApply[m.Key].Remove) 943taskItem.RemoveMetadata(m.Key); 953taskItem.RemoveMetadata(modificationPair.Key); 957taskItem.SetMetadata(modificationPair.Key, modificationPair.Value.NewValue); 1009if (modifiesOfType.TryGetValue(modify.Key, out existingMetadataChanges)) 1025if (!existingMetadataChanges.ContainsExplicitModification(metadataChange.Key)) 1027existingMetadataChanges[metadataChange.Key] = metadataChange.Value; 1034modifiesOfType.Add(modify.Key, modify.Value); 1196if (modificationPair.Value.KeepValue && _modifications.TryGetValue(modificationPair.Key, out existingModification)) 1207_modifications[modificationPair.Key] = modificationPair.Value;
BackEnd\Components\RequestBuilder\RequestBuilder.cs (3)
1296var proxyTarget = proxyMapping.Key; 1360unfilteredResult.ResultsByTarget.TryGetValue(projectTargetInstance.Key, out TargetResult targetResult) && 1388projectTargetInstance.Key, isCustom, isFromNuget, isMetaprojTarget);
BackEnd\Components\RequestBuilder\TargetUpToDateChecker.cs (2)
864if (GetItemSpecsFromItemVectors(itemVectors, item.Key, item.Value).Any()) 884itemSpecs.AddRange(GetItemSpecsFromItemVectors(itemVectors, item.Key, item.Value));
BackEnd\Components\RequestBuilder\TaskHost.cs (2)
308targetOutputsPerProject[i].Add(output.Key, output.Value); 1242targetOutputsPerProject[i][resultEntry.Key] = clonedTaskItem;
BackEnd\Components\Scheduler\Scheduler.cs (1)
1840config.GlobalProperties.ToDictionary().Select(kvp => $"{kvp.Key}={kvp.Value}"));
BackEnd\Components\Scheduler\SchedulingPlan.cs (6)
114configurationsInOrder.Sort((l, r) => Comparer<int>.Default.Compare(l.Key, r.Key)); 117file.WriteLine(String.Format(CultureInfo.InvariantCulture, "{0} {1} {2}", configuration.Key, configuration.Value, _configCache[configuration.Key].ProjectFullPath)); 241Console.WriteLine("{0}: {1} ({2} referrers) {3}", configuration.Key, config.TotalPlanTime, config.ReferrerCount, config.ConfigFullPath); 263Console.WriteLine("{0}: {1} {2}", configuration.Key, configuration.Value.ReferencesCount, configuration.Value.ConfigFullPath);
BackEnd\Components\SdkResolution\SdkResult.cs (6)
134if (result._propertiesToAdd[propertyToAdd.Key] != propertyToAdd.Value) 145if (!result._itemsToAdd[itemToAdd.Key].Equals(itemToAdd.Value)) 157if (!result._environmentVariablesToAdd.TryGetValue(envVarToAdd.Key, out string otherEnvVarValue) || otherEnvVarValue != envVarToAdd.Value) 190hashCode = (hashCode * -1521134295) + propertyToAdd.Key.GetHashCode(); 198hashCode = (hashCode * -1521134295) + itemToAdd.Key.GetHashCode(); 206hashCode = (hashCode * -1521134295) + envVarToAdd.Key.GetHashCode();
BackEnd\Node\OutOfProcNode.cs (1)
748Environment.SetEnvironmentVariable(environmentPair.Key, environmentPair.Value);
BackEnd\Shared\BuildResult.cs (2)
603_resultsByTarget![targetResult.Key] = targetResult.Value; 736targetResultPair.Value.CacheItems(ConfigurationId, targetResultPair.Key);
BackEnd\Shared\ConfigurationMetadata.cs (2)
43_globalProperties[entry.Key] = ProjectPropertyInstance.Create(entry.Key, entry.Value);
BackEnd\TaskExecutionHost\TaskExecutionHost.cs (7)
587success = SetTaskParameter(parameter.Key, parameter.Value.Item1, parameter.Value.Item2, requiredParameters.ContainsKey(parameter.Key), out taskParameterSet); 609setParameters[parameter.Key] = String.Empty; 624setParameters.ContainsKey(requiredParameter.Key), 628requiredParameter.Key); 1843yield return new KeyValuePair<string, string>(kvp.Key, EscapingUtilities.Escape(kvp.Value)); 1850yield return new KeyValuePair<string, string>(kvp.Key, EscapingUtilities.Escape(kvp.Value));
BuildCheck\Checks\CopyAlwaysCheck.cs (1)
75if (MSBuildNameIgnoreCaseComparer.Default.Equals(keyValuePair.Key, ItemMetadataNames.copyToOutputDirectory))
BuildCheck\Checks\EmbeddedResourceCheck.cs (2)
59if (MSBuildNameIgnoreCaseComparer.Default.Equals(keyValuePair.Key, ItemMetadataNames.culture)) 65if (MSBuildNameIgnoreCaseComparer.Default.Equals(keyValuePair.Key, ItemMetadataNames.withCulture) &&
BuildCheck\Checks\PropertiesUsageCheck.cs (3)
219if (propWithLocation.Value != null && !_readProperties.Contains(propWithLocation.Key)) 224propWithLocation.Key)); 235uninitializedRead.Key));
BuildCheck\Infrastructure\BuildCheckBuildEventHandler.cs (1)
209=> title + Environment.NewLine + String.Join(Environment.NewLine, rowData.Select(a => $"{a.Key},{a.Value}")) + Environment.NewLine;
BuildCheck\Infrastructure\BuildEventsProcessor.cs (1)
57static (dict, kvp) => dict.Add(kvp.Key, kvp.Value));
BuildCheck\Infrastructure\ConfigurationProvider.cs (3)
168if (kv.Key.StartsWith(keyFilter, StringComparison.OrdinalIgnoreCase)) 170var newKey = kv.Key; 173newKey = kv.Key.Substring(keyFilter.Length);
BuildCheck\Infrastructure\CustomConfigurationData.cs (1)
76if (!ConfigurationData.TryGetValue(keyVal.Key, out var value) || value != keyVal.Value)
BuildCheck\Infrastructure\EditorConfig\EditorConfigParser.cs (1)
94resultingDictionary[property.Key] = property.Value;
Collections\ArrayDictionary.cs (2)
110Add(item.Key, item.Value); 124if (keyComparer.Equals(item.Key, keys[i]) && valueComparer.Equals(item.Value, values[i]))
Collections\CopyOnWritePropertyDictionary.cs (4)
280((IDictionary<string, T>)this).Add(item.Key, item.Value); 288if (_backing.TryGetValue(item.Key, out T value)) 307Assumed.Equal(item.Key, item.Value.Key, "Key must match value's key"); 308return Remove(item.Key);
Collections\HashTableUtility.cs (1)
51comparison = String.Compare(h1Entry.Value, h2[h1Entry.Key],
Collections\ItemDictionary.cs (1)
192yield return (itemTypeBucket.Key, itemTypeBucket.Value);
Collections\ItemDictionarySlim.cs (1)
57string itemType = kvp.Key;
Collections\PropertyDictionary.cs (4)
414((IDictionary<string, T>)this).Add(item.Key, item.Value); 432if (_properties.TryGetValue(item.Key, out T value)) 452Assumed.Equal(item.Key, item.Value.Key, "Key must match value's key"); 455return ((IDictionary<string, T>)this).Remove(item.Key);
Collections\ReadOnlyConvertingDictionary.cs (1)
198return new KeyValuePair<K, N>(original.Key, _converter(original.Value));
Collections\RetrievableEntryHashSet\RetrievableEntryHashSet.cs (3)
284Debug.Assert(String.Equals(entry.Key, entry.Value.Key, StringComparison.Ordinal)); 398Debug.Assert(String.Equals(entry.Key, entry.Value.Key, StringComparison.Ordinal)); 604Debug.Assert(String.Equals(entry.Key, entry.Value.Key, StringComparison.Ordinal));
Collections\WeakValueDictionary.cs (4)
69keys.Add(pair.Key); 212remove.Add(entry.Key); 243yield return new KeyValuePair<K, V>(kvp.Key, null); 247yield return new KeyValuePair<K, V>(kvp.Key, target);
Construction\ProjectItemGroupElement.cs (1)
144newItem.AddMetadata(metadatum.Key, metadatum.Value);
Construction\ProjectTaskElement.cs (2)
153parametersClone[entry.Key] = entry.Value.Item1; 182parameterLocations.Add(new KeyValuePair<string, ElementLocation>(entry.Key, entry.Value.Item2));
Construction\Solution\SolutionFile.cs (1)
453ParseAspNetCompilerProperty(proj, property.Key, property.Value);
Definition\Project.cs (4)
3498item.SetMetadataValue(metadatum.Key, metadatum.Value); 3663if (String.Equals(pair.Key, Constants.SubToolsetVersionPropertyName, StringComparison.OrdinalIgnoreCase) && subToolsetVersion != null) 3668globalPropertiesCollection.Set(ProjectPropertyInstance.Create(pair.Key, subToolsetVersion)); 3672globalPropertiesCollection.Set(ProjectPropertyInstance.Create(pair.Key, pair.Value));
Definition\ProjectCollection.cs (3)
442_globalProperties.Set(ProjectPropertyInstance.Create(pair.Key, pair.Value)); 1325mergedProperties[property.Key] = property.Value; 2189if (!globalProperties.TryGetValue(leftProperty.Key, out var rightValue))
Definition\ProjectItem.cs (1)
1022item.SetMetadata(metadatum.Key, metadatum.Value);
Definition\Toolset.cs (1)
201_properties.Set(ProjectPropertyInstance.Create(keyValuePair.Key, keyValuePair.Value, true));
Evaluation\Evaluator.cs (7)
815_usingTaskElements.Select(p => (p.Value, p.Key)), 1972_data.AddSdkResolvedEnvironmentVariable(environmentVariable.Key, environmentVariable.Value); 2013hash.Add(property.Key); 2026hash.Add(item.Key); 2058propertyGroup.AddProperty(propertyNameAndValue.Key, EscapingUtilities.Escape(propertyNameAndValue.Value)); 2074escapedMetadata[metadata.Key] = EscapingUtilities.Escape(metadata.Value); 2078itemGroup.AddItem(item.Key, EscapingUtilities.Escape(item.Value.ItemSpec), escapedMetadata);
Evaluation\ItemSpec.cs (2)
363if (fragment.IsMatchNormalized(kvp.Key)) 366matches.Add(kvp.Key);
Evaluation\LazyItemEvaluator.LazyItemOperation.cs (1)
113: string.Join(";", CapturedItems.Select(kvp => $"{kvp.Key} : {kvp.Value.EvaluatedInclude}"));
Evaluation\ParserIgnoreConfiguration.cs (4)
152sb.Append($" {kvp.Key} ({kvp.Value} occurrence{(kvp.Value > 1 ? "s" : string.Empty)});"); 246if (!destination.TryGetValue(kvp.Key, out HashSet<string>? names)) 249destination[kvp.Key] = names; 260destination.AddOrUpdate(kvp.Key, kvp.Value, (_, count) => count + kvp.Value);
Evaluation\Profiler\ProfilerResultPrettyPrinter.cs (5)
49var evaluationPasses = profiledLocations.Where(l => l.Key.IsEvaluationPass) 50.OrderBy(l => l.Key.EvaluationPass); 52var orderedLocations = profiledLocations.Where(l => !l.Key.IsEvaluationPass) 60var location = pair.Key; 76var location = pair.Key;
Evaluation\ProjectRootElementCache.cs (1)
499_weakCache[kvp.Key] = kvp.Value;
Graph\GraphBuilder.cs (5)
232var referencingProjectPath = solutionDependency.Key; 686propertyDictionary[entry.Key] = ProjectPropertyInstance.Create(entry.Key, entry.Value); 757kvp => (kvp.Key.Item1.ToConfigurationMetadata(), kvp.Key.Item2.ToConfigurationMetadata()),
Graph\ParallelWorkSet.cs (1)
57completedWork[kvp.Key] = workItem.Value;
Graph\ProjectGraph.cs (5)
493: string.Join(", ", e.GlobalProperties.Select(kvp => $"{kvp.Key} = {kvp.Value}")); 550node.ProjectInstance.GlobalProperties.OrderBy(kvp => kvp.Key) 551.Select(kvp => $"{kvp.Key}={kvp.Value}")); 803entriesToUpdate.Add(new KeyValuePair<ProjectGraphNode, ImmutableList<string>>(pair.Key, targetList)); 810targetLists[pair.Key] = pair.Value;
Graph\ProjectInterpretation.cs (2)
456destination[pair.Key] = ProjectPropertyInstance.Create(pair.Key, pair.Value);
Instance\HostServices.cs (3)
362translator.Writer.Write(pair.Key); 363translator.Writer.Write(hostObjectMapPair.Key._targetName); 364translator.Writer.Write(hostObjectMapPair.Key._taskName);
Instance\ImmutableProjectCollections\ImmutableElementCollectionConverter.cs (2)
62public bool Contains(KeyValuePair<string, T> item) => _projectElements.ContainsKey(item.Key); 192yield return new KeyValuePair<string, T>(kvp.Key, instance);
Instance\ImmutableProjectCollections\ImmutableItemDictionary.cs (2)
78itemTypeCallback(kvp.Key, new ListConverter(kvp.Key, kvp.Value, _getInstance));
Instance\ImmutableProjectCollections\ImmutableProjectMetadataCollectionConverter.cs (2)
105kvp => kvp.Key, 106kvp => EscapingUtilities.Escape(_linkedProjectItem.GetMetadataValue(kvp.Key)),
Instance\ProjectInstance.cs (9)
408_globalProperties.Set(ProjectPropertyInstance.Create(property.Key, property.Value)); 609_globalProperties[property.Key] = ProjectPropertyInstance.Create(property.Key, property.Value, false /* may not be reserved */, _isImmutable); 885foreach (var actualItem in that.GetItems(itemFilter.Key)) 1049=> new KeyValuePair<string, string>(directMetadatum.Key, directMetadatum.Value.EvaluatedValueEscaped)); 1987_sdkResolvedEnvironmentVariableProperties.Set(ProjectPropertyInstance.Create(environmentVariable.Key, environmentVariable.Value, importElement.Location, isImmutable: true)); 3322if (String.Equals(globalProperty.Key, Constants.SubToolsetVersionPropertyName, StringComparison.OrdinalIgnoreCase) && explicitSubToolsetVersion != null) 3327_globalProperties.Set(ProjectPropertyInstance.Create(globalProperty.Key, explicitSubToolsetVersion, false /* may not be reserved */, _isImmutable)); 3331_globalProperties.Set(ProjectPropertyInstance.Create(globalProperty.Key, globalProperty.Value, false /* may not be reserved */, _isImmutable));
Instance\ProjectItemDefinitionInstance.cs (2)
110IEnumerable<ProjectMetadataInstance> metadata = _metadata.Select(kvp => new ProjectMetadataInstance(kvp.Key, kvp.Value, allowItemSpecModifiers: true)); 223element.AddMetadata(kvp.Key, EscapingUtilities.UnescapeAll(kvp.Value));
Instance\ProjectItemInstance.cs (22)
981names.Add(metadatum.Key); 1183ProjectMetadataInstance.VerifyThrowReservedNameAllowItemSpecModifiers(metadatum.Key); 1220yield return new KeyValuePair<string, string>(projectMetadataInstance.Key, EscapingUtilities.UnescapeAll(projectMetadataInstance.Value)); 1266builder[kvp.Key] = kvp.Value; 1275builder[kvp.Key] = kvp.Value; 1289yield return new ProjectMetadataInstance(metadatum.Key, metadatum.Value, allowItemSpecModifiers: true); 1560string destinationValue = destinationItem.GetMetadata(metadatum.Key); 1564destinationItem.SetMetadata(metadatum.Key, GetMetadataEscaped(metadatum.Key)); 1595.Where(metadatum => string.IsNullOrEmpty(destinationItem.GetMetadataValueEscaped(metadatum.Key))); 1602.Select(metadatum => new KeyValuePair<string, string>(metadatum.Key, GetMetadataEscaped(metadatum.Key))); 1637clonedMetadata[metadatum.Key] = EscapingUtilities.UnescapeAll(metadatum.Value); 1654clonedMetadata[metadatum.Key] = metadatum.Value; 1778thisNames.Add(metadatum.Key); 1791string name = metadatum.Key; 1849SetMetadata(metadataEntry.Key, metadataEntry.Value); 1908int key = interner.Intern(metadatum.Key); 2038.Where(item => !ItemSpecModifiers.IsDerivableItemSpecModifier(item.Key)); 2060ProjectMetadataInstance.VerifyThrowReservedNameAllowItemSpecModifiers(item.Key); 2181Current = _metadataCollectionEnumerator.Current.Key; 2304IEnumerable<KeyValuePair<string, string>> projectMetadataInstances = metadataList.Select(metadatum => new KeyValuePair<string, string>(metadatum.Key.Name, metadatum.Value));
Instance\ProjectTargetInstance.cs (1)
488taskElement.SetParameter(taskParameterEntry.Key, taskParameterEntry.Value);
Instance\ProjectTaskInstance.cs (1)
240filteredParameters[parameter.Key] = parameter.Value.Item1;
Instance\TaskFactories\TaskHostTask.cs (2)
455result[kvp.Key] = kvp.Value; 642_setParameters[outputParam.Key] = outputParam.Value?.WrappedParameter;
Instance\TaskRegistry.cs (1)
658.Where(tp => RegisteredTaskIdentity.RegisteredTaskIdentityComparer.IsPartialMatch(taskIdentity, tp.Key))
Logging\BaseConsoleLogger.cs (3)
499Internal.Utilities.EnumerateProperties(properties, list, static (list, kvp) => list.Add(new DictionaryEntry(kvp.Key, kvp.Value))); 520WritePretty($"{entry.Key,-30} = "); 641WriteMetadata(metadatum.Key, metadatum.Value);
Logging\BinaryLogger\BuildEventArgsReader.cs (2)
1292kvp => kvp.Key, 1516list[i] = new DictionaryEntry(property.Key, property.Value);
Logging\BinaryLogger\BuildEventArgsWriter.cs (4)
299Write(e.BuildEnvironment?.Where(kvp => EnvironmentUtilities.IsWellKnownEnvironmentDerivedProperty(kvp.Key))); 391Write(item.Key); 1259Write(kvp.Key); 1283var (keyIndex, keyHash) = HashString(kvp.Key);
Logging\ParallelLogger\ParallelConsoleLogger.cs (10)
241WriteEnvironment(e.BuildEnvironment?.Where(kvp => EnvironmentUtilities.IsWellKnownEnvironmentDerivedProperty(kvp.Key)).ToDictionary(kvp => kvp.Key, kvp => kvp.Value)); 487if (previousEntryPoint != valuePair.Key.EntryPointContext) 490foreach (string s in _buildEventManager.ProjectCallStackFromProject(valuePair.Key.EntryPointContext)) 494previousEntryPoint = valuePair.Key.EntryPointContext; 499if (!String.Equals(previousTarget, valuePair.Key.TargetName, StringComparison.OrdinalIgnoreCase)) 502if (!string.IsNullOrEmpty(valuePair.Key.TargetName)) 504WriteMessageAligned(ResourceUtilities.FormatResourceStringStripCodeAndKeyword("ErrorWarningInTarget", valuePair.Key.TargetName), false); 506previousTarget = valuePair.Key.TargetName; 802string environmentMessage = $"{entry.Key} = {entry.Value}";
Logging\ProfilerLogger.cs (19)
148foreach (var pair in profiledResult.ProfiledLocations.OrderBy(p => p.Key.Id)) 180if (aggregatedLocations.TryGetValue(pairToMerge.Key, out existingProfiledLocation)) 186var originalKey = originalLocations[pairToMerge.Key]; 189mergeMap[pairToMerge.Key.Id] = originalKey.Id; 196if (pairToMerge.Key.ParentId.HasValue && mergeMap.TryGetValue(pairToMerge.Key.ParentId.Value, out mergedParent)) 199aggregatedLocations[pairToMerge.Key.WithParentId(mergedParent)] = pairToMerge.Value; 204aggregatedLocations[pairToMerge.Key] = pairToMerge.Value; 208if (!originalLocations.ContainsKey(pairToMerge.Key)) 210originalLocations[pairToMerge.Key] = pairToMerge.Key; 221var idTable = aggregatedLocations.ToDictionary(pair => pair.Key.Id, 222pair => new KeyValuePair<EvaluationLocation, ProfiledLocation>(pair.Key, pair.Value)); 226pair.Key.IsEvaluationPass || !IsTooSmall(pair.Value))) 228var key = prunedPair.Key; 252while (!pair.Key.IsEvaluationPass && IsTooSmall(pair.Value)) 254Debug.Assert(pair.Key.ParentId.HasValue, 256pair = idTable[pair.Key.ParentId.Value]; 259return pair.Key.Id;
src\5057ed6cf5d6323b\ImmutableSegmentedDictionary`2.cs (2)
185return TryGetValue(pair.Key, out var value) 240result[item.Key] = item.Value;
src\5057ed6cf5d6323b\ImmutableSegmentedDictionary`2+Enumerator.cs (2)
49readonly DictionaryEntry IDictionaryEnumerator.Entry => new(Current.Key, Current.Value); 51readonly object IDictionaryEnumerator.Key => Current.Key;
src\5057ed6cf5d6323b\ImmutableSegmentedDictionary`2+KeyCollection+Enumerator.cs (1)
25public readonly TKey Current => _enumerator.Current.Key;
src\5057ed6cf5d6323b\ImmutableSegmentedDictionary`2+ValueBuilder.cs (6)
119=> Add(item.Key, item.Value); 127Add(pair.Key, pair.Value); 148return TryGetValue(item.Key, out var value) 192GetOrCreateMutableDictionary().Remove(item.Key); 213if (KeyComparer.Equals(pair.Key, equalKey)) 215actualKey = pair.Key;
src\5057ed6cf5d6323b\SegmentedDictionary`2.cs (10)
210Add(pair.Key, pair.Value); 218Add(pair.Key, pair.Value); 271=> Add(keyValuePair.Key, keyValuePair.Value); 275ref var value = ref FindValue(keyValuePair.Key); 286ref var value = ref FindValue(keyValuePair.Key); 289Remove(keyValuePair.Key); 1234return new DictionaryEntry(_current.Key, _current.Value); 1237return new KeyValuePair<TKey, TValue>(_current.Key, _current.Value); 1261return new DictionaryEntry(_current.Key, _current.Value); 1274return _current.Key;
src\9f0d3f3da306d8cf\ImmutableArrayExtensions.cs (2)
1183result.Add(entry.Key, createMembers(entry.Value)); 1228dictionary.Add(entry.Key, namedTypes);
src\msbuild\artifacts\.packages\microsoft.codeanalysis.pooledobjects\5.0.0-1.25277.114\contentFiles\cs\netstandard2.0\ArrayBuilder.cs (1)
583dictionary.Add(pair.Key, pair.Value.ToImmutableAndFree());
src\msbuild\src\Shared\LogMessagePacketBase.cs (1)
300_sinkId = nodeBuildEvent.Value.Key;
src\msbuild\src\Shared\NodeEndpointOutOfProcBase.cs (6)
452$"Handshake failed. Received {result.Value} from host for {component.Key} but expected {component.Value}. Probably the host is a different MSBuild build."); 582if (component.Key == nameof(HandshakeComponents.Options)) 588else if (component.Key == nameof(HandshakeComponents.Salt)) 598isAllowedMismatch = _versionHandshakeGroup.Contains(component.Key) && component.Value == Handshake.NetTaskHostHandshakeVersion; 603CommunicationsUtilities.Trace($"Handshake for NET Host. Child host {handshakePart} for {component.Key}."); 608$"Handshake failed. Received {handshakePart} from host for {component.Key} but expected {component.Value}. Probably the host is a different MSBuild build.");
src\msbuild\src\Shared\TaskHostBuildResponse.cs (2)
70dict[entry.Key] = (ITaskItem[]?)entry.Value?.WrappedParameter ?? []; 101dict[entry.Key] = new TaskParameter(entry.Value);
src\msbuild\src\Shared\TaskHostConfiguration.cs (1)
237_taskParameters[parameter.Key] = new TaskParameter(parameter.Value);
src\msbuild\src\Shared\TaskHostTaskComplete.cs (1)
129_taskOutputParameters[parameter.Key] = new TaskParameter(parameter.Value);
src\msbuild\src\Shared\TaskParameter.cs (6)
800.Where(metadatum => string.IsNullOrEmpty(destinationItem.GetMetadata(metadatum.Key))); 816string value = destinationItem.GetMetadata(entry.Key); 820destinationItem.SetMetadata(entry.Key, entry.Value); 848clonedMetadata.Add(metadatum.Key, EscapingUtilities.UnescapeAll(metadatum.Value)); 946var unescaped = new KeyValuePair<string, string>(kvp.Key, EscapingUtilities.UnescapeAll(kvp.Value)); 955SetMetadata(kvp.Key, kvp.Value);
src\msbuild\src\Shared\Tracing.cs (3)
97Slot(tag, $"{value.Key}={value.Key}"); 150Trace.WriteLine("# " + count.Key + "=" + count.Value);
src\msbuild\src\Shared\TypeLoader.cs (1)
550if (typeName.Length == 0 || IsPartialTypeNameMatch(desiredTypeInAssembly.Key, typeName))
TelemetryInfra\InternalTelemetryConsumingLogger.cs (6)
54Console.WriteLine($"{target.Key} : {target.Value}"); 60foreach (var task in _workerNodeTelemetryData.TasksExecutionData.Where(t => t.Key.IsCustom)) 62Console.WriteLine($"{task.Key}"); 69Console.WriteLine($"{task.Key} - {task.Value.CumulativeExecutionTime}"); 76Console.WriteLine($"{task.Key} - {task.Value.TotalMemoryBytes / 1024.0:0.00}kB"); 83Console.WriteLine($"{task.Key} - {task.Value.ExecutionsCount}");
Utilities\Utilities.cs (3)
585string environmentVariableName = environmentVariable.Key; 716yield return new(kvp.Key, kvp.Value); 720yield return new(keyTimeSpanValue.Key, keyTimeSpanValue.Value.Ticks.ToString());
Microsoft.Build.Framework (56)
BackEnd\CommunicationsUtilities.cs (1)
360if (!right.TryGetValue(entry.Key, out string? otherValue)
BackEnd\TranslatorHelpers.cs (1)
213string key = kvp.Key;
BinaryTranslator.cs (9)
1488string key = pair.Key; 1500string key = pair.Key; 1520string key = pair.Key; 1543K key = pair.Key; 1568K key = pair.Key; 1589string key = pair.Key; 1611string key = pair.Key; 1633string key = pair.Key; 1656string key = kvp.Key;
BinaryWriterExtensions.cs (2)
128writer.Write(kvp.Key); 139writer.Write(kvp.Key);
BuildCheck\EnumerableExtensions.cs (3)
91if (!dict.TryGetValue(pair.Key, out TValue? value)) 93dict[pair.Key] = pair.Value; 97dict[pair.Key] = mergeValues(value, pair.Value);
BuildException\BuildExceptionBase.cs (1)
106writer.Write(pair.Key);
BuildSubmissionStartedEventArgs.cs (1)
58writer.Write((string)entry.Key);
Collections\CopyOnWriteDictionary.cs (3)
258_backing = _backing.SetItem(item.Key, item.Value); 292_backing = _backing.Remove(item.Key); 376array.SetValue(new DictionaryEntry(entry.Key, entry.Value), index + i);
DotnetHostEnvironmentHelper.cs (2)
128environment.Remove(kvp.Key); 132environment[kvp.Key] = kvp.Value;
ImmutableDictionaryExtensions.cs (2)
36verifyThrowKey(item.Key); 39builder[item.Key] = item.Value ?? string.Empty;
MultiThreadedTaskEnvironmentDriver.cs (2)
112_environmentVariables[entry.Key] = entry.Value; 127startInfo.EnvironmentVariables[kvp.Key] = kvp.Value;
MutableTaskItem.cs (1)
36destinationItem.SetMetadata(metadatum.Key, metadatum.Value);
Sdk\SdkResultItem.cs (2)
45return Metadata.All(m => item.Metadata.TryGetValue(m.Key, out var itemValue) && itemValue == m.Value); 59hashCode ^= StringComparer.OrdinalIgnoreCase.GetHashCode(kvp.Key) * (StringComparer.OrdinalIgnoreCase.GetHashCode(kvp.Value ?? "V") + 1);
TaskItemData.cs (1)
44dictionary.Add(item.Key, item.Value);
TaskParameterEventArgs.cs (1)
257writer.Write(kvp.Key);
Telemetry\DiagnosticActivity.cs (1)
31_ = SetTag(tag.Key, tag.Value);
Telemetry\TelemetryDataUtils.cs (17)
68string targetName = ShouldHashKey(valuePair.Key) ? GetHashed(valuePair.Key.Name) : valuePair.Key.Name; 73valuePair.Key.IsCustom, 74valuePair.Key.IsNuget, 75valuePair.Key.IsMetaProj, 96string taskName = valuePair.Key.IsCustom ? GetHashed(valuePair.Key.Name) : valuePair.Key.Name; 104valuePair.Key.IsCustom, 105valuePair.Key.IsNuget, 249GetTargetInfo(kv.Key, isExecuted: false).Increment(kv.Key); 254GetTargetInfo(kv.Key, isExecuted: true).Increment(kv.Key); 305var taskInfo = kv.Key.IsCustom ? CustomTasksInfo : BuiltinTasksInfo; 308if (kv.Key.IsNuget)
Telemetry\WorkerNodeTelemetryData.cs (2)
24AddTask(task.Key, task.Value.CumulativeExecutionTime, task.Value.ExecutionsCount, task.Value.TotalMemoryBytes, task.Value.TaskFactoryName, task.Value.TaskHostRuntime); 29AddTarget(target.Key, target.Value.WasExecuted, target.Value.SkipReason);
Telemetry\WorkerNodeTelemetryEventArgs.cs (2)
23WriteToStream(writer, entry.Key); 34WriteToStream(writer, entry.Key);
TelemetryEventArgs.cs (1)
41writer.Write(kvp.Key);
Utilities\CollectionHelpers.cs (1)
66if (!b.TryGetValue(aKvp.Key, out var bValue))
Microsoft.Build.Tasks.CodeAnalysis (4)
src\roslyn\src\Compilers\Shared\BuildProtocol.cs (1)
378WriteLengthPrefixedString(writer, pair.Key);
src\roslyn\src\Compilers\Shared\BuildServerConnection.cs (3)
480foreach (var kvp in environmentVariables.OrderBy(kvp => kvp.Key, StringComparer.OrdinalIgnoreCase)) 482envBlock.Append(kvp.Key); 647startInfo.EnvironmentVariables[kvp.Key] = kvp.Value;
Microsoft.Build.Tasks.Core (64)
AssemblyDependency\GenerateBindingRedirects.cs (11)
101new XAttribute("name", redirect.Key.Name), 102new XAttribute("publicKeyToken", ResolveAssemblyReference.ByteArrayToString(redirect.Key.GetPublicKeyToken())), 103new XAttribute("culture", String.IsNullOrEmpty(redirect.Key.CultureName) ? "neutral" : redirect.Key.CultureName)), 286if (IsMatch(entry.Key, nameValue, cultureValue, publicKeyTokenValue)) 294var newName = entry.Key.Name; 295var newCulture = entry.Key.CultureName; 296var newPublicKeyToken = entry.Key.GetPublicKeyToken(); 297var newProcessorArchitecture = entry.Key.ProcessorArchitecture; 318redirects.Remove(entry.Key); 320Log.LogWarningWithCodeFromResources("GenerateBindingRedirects.OverlappingBindingRedirect", entry.Key.ToString(), bindingRedirect.ToString());
AssemblyDependency\ReferenceTable.cs (8)
1423AssemblyNameExtension assemblyName = assembly.Key; 1591return assembly.Key; 1811AddReference(newEntry.Key, newEntry.Value); 1829ResolveReference(assembly.Key, null, reference); 2220AssemblyNameExtension assemblyName = assemblyNameWithReference.Key; 2249toRemove.Add(kvp.Key); 2630AssemblyNameExtension assemblyName = kvp.Key; 3109AssemblyNameExtension assemblyName = assembly.Key;
AssemblyDependency\ResolveAssemblyReference.cs (3)
1250AssemblyNameExtension assemblyName = assembly.Key; 1263AssemblyNameExtension assemblyName = assembly.Key; 1276AssemblyNameExtension assemblyName = assembly.Key;
BootstrapperUtil\BootstrapperBuilder.cs (4)
234resourceUpdater.AddStringResource(44, de.Key, data); 1531eulaAttribute.Value = eulaInfo.Key; 1870results?.AddMessage(BuildMessage.CreateMessage(BuildMessageSeverity.Warning, "GenerateBootstrapper.UsingResourcesCulture", ci.Name, altCulturePair.Key)); 1872GetCodePage(altCulturePair.Key, ref codepage);
CreateItem.cs (4)
118if ((!PreserveExistingMetadata) || String.IsNullOrEmpty(newItem.GetMetadata(nameAndValue.Key))) 120if (ItemSpecModifiers.IsItemSpecModifier(nameAndValue.Key)) 123Log.LogErrorWithCodeFromResources("CreateItem.AdditionalMetadataError", nameAndValue.Key); 127newItem.SetMetadata(nameAndValue.Key, nameAndValue.Value);
GetInstalledSDKLocations.cs (2)
174string sdkInfo = ResourceUtilities.FormatResourceStringIgnoreCodeAndKeyword("GetInstalledSDKs.SDKNameAndLocation", sdk.Key, sdk.Value.Item1); 178item.SetMetadata("SDKName", sdk.Key);
GetSDKReferenceFiles.cs (1)
622if (FileUtilities.EnsureTrailingSlash(directoryToFileList.Key).StartsWith(FileUtilities.EnsureTrailingSlash(redistFilePath), StringComparison.OrdinalIgnoreCase))
MSBuild.cs (3)
557if (!additionalProjectPropertiesTable.ContainsKey(entry.Key)) 559combinedTable.Add(entry.Key, entry.Value); 566combinedTable.Add(entry.Key, entry.Value);
ResolveSDKReference.cs (8)
1046if (!FrameworkIdentitiesFromManifest.ContainsKey(kvp.Key)) 1048FrameworkIdentitiesFromManifest.Add(kvp.Key, kvp.Value); 1063if (!AppxLocationsFromManifest.ContainsKey(kvp.Key)) 1065AppxLocationsFromManifest.Add(kvp.Key, kvp.Value); 1352if (!String.IsNullOrEmpty(appxLocation.Key)) 1354string[] appxComponents = appxLocation.Key.Split(s_appxSplitChar, StringSplitOptions.RemoveEmptyEntries).Select(x => x.Trim()).ToArray(); 1396AddStatusMessage("ResolveSDKReference.FoundAppxLocation", appxLocation.Key + "=" + appxLocation.Value); 1410appxLocationComponents.Add(location.Key);
RoslynCodeTaskFactory\RoslynCodeTaskFactory.cs (1)
547taskInfo.CodeLanguage = validLanguage.Key;
src\msbuild\src\Shared\AssemblyFolders\AssemblyFoldersEx.cs (1)
438versionStrings.Add(new ExtensionFoldersRegistryKey(s, entry.Key));
src\msbuild\src\Shared\LogMessagePacketBase.cs (1)
300_sinkId = nodeBuildEvent.Value.Key;
src\msbuild\src\Shared\NodePipeClient.cs (1)
83CommunicationsUtilities.Trace($"Writing handshake part {component.Key} ({component.Value}) to pipe {PipeName}");
src\msbuild\src\Shared\TaskParameter.cs (6)
800.Where(metadatum => string.IsNullOrEmpty(destinationItem.GetMetadata(metadatum.Key))); 816string value = destinationItem.GetMetadata(entry.Key); 820destinationItem.SetMetadata(entry.Key, entry.Value); 848clonedMetadata.Add(metadatum.Key, EscapingUtilities.UnescapeAll(metadatum.Value)); 946var unescaped = new KeyValuePair<string, string>(kvp.Key, EscapingUtilities.UnescapeAll(kvp.Value)); 955SetMetadata(kvp.Key, kvp.Value);
src\msbuild\src\Shared\Tracing.cs (3)
97Slot(tag, $"{value.Key}={value.Key}"); 150Trace.WriteLine("# " + count.Key + "=" + count.Value);
system.design\stronglytypedresourcebuilder.cs (5)
156resourceTypes.Add(resource.Key, data); 269String propertyName = entry.Key; 758String key = entry.Key; 828skippedResources.Add(new SkippedResource(alreadyAddedOriginalName, SkipReason.NameCollision, [entry.Key])); 835skippedResources.Add(new SkippedResource(entry.Key, SkipReason.NameCollision, [alreadyAddedOriginalName]));
SystemState.cs (2)
618string relativePath = kvp.Key; 647instanceLocalOutgoingFileStateCache = instanceLocalFileStateCache.ToDictionary(kvp => FileUtilities.MakeRelative(Path.GetDirectoryName(stateFile), kvp.Key), kvp => kvp.Value);
Microsoft.Build.Tasks.Git (17)
GitDataReader\GitConfig.cs (4)
92if (variable.Key.SectionNameEquals(ExtensionsSectionName) && 93!s_knownExtensions.Contains(variable.Key.VariableName, StringComparer.OrdinalIgnoreCase)) 96Resources.UnsupportedRepositoryExtension, variable.Key.VariableName, string.Join(", ", s_knownExtensions))); 104=> Variables.Select(kvp => new KeyValuePair<string, ImmutableArray<string>>(kvp.Key.ToString(), kvp.Value));
GitDataReader\GitConfig.Reader.cs (2)
85return new GitConfig(variables.ToImmutableDictionary(kvp => kvp.Key, kvp => kvp.Value.ToImmutableArray())); 95return new GitConfig(variables.ToImmutableDictionary(kvp => kvp.Key, kvp => kvp.Value.ToImmutableArray()));
GitDataReader\GitRepository.cs (4)
294Where(kvp => kvp.Key.SectionNameEquals("submodule")). 295GroupBy(kvp => kvp.Key.SubsectionName, GitVariableName.SubsectionNameComparer). 304if (variable.Key.VariableNameEquals("path")) 308else if (variable.Key.VariableNameEquals("url"))
GitOperations.cs (7)
98Where(kvp => kvp.Key.SectionNameEquals(RemoteSectionName) && kvp.Key.VariableNameEquals(UrlVariableName)). 99OrderBy(kvp => kvp.Key.SubsectionName, GitVariableName.SubsectionNameComparer). 102remoteName = remoteVariable.Key.SubsectionName; 124if (variable.Key.SectionNameEquals(UrlSectionName) && 125variable.Key.VariableNameEquals("insteadOf")) 132replacement = variable.Key.SubsectionName;
Microsoft.Build.Utilities.Core (27)
MuxLogger.cs (2)
865Traits.LogAllEnvironmentVariables ? _buildStartedEvent.BuildEnvironment : _buildStartedEvent.BuildEnvironment?.Where(kvp => EnvironmentUtilities.IsWellKnownEnvironmentDerivedProperty(kvp.Key)).ToDictionary(kvp => kvp.Key, kvp => kvp.Value));
src\msbuild\src\Shared\AssemblyFolders\AssemblyFoldersEx.cs (1)
438versionStrings.Add(new ExtensionFoldersRegistryKey(s, entry.Key));
src\msbuild\src\Shared\Tracing.cs (3)
97Slot(tag, $"{value.Key}={value.Key}"); 150Trace.WriteLine("# " + count.Key + "=" + count.Value);
TaskItem.cs (9)
423copiedMetadata = destinationMetadata.SetItems(_metadata.Where(entry => !destinationMetadata.TryGetValue(entry.Key, out string val) || String.IsNullOrEmpty(val))); 440.Where(metadatum => string.IsNullOrEmpty(destinationAsITaskItem2.GetMetadataValueEscaped(metadatum.Key))); 461value = destinationAsITaskItem2.GetMetadataValueEscaped(entry.Key); 465destinationAsITaskItem2.SetMetadata(entry.Key, entry.Value); 470value = destinationItem.GetMetadata(entry.Key); 474destinationItem.SetMetadata(entry.Key, EscapingUtilities.Escape(entry.Value)); 514dictionary.Add(entry.Key, EscapingUtilities.UnescapeAll(entry.Value)); 619_metadata = _metadata.SetItems(metadata.Select(kvp => new KeyValuePair<string, string>(kvp.Key, kvp.Value ?? string.Empty))); 652var unescaped = new KeyValuePair<string, string>(kvp.Key, EscapingUtilities.UnescapeAll(kvp.Value));
ToolLocationHelper.cs (8)
410extensionSDKs[extension.Key] = extension.Value; 457extensionSDKsAndVersions[extension.Key] = Tuple.Create<string, string>(extension.Value, moniker.TargetPlatformVersion.ToString()); 627ExtensionSDK extensionSDK = new ExtensionSDK(sdk.Key, sdk.Value); 632filteredExtensionSdks.Add(sdk.Key, sdk.Value); 2614if (rootPathWithIdentifier.Name.Equals(uapDirectoryName, StringComparison.OrdinalIgnoreCase) && directoryUnderRoot.Key.Major == uapVersion) 2616platformSDKKey = new TargetPlatformSDK(uapRegistryName, directoryUnderRoot.Key, null); 2620platformSDKKey = new TargetPlatformSDK(rootPathWithIdentifier.Name, directoryUnderRoot.Key, null); 2719TargetPlatformSDK platformSDKKey = new TargetPlatformSDK(platformIdentifier, registryVersions.Key, null);
ToolTask.cs (4)
695startInfo.Environment[entry.Key] = entry.Value; 705startInfo.Environment[variable.Key] = variable.Value; 1625alreadyLoggedEnvironmentHeader = LogEnvironmentVariable(alreadyLoggedEnvironmentHeader, entry.Key, entry.Value); 1635alreadyLoggedEnvironmentHeader = LogEnvironmentVariable(alreadyLoggedEnvironmentHeader, variable.Key, variable.Value);
Microsoft.CodeAnalysis (145)
CodeGen\CompilationTestData.cs (2)
60return Methods.Single(p => predicate(p.Key)).Value.ILBuilder; 71var name = GetMethodName(pair.Key);
CodeGen\PrivateImplementationDetails.cs (5)
180_orderedSynthesizedMethods = _synthesizedMethods.OrderBy(kvp => kvp.Key).Select(kvp => kvp.Value).AsImmutable(); 183_orderedNestedTypes = _dataFieldTypes.OrderBy(kvp => kvp.Key.Size).ThenBy(kvp => kvp.Key.Alignment).Select(kvp => kvp.Value).OfType<ExplicitSizeStruct>() 184.Concat<Cci.INestedTypeDefinition>(_dataSectionStringLiteralTypes.OrderBy(kvp => kvp.Key).Select(kvp => kvp.Value)).AsImmutable(); 441return _instrumentationPayloadRootFields.OrderBy(analysis => analysis.Key);
CodeGen\SwitchIntegralJumpTableEmitter.cs (5)
116if (sortedCaseLabels[0].Key != ConstantValue.Null) 148ConstantValue firstConstant = first.Key; 149ConstantValue secondConstant = second.Key; 334ConstantValue constant = c.Key; 393ConstantValue caseLabelConstant = switchBucket[nextCaseIndex].Key;
CodeGen\SwitchIntegralJumpTableEmitter.SwitchBucket.cs (4)
152!IsContiguous(lastConst, switchLabel.Key)) 164lastConst = switchLabel.Key; 249return _allLabels[_startLabelIndex].Key; 257return _allLabels[_endLabelIndex].Key;
CodeGen\SwitchStringJumpTableEmitter.cs (3)
129_builder.MarkLabel(hashBucketLabelsMap[kvPair.Key]); 174this.EmitCondBranchForStringSwitch(kvPair.Key, kvPair.Value); 200ConstantValue stringConstant = kvPair.Key;
Collections\Grouping.cs (1)
28: this(pair.Key, pair.Value)
Collections\SmallDictionary.cs (1)
57this.Add(kv.Key, kv.Value);
CommandLine\AnalyzerConfigSet.cs (1)
559var result = dict.ToImmutableDictionary(d => d.Key, d => d.Value.value, Section.PropertiesKeyComparer);
CommandLine\CommandLineParser.cs (2)
1408=> pathMap.Sort((x, y) => -x.Key.Length.CompareTo(y.Key.Length));
CommandLine\ReportAnalyzerUtil.cs (3)
83.GroupBy(kvp => kvp.Key.GetType().Assembly) 97var analyzerIds = string.Join(", ", GetSupportedIds(kvp.Key).Distinct().OrderBy(id => id)); 98var analyzerNameColumn = $" {kvp.Key} ({analyzerIds})";
CommandLine\SarifErrorLogger.cs (2)
106foreach (var pair in diagnostic.Properties.OrderBy(x => x.Key, StringComparer.Ordinal)) 108_writer.Write(pair.Key, pair.Value);
CommandLine\SarifV1ErrorLogger.cs (4)
160_writer.WriteObjectStart(pair.Key); // rule 293list.Add(new KeyValuePair<string, DiagnosticDescriptor>(pair.Value, pair.Key)); 297list.Sort((x, y) => string.CompareOrdinal(x.Key, y.Key));
CommandLine\SarifV2ErrorLogger.cs (1)
505list.Add((pair.Value.Index, pair.Key, pair.Value.Info));
Compilation\CompilationOptions.cs (2)
642this.SpecificDiagnosticOptions.SequenceEqual(other.SpecificDiagnosticOptions, (left, right) => (left.Key == right.Key) && (left.Value == right.Value)) &&
Compilation\ParseOptions.cs (1)
195value = Hash.Combine(kv.Key.GetHashCode(),
CvtRes.cs (4)
705ushort cbBlock = SizeofVerString(keyValuePair.Key, keyValuePair.Value); 706int cbKey = (keyValuePair.Key.Length + 1) * 2; // includes terminating NUL 715writer.Write(keyValuePair.Key.ToCharArray()); 748sum += SizeofVerString(verString.Key, verString.Value);
DiagnosticAnalyzer\AnalysisResult.cs (2)
122if (excludedAnalyzers.Contains(diagnosticsByAnalyzer.Key)) 139if (excludedAnalyzers.Contains(diagnosticsByAnalyzer.Key))
DiagnosticAnalyzer\AnalysisResultBuilder.cs (5)
549var key = diagnosticsByTree.Key; 552if (analyzers.Contains(diagnosticsByAnalyzer.Key)) 557perTreeBuilder.Add(diagnosticsByAnalyzer.Key, diagnostics); 588if (analyzers.Contains(diagnosticsByAnalyzer.Key)) 593builder.Add(diagnosticsByAnalyzer.Key, diagnostics);
DiagnosticAnalyzer\AnalyzerAssemblyLoader.cs (1)
396return _resolvedToOriginalPathMap.Select(x => (x.Value, x.Key)).ToImmutableArray();
DiagnosticAnalyzer\AnalyzerExecutor.cs (1)
234return _analyzerExecutionTimeMap.ToImmutableDictionary(pair => pair.Key, pair => TimeSpan.FromTicks(pair.Value.Value));
DiagnosticAnalyzer\AnalyzerFileReference.cs (1)
257return typeNameMap.ToImmutableSortedDictionary(g => g.Key, g => g.Value.ToImmutable(), StringComparer.OrdinalIgnoreCase);
DocumentationComments\DocumentationCommentIncludeCache.cs (1)
70return resolvedPath == pathAndDocument.Key;
Emit\CommonPEModuleBuilder.cs (2)
1070builder.Add(entry.Key, entry.Value.GetAllMembers()); 1078builder.Add(entry.Key, entry.Value.ToImmutableArray<ISymbolInternal>());
Emit\EditAndContinue\DeltaMetadataWriter.cs (3)
195addedOrChangedMethodsByIndex.Add(MetadataTokens.GetRowNumber(GetMethodDefinitionHandle(pair.Key)), pair.Value); 266result.Add(pair.Key, pair.Value); 289result[pair.Key] = pair.Value;
Emit\EditAndContinue\SymbolChanges.cs (2)
470keySelector: static e => e.Key, 474keySelector: static e => e.Key,
Emit\EditAndContinue\SymbolMatcher.cs (2)
81var key = (K?)MapDefinition(pair.Key); 101result.Add(pair.Key, pair.Value.MapTypes(this));
FileSystem\PathUtilities.cs (1)
740var oldPrefix = kv.Key;
InternalUtilities\ConcurrentLruCache.cs (1)
55this.UnsafeAdd(kvp.Key, kvp.Value, true);
InternalUtilities\ConcurrentSet.cs (2)
125public T Current => _kvpEnumerator.Current.Key; 157yield return kvp.Key;
InternalUtilities\ImmutableSetWithInsertionOrder`1.cs (1)
124get { return _map.OrderBy(kv => kv.Value).Select(kv => kv.Key); }
MetadataReader\MetadataHelpers.cs (4)
913names[nestedNamespaces[i].Key] = i; 921int keyIndex = names[pair.Key]; 926nestedNamespaces[keyIndex] = KeyValuePair.Create(primaryPair.Key, primaryPair.Value.Concat(pair.Value)); 931int removed = nestedNamespaces.RemoveAll(pair => (object)pair.Key == null);
MetadataReader\PEModule.cs (4)
687result.Add(new Grouping<string, TypeDefinitionHandle>(pair.Key, pair.Value ?? SpecializedCollections.EmptyEnumerable<TypeDefinitionHandle>())); 777string @namespace = MetadataReader.GetString(kvp.Key); 1415if (namedArgValues is ({ Key: "IsOptional" }, isProperty: true, typeCode: SerializationTypeCode.Boolean, _)) 1577switch (namedArgValues.nameValuePair.Key)
MetadataReference\AssemblyIdentityMap.cs (3)
43AssemblyIdentity currentIdentity = sameName[i].Key; 59if (minHigherVersionCandidate == -1 || currentIdentity.Version < sameName[minHigherVersionCandidate].Key.Version) 84AssemblyIdentity currentIdentity = sameName[i].Key;
NativePdbWriter\PdbWriter.cs (2)
734GetDocumentIndex(kvp.Key), 782.OrderBy(kvp => kvp.Key))
Operations\ControlFlowGraphBuilder.ImplicitInstanceInfo.cs (1)
70AnonymousTypePropertyValues.Add(pair.Key, pair.Value);
PEWriter\MetadataWriter.cs (2)
1127return existing.Key; 1276return existing.Key;
PEWriter\MetadataWriter.DynamicAnalysis.cs (1)
312var blob = entry.Key;
PEWriter\MetadataWriter.PortablePdb.cs (1)
796.OrderBy(kvp => kvp.Key))
ReferenceManager\CommonReferenceManager.State.cs (2)
682return ReferencedAssembliesMap.Select(ra => KeyValuePair.Create(ra.Key, (IAssemblySymbolInternal)ReferencedAssemblies[ra.Value])); 706return entry.Key;
RuleSet\RuleSet.cs (8)
93specificOptions[item.Key] = action; 157if (effectiveSpecificOptions.TryGetValue(item.Key, out var value)) 161effectiveSpecificOptions[item.Key] = item.Value; 166effectiveSpecificOptions.Add(item.Key, item.Value); 175if (effectiveSpecificOptions.ContainsKey(item.Key)) 177effectiveSpecificOptions[item.Key] = item.Value; 181effectiveSpecificOptions.Add(item.Key, item.Value); 310diagnosticOptions.Add(rule.Key, rule.Value);
RuleSet\RuleSetProcessor.cs (1)
113var ruleId = rule.Key;
SourceGeneration\Nodes\GeneratorRunStateTable.cs (1)
68resultBuilder.Add(stepsByName.Key, stepsByName.Value.ToImmutableArrayOrEmpty());
SourceGeneration\Nodes\StateTableStore.cs (1)
55SegmentedCollectionsMarshal.GetValueRefOrNullRef(_tableBuilder, kvp.Key) = cachedValue;
src\roslyn\src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (2)
833result.Add(entry.Key, createMembers(entry.Value)); 878dictionary.Add(entry.Key, namedTypes);
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (2)
185return TryGetValue(pair.Key, out var value) 240result[item.Key] = item.Value;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Enumerator.cs (2)
49readonly DictionaryEntry IDictionaryEnumerator.Entry => new(Current.Key, Current.Value); 51readonly object IDictionaryEnumerator.Key => Current.Key;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+KeyCollection+Enumerator.cs (1)
25public readonly TKey Current => _enumerator.Current.Key;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueBuilder.cs (6)
119=> Add(item.Key, item.Value); 127Add(pair.Key, pair.Value); 148return TryGetValue(item.Key, out var value) 192GetOrCreateMutableDictionary().Remove(item.Key); 213if (KeyComparer.Equals(pair.Key, equalKey)) 215actualKey = pair.Key;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (10)
210Add(pair.Key, pair.Value); 218Add(pair.Key, pair.Value); 271=> Add(keyValuePair.Key, keyValuePair.Value); 275ref var value = ref FindValue(keyValuePair.Key); 286ref var value = ref FindValue(keyValuePair.Key); 289Remove(keyValuePair.Key); 1234return new DictionaryEntry(_current.Key, _current.Value); 1237return new KeyValuePair<TKey, TValue>(_current.Key, _current.Value); 1261return new DictionaryEntry(_current.Key, _current.Value); 1274return _current.Key;
src\roslyn\src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
650dictionary.Add(pair.Key, pair.Value.ToImmutableAndFree());
Symbols\Attributes\CommonAttributeData.cs (6)
182if (string.Equals(namedArguments[i].Key, name, StringComparison.Ordinal)) 450if (namedArg.Key == "MethodCodeType") 506switch (namedArg.Key) 522messageProvider.ReportInvalidNamedArgument(arguments.Diagnostics, arguments.AttributeSyntaxOpt, position, attribute.AttributeClass, namedArg.Key); 535messageProvider.ReportInvalidNamedArgument(arguments.Diagnostics, arguments.AttributeSyntaxOpt, position, attribute.AttributeClass, namedArg.Key); 545messageProvider.ReportInvalidNamedArgument(arguments.Diagnostics, arguments.AttributeSyntaxOpt, position, attribute.AttributeClass, namedArg.Key);
Symbols\Attributes\CommonAttributeDataComparer.cs (4)
82if (arg.Key != null) 84hash = hashCombine(arg.Key.GetHashCode(), hash, _considerNamedArgumentsOrder); 145bool equals = pair1.Key == pair2.Key && TypedConstantComparer.IgnoreAll.Equals(pair1.Value, pair2.Value);
Symbols\Attributes\MarshalAsAttributeDecoder.cs (13)
128switch (namedArg.Key) 134messageProvider.ReportInvalidNamedArgument(arguments.Diagnostics, arguments.AttributeSyntaxOpt, position, arguments.Attribute.AttributeClass, namedArg.Key); 150messageProvider.ReportInvalidNamedArgument(arguments.Diagnostics, arguments.AttributeSyntaxOpt, position, arguments.Attribute.AttributeClass, namedArg.Key); 184switch (namedArg.Key) 190messageProvider.ReportInvalidNamedArgument(arguments.Diagnostics, arguments.AttributeSyntaxOpt, position, arguments.Attribute.AttributeClass, namedArg.Key); 219switch (namedArg.Key) 230messageProvider.ReportInvalidNamedArgument(arguments.Diagnostics, arguments.AttributeSyntaxOpt, position, arguments.Attribute.AttributeClass, namedArg.Key); 240messageProvider.ReportInvalidNamedArgument(arguments.Diagnostics, arguments.AttributeSyntaxOpt, position, arguments.Attribute.AttributeClass, namedArg.Key); 255messageProvider.ReportInvalidNamedArgument(arguments.Diagnostics, arguments.AttributeSyntaxOpt, position, arguments.Attribute.AttributeClass, namedArg.Key); 308switch (namedArg.Key) 314messageProvider.ReportInvalidNamedArgument(arguments.Diagnostics, arguments.AttributeSyntaxOpt, position, arguments.Attribute.AttributeClass, namedArg.Key); 376switch (namedArg.Key) 382messageProvider.ReportInvalidNamedArgument(arguments.Diagnostics, arguments.AttributeSyntaxOpt, position, arguments.Attribute.AttributeClass, namedArg.Key);
Syntax\SyntaxNodeExtensions_Tracking.cs (1)
220_idToNodeMap = map.ToImmutableSegmentedDictionary(kv => kv.Key, kv => (IReadOnlyList<SyntaxNode>)ImmutableArray.CreateRange(kv.Value));
Microsoft.CodeAnalysis.Analyzers (67)
MetaAnalyzers\CompareSymbolsCorrectlyAnalyzer.cs (1)
361return builder.ToImmutableDictionary(kvp => kvp.Key, kvp => kvp.Value.ToImmutable());
MetaAnalyzers\CompilerExtensionTargetFrameworkAnalyzer.cs (1)
79displayName = appliedTargetFrameworkAttribute.NamedArguments.FirstOrDefault(arg => arg.Key == nameof(TargetFrameworkAttribute.FrameworkDisplayName)).Value.Value as string
MetaAnalyzers\DiagnosticDescriptorCreationAnalyzer.cs (1)
464var ruleId = kvp.Key;
MetaAnalyzers\Fixers\AnalyzerReleaseTrackingFix.FixAllProvider.cs (2)
67var projectIds = diagnosticsToFix.SelectAsArray(d => d.Key.Id); 96Project project = pair.Key;
MetaAnalyzers\Fixers\DefineDiagnosticDescriptorArgumentsCorrectlyFix.CustomFixAllProvider.cs (2)
103var project = kvp.Key; 128var additionalDocument = kvp.Key;
MetaAnalyzers\SymbolIsBannedInAnalyzersAnalyzer.cs (1)
116return result.ToDictionary(kvp => kvp.Key, kvp => kvp.Value.ToImmutableArray());
src\b310f676f7308b7f\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (1)
241foreach (var (symbol, write) in SymbolsWriteBuilder.SelectAsArray(kvp => !kvp.Value, kvp => kvp.Key))
src\roslyn\src\Compilers\Core\Portable\Collections\SmallDictionary.cs (1)
57this.Add(kv.Key, kv.Value);
src\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (1)
740var oldPrefix = kv.Key;
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\ConcurrentSet.cs (2)
125public T Current => _kvpEnumerator.Current.Key; 157yield return kvp.Key;
src\roslyn\src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (2)
833result.Add(entry.Key, createMembers(entry.Value)); 878dictionary.Add(entry.Key, namedTypes);
src\roslyn\src\Dependencies\Collections\Extensions\KeyValuePairExtensions.cs (1)
17key = keyValuePair.Key;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (2)
185return TryGetValue(pair.Key, out var value) 240result[item.Key] = item.Value;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Enumerator.cs (2)
49readonly DictionaryEntry IDictionaryEnumerator.Entry => new(Current.Key, Current.Value); 51readonly object IDictionaryEnumerator.Key => Current.Key;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+KeyCollection+Enumerator.cs (1)
25public readonly TKey Current => _enumerator.Current.Key;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueBuilder.cs (6)
119=> Add(item.Key, item.Value); 127Add(pair.Key, pair.Value); 148return TryGetValue(item.Key, out var value) 192GetOrCreateMutableDictionary().Remove(item.Key); 213if (KeyComparer.Equals(pair.Key, equalKey)) 215actualKey = pair.Key;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (10)
210Add(pair.Key, pair.Value); 218Add(pair.Key, pair.Value); 271=> Add(keyValuePair.Key, keyValuePair.Value); 275ref var value = ref FindValue(keyValuePair.Key); 286ref var value = ref FindValue(keyValuePair.Key); 289Remove(keyValuePair.Key); 1234return new DictionaryEntry(_current.Key, _current.Value); 1237return new KeyValuePair<TKey, TValue>(_current.Key, _current.Value); 1261return new DictionaryEntry(_current.Key, _current.Value); 1274return _current.Key;
src\roslyn\src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
650dictionary.Add(pair.Key, pair.Value.ToImmutableAndFree());
src\roslyn\src\RoslynAnalyzers\Microsoft.CodeAnalysis.BannedApiAnalyzers\Core\SymbolIsBannedAnalyzerBase.cs (2)
220if (!kvp.Key.SymbolName.EndsWith("Attribute", StringComparison.InvariantCulture) && 221!kvp.Key.ContainerName.EndsWith("Attribute", StringComparison.InvariantCulture))
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\SymbolNamesWithValueOption.cs (7)
139wildcardNamesBuilder.ToImmutableDictionaryAndFree(x => x.Key, x => x.Value.ToImmutableDictionaryAndFree(), wildcardNamesBuilder.Comparer)); 311names.FirstOrDefault(kvp => symbolDeclarationId.StartsWith(kvp.Key, StringComparison.Ordinal)) is var prefixedFirstMatchOrDefault && 312!string.IsNullOrWhiteSpace(prefixedFirstMatchOrDefault.Key)) 321value.FirstOrDefault(kvp => symbolDeclarationId.StartsWith(kvp.Key, StringComparison.Ordinal)) is var unprefixedFirstMatchOrDefault && 322!string.IsNullOrWhiteSpace(unprefixedFirstMatchOrDefault.Key)) 331allKindsValue.FirstOrDefault(kvp => symbol.Name.StartsWith(kvp.Key, StringComparison.Ordinal)) is var partialFirstMatchOrDefault && 332!string.IsNullOrWhiteSpace(partialFirstMatchOrDefault.Key))
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledConcurrentDictionary.cs (1)
81var added = instance.TryAdd(kvp.Key, kvp.Value);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledConcurrentSet.cs (2)
122yield return kvp.Key; 152public T Current => _kvpEnumerator.Current.Key;
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledDictionary.cs (1)
81instance.Add(kvp.Key, kvp.Value);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (2)
77foreach (var kvp in ruleset.SpecificDiagnosticOptions.OrderBy(kvp => kvp.Key)) 79var id = kvp.Key;
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\SmallDictionary.cs (1)
59this.Add(kv.Key, kv.Value);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageResult.cs (4)
48=> SymbolWritesMap.SelectAsArray(kvp => !kvp.Value, kvp => kvp.Key); 59if (kvp.Key.write == null && Equals(kvp.Key.symbol, parameter)) 76if (Equals(kvp.Key.symbol, symbol))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser.cs (2)
97where kvp.Key.Trim().StartsWith("dotnet_naming_rule.", StringComparison.Ordinal) 98let nameSplit = kvp.Key.Split('.')
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BidirectionalMap.cs (1)
25backwardMap: ImmutableDictionary.CreateRange(valueComparer, pairs.Select(static p => KeyValuePair.Create(p.Value, p.Key))))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IDictionaryExtensions.cs (2)
253if (predicate(entry.Key, entry.Value, arg)) 255keysToRemove.Add(entry.Key);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\INamedTypeSymbolExtensions.cs (3)
612comparer.Equals(member.Name, kvp.Key.Name) && 613SignatureComparer.Instance.HaveSameSignature(member, kvp.Key, caseSensitive)); 617result.Remove(match.Key);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (1)
246predicate: kvp => safeImportsToAdd.Contains(kvp.Key),
Microsoft.CodeAnalysis.AnalyzerUtilities (109)
src\2e2796bccd1466f6\TaintedDataAnalysis.TaintedDataOperationVisitor.cs (1)
51kvp.Key,
src\683181b2796de991\ParameterValidationAnalysis.ParameterValidationDataFlowOperationVisitor.cs (1)
370var parameter = kvp.Key;
src\a03b2aad21e28a8a\PropertySetAnalysis.PropertySetDataFlowOperationVisitor.cs (4)
361kvp.Key, out var pointsToAbstractValue)) 677if (this._hazardousUsageBuilder.TryGetValue(kvp.Key, out HazardousUsageEvaluationResult existingValue)) 679this._hazardousUsageBuilder[kvp.Key] = MergeHazardousUsageEvaluationResult(kvp.Value, existingValue); 683this._hazardousUsageBuilder.Add(kvp.Key, kvp.Value);
src\b310f676f7308b7f\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (1)
241foreach (var (symbol, write) in SymbolsWriteBuilder.SelectAsArray(kvp => !kvp.Value, kvp => kvp.Key))
src\roslyn\src\Compilers\Core\Portable\Collections\SmallDictionary.cs (1)
57this.Add(kv.Key, kv.Value);
src\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (1)
740var oldPrefix = kv.Key;
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\ConcurrentSet.cs (2)
125public T Current => _kvpEnumerator.Current.Key; 157yield return kvp.Key;
src\roslyn\src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (2)
833result.Add(entry.Key, createMembers(entry.Value)); 878dictionary.Add(entry.Key, namedTypes);
src\roslyn\src\Dependencies\Collections\Extensions\KeyValuePairExtensions.cs (1)
17key = keyValuePair.Key;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (2)
185return TryGetValue(pair.Key, out var value) 240result[item.Key] = item.Value;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Enumerator.cs (2)
49readonly DictionaryEntry IDictionaryEnumerator.Entry => new(Current.Key, Current.Value); 51readonly object IDictionaryEnumerator.Key => Current.Key;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+KeyCollection+Enumerator.cs (1)
25public readonly TKey Current => _enumerator.Current.Key;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueBuilder.cs (6)
119=> Add(item.Key, item.Value); 127Add(pair.Key, pair.Value); 148return TryGetValue(item.Key, out var value) 192GetOrCreateMutableDictionary().Remove(item.Key); 213if (KeyComparer.Equals(pair.Key, equalKey)) 215actualKey = pair.Key;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (10)
210Add(pair.Key, pair.Value); 218Add(pair.Key, pair.Value); 271=> Add(keyValuePair.Key, keyValuePair.Value); 275ref var value = ref FindValue(keyValuePair.Key); 286ref var value = ref FindValue(keyValuePair.Key); 289Remove(keyValuePair.Key); 1234return new DictionaryEntry(_current.Key, _current.Value); 1237return new KeyValuePair<TKey, TValue>(_current.Key, _current.Value); 1261return new DictionaryEntry(_current.Key, _current.Value); 1274return _current.Key;
src\roslyn\src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
650dictionary.Add(pair.Key, pair.Value.ToImmutableAndFree());
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\SymbolNamesWithValueOption.cs (7)
139wildcardNamesBuilder.ToImmutableDictionaryAndFree(x => x.Key, x => x.Value.ToImmutableDictionaryAndFree(), wildcardNamesBuilder.Comparer)); 311names.FirstOrDefault(kvp => symbolDeclarationId.StartsWith(kvp.Key, StringComparison.Ordinal)) is var prefixedFirstMatchOrDefault && 312!string.IsNullOrWhiteSpace(prefixedFirstMatchOrDefault.Key)) 321value.FirstOrDefault(kvp => symbolDeclarationId.StartsWith(kvp.Key, StringComparison.Ordinal)) is var unprefixedFirstMatchOrDefault && 322!string.IsNullOrWhiteSpace(unprefixedFirstMatchOrDefault.Key)) 331allKindsValue.FirstOrDefault(kvp => symbol.Name.StartsWith(kvp.Key, StringComparison.Ordinal)) is var partialFirstMatchOrDefault && 332!string.IsNullOrWhiteSpace(partialFirstMatchOrDefault.Key))
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledConcurrentDictionary.cs (1)
81var added = instance.TryAdd(kvp.Key, kvp.Value);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledConcurrentSet.cs (2)
122yield return kvp.Key; 152public T Current => _kvpEnumerator.Current.Key;
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledDictionary.cs (1)
81instance.Add(kvp.Key, kvp.Value);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (2)
77foreach (var kvp in ruleset.SpecificDiagnosticOptions.OrderBy(kvp => kvp.Key)) 79var id = kvp.Key;
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\SmallDictionary.cs (1)
59this.Add(kv.Key, kv.Value);
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\CopyAnalysis\CopyAnalysis.CopyDataFlowOperationVisitor.cs (1)
527var key = kvp.Key;
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\CopyAnalysis\CopyAnalysis.CoreCopyAnalysisDataDomain.cs (4)
37var key = kvp.Key; 57if (!result.ContainsKey(kvp.Key)) 59result.Add(kvp.Key, _getDefaultCopyValue(kvp.Key));
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\CopyAnalysis\CopyAnalysisData.cs (6)
136if (coreAnalysisData.TryGetValue(kvp.Key, out var currentValue)) 175coreAnalysisData[kvp.Key] = kvp.Value; 180Debug.Assert(predicatedData.All(kvp => kvp.Value.AnalysisEntities.IsSubsetOf(coreAnalysisData[kvp.Key].AnalysisEntities))); 211AssertValidCopyAnalysisEntity(kvp.Key); 212Debug.Assert(kvp.Value.AnalysisEntities.Contains(kvp.Key)); 223var defaultCopyValue = tryGetDefaultCopyValue?.Invoke(kvp.Key);
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\PointsToAnalysis\PointsToAnalysisData.cs (1)
131AssertValidPointsToAnalysisKeyValuePair(kvp.Key, kvp.Value, isDisposable);
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\PropertySetAnalysis\HazardousUsageEvaluatorCollection.cs (5)
110if (kvp.Key.InstanceTypeName == null || kvp.Key.Kind != HazardousUsageEvaluatorKind.Invocation) 115if (wellKnownTypeProvider.TryGetOrCreateTypeByMetadataName(kvp.Key.InstanceTypeName, out INamedTypeSymbol? namedTypeSymbol)) 117pooledDictionary[(namedTypeSymbol, kvp.Key.derivedClasses)] = kvp.Key.InstanceTypeName;
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\PropertySetAnalysis\PropertySetAnalysis.cs (3)
269if (allResults.TryGetValue(kvp.Key, out HazardousUsageEvaluationResult existingValue)) 271allResults[kvp.Key] = PropertySetAnalysis.MergeHazardousUsageEvaluationResult(existingValue, kvp.Value); 275allResults.Add(kvp.Key, kvp.Value);
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\AnalysisEntityDataFlowOperationVisitor.cs (1)
676var entity = kvp.Key;
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\AnalysisEntityMapAbstractDomain.cs (3)
70AssertValidEntryForMergedMap(kvp.Key, kvp.Value); 90AnalysisEntity key1 = entry1.Key; 201var key2 = kvp.Key;
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\DataFlowAnalysisResult.cs (3)
130if (kvp.Key.Kind == operationKind && kvp.Key.Syntax == syntax) 132if (!kvp.Key.IsImplicit)
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\DataFlowAnalysisResultBuilder.cs (1)
65var block = kvp.Key;
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\DataFlowOperationVisitor.cs (2)
541IParameterSymbol parameter = kvp.Key; 592IParameterSymbol parameter = kvp.Key;
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\DictionaryAnalysisData.cs (2)
94_coreAnalysisData.Add(item.Key, item.Value); 136return Remove(item.Key);
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\MapAbstractDomain.cs (7)
58var key = kvp.Key; 103if (result.TryGetValue(entry.Key, out var value)) 109result[entry.Key] = value; 113result.Remove(entry.Key); 118result.Add(entry.Key, entry.Value); 133if (!map2.TryGetValue(kvp.Key, out var value2)) 138result.Add(kvp.Key, intersect(kvp.Value, value2));
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\PredicatedAnalysisData.cs (8)
168coreAnalysisData[kvp.Key] = kvp.Value; 210clonedMap.Add(kvp.Key, new PerEntityPredicatedAnalysisData(kvp.Value)); 253result.Add(kvp.Key, perEntityPredicatedData); 285if (!predicatedData2.TryGetValue(kvp.Key, out var value2)) 302result.Add(kvp.Key, perEntityPredicatedData); 307if (!predicatedData1.TryGetValue(kvp.Key, out _)) 314result.Add(kvp.Key, perEntityPredicatedData); 397if (!other._lazyPredicateDataMap.TryGetValue(kvp.Key, out var otherValue) ||
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageResult.cs (4)
48=> SymbolWritesMap.SelectAsArray(kvp => !kvp.Value, kvp => kvp.Key); 59if (kvp.Key.write == null && Equals(kvp.Key.symbol, parameter)) 76if (Equals(kvp.Key.symbol, symbol))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser.cs (2)
97where kvp.Key.Trim().StartsWith("dotnet_naming_rule.", StringComparison.Ordinal) 98let nameSplit = kvp.Key.Split('.')
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BidirectionalMap.cs (1)
25backwardMap: ImmutableDictionary.CreateRange(valueComparer, pairs.Select(static p => KeyValuePair.Create(p.Value, p.Key))))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IDictionaryExtensions.cs (2)
253if (predicate(entry.Key, entry.Value, arg)) 255keysToRemove.Add(entry.Key);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\INamedTypeSymbolExtensions.cs (3)
612comparer.Equals(member.Name, kvp.Key.Name) && 613SignatureComparer.Instance.HaveSameSignature(member, kvp.Key, caseSensitive)); 617result.Remove(match.Key);
Microsoft.CodeAnalysis.CodeStyle (44)
src\b310f676f7308b7f\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (1)
241foreach (var (symbol, write) in SymbolsWriteBuilder.SelectAsArray(kvp => !kvp.Value, kvp => kvp.Key))
src\roslyn\src\Analyzers\Core\Analyzers\Helpers\DiagnosticHelper.cs (1)
214properties = properties.AddRange(tagIndices.Select(kvp => new KeyValuePair<string, string?>(kvp.Key, EncodeIndices(kvp.Value, additionalLocations.Count()))));
src\roslyn\src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (1)
912Key: "Name" or "Type",
src\roslyn\src\Compilers\Core\Portable\Collections\SmallDictionary.cs (1)
57this.Add(kv.Key, kv.Value);
src\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (1)
740var oldPrefix = kv.Key;
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\ConcurrentSet.cs (2)
125public T Current => _kvpEnumerator.Current.Key; 157yield return kvp.Key;
src\roslyn\src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (2)
833result.Add(entry.Key, createMembers(entry.Value)); 878dictionary.Add(entry.Key, namedTypes);
src\roslyn\src\Dependencies\Collections\Extensions\KeyValuePairExtensions.cs (1)
17key = keyValuePair.Key;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (2)
185return TryGetValue(pair.Key, out var value) 240result[item.Key] = item.Value;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Enumerator.cs (2)
49readonly DictionaryEntry IDictionaryEnumerator.Entry => new(Current.Key, Current.Value); 51readonly object IDictionaryEnumerator.Key => Current.Key;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+KeyCollection+Enumerator.cs (1)
25public readonly TKey Current => _enumerator.Current.Key;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueBuilder.cs (6)
119=> Add(item.Key, item.Value); 127Add(pair.Key, pair.Value); 148return TryGetValue(item.Key, out var value) 192GetOrCreateMutableDictionary().Remove(item.Key); 213if (KeyComparer.Equals(pair.Key, equalKey)) 215actualKey = pair.Key;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (10)
210Add(pair.Key, pair.Value); 218Add(pair.Key, pair.Value); 271=> Add(keyValuePair.Key, keyValuePair.Value); 275ref var value = ref FindValue(keyValuePair.Key); 286ref var value = ref FindValue(keyValuePair.Key); 289Remove(keyValuePair.Key); 1234return new DictionaryEntry(_current.Key, _current.Value); 1237return new KeyValuePair<TKey, TValue>(_current.Key, _current.Value); 1261return new DictionaryEntry(_current.Key, _current.Value); 1274return _current.Key;
src\roslyn\src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
650dictionary.Add(pair.Key, pair.Value.ToImmutableAndFree());
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageResult.cs (4)
48=> SymbolWritesMap.SelectAsArray(kvp => !kvp.Value, kvp => kvp.Key); 59if (kvp.Key.write == null && Equals(kvp.Key.symbol, parameter)) 76if (Equals(kvp.Key.symbol, symbol))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser.cs (2)
97where kvp.Key.Trim().StartsWith("dotnet_naming_rule.", StringComparison.Ordinal) 98let nameSplit = kvp.Key.Split('.')
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BidirectionalMap.cs (1)
25backwardMap: ImmutableDictionary.CreateRange(valueComparer, pairs.Select(static p => KeyValuePair.Create(p.Value, p.Key))))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IDictionaryExtensions.cs (2)
253if (predicate(entry.Key, entry.Value, arg)) 255keysToRemove.Add(entry.Key);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\INamedTypeSymbolExtensions.cs (3)
612comparer.Equals(member.Name, kvp.Key.Name) && 613SignatureComparer.Instance.HaveSameSignature(member, kvp.Key, caseSensitive)); 617result.Remove(match.Key);
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (1)
246predicate: kvp => safeImportsToAdd.Contains(kvp.Key),
Microsoft.CodeAnalysis.CSharp (63)
Binder\Binder_Lambda.cs (1)
455diagnostics.Add(ErrorCode.INF_TooManyBoundLambdas, GetAnonymousFunctionLocation(pair.Key), truncatedToHundreds);
Binder\Binder.WithQueryLambdaParametersBinder.cs (1)
126result.AddSymbol(null, kvp.Key, 0);
Binder\DecisionDagBuilder.cs (4)
1239Debug.Assert(kvp.Key == kvp.Value); 1240kvp.Key.ClearAndFree(); 1332!existingState.RemainingValues.All(kv => newRemainingValues.TryGetValue(kv.Key, out IValueSet? values) && kv.Value.Equals(values))) 2861var remainingValues = state.RemainingValues.Select(kvp => $"{tempName(kvp.Key)}:{kvp.Value}");
Binder\Imports.cs (2)
53UsingAliases.OrderBy(x => x.Value.UsingDirective.Location.SourceSpan.Start).Select(ua => $"{ua.Key} = {ua.Value.Alias.Target}").Concat( 76var name = pair.Key;
Binder\LocalScopeBinder.cs (3)
472result.AddSymbol(label.Value, label.Key, 0); 484result.AddSymbol(local.Value, local.Key, 0); 494result.AddSymbol(local.Value, local.Key, 0);
Binder\PatternExplainer.cs (1)
749var propertyString = needsPropertyString ? (deconstruction != null ? " {" : "{") + string.Join(", ", properties.Select(kvp => $" {kvp.Key.Name}: {kvp.Value}")) + " }" : null;
Binder\Semantics\OverloadResolution\OverloadResolution.cs (1)
1132NamedTypeSymbol otherType = pair.Key;
Binder\WithCrefTypeParametersBinder.cs (1)
159result.AddSymbol(typeParameter, kvp.Key, 0);
CodeGen\Optimizer.cs (1)
155select new { i = i.Key, d = d };
CommandLine\CSharpCommandLineParser.cs (2)
1408diagnosticOptions[o.Key] = o.Value; 1414diagnosticOptions[o.Key] = o.Value;
Compilation\CSharpCompilation.cs (1)
2762ImportInfo info = pair.Key;
Compiler\MethodCompiler.cs (1)
1287foreach (var (parameter, field) in capturedParameters.OrderBy(pair => pair.Key.Ordinal))
Emitter\EditAndContinue\CSharpDefinitionMap.cs (1)
176result[pair.Value] = pair.Key;
Emitter\Model\AttributeDataAdapter.cs (1)
67builder.Add(CreateMetadataNamedArgument(namedArgument.Key, namedArgument.Value, context));
Emitter\Model\SynthesizedPrivateImplementationDetailsStaticConstructor.cs (1)
49int analysisKind = payloadRoot.Key;
FlowAnalysis\AbstractFlowPass.PendingBranchesCollection.cs (1)
107var branches = GetOrAddLabeledBranches(pair.Key);
FlowAnalysis\NullableWalker.SnapshotManager.cs (1)
175var snapshotsArray = EnumerableExtensions.SelectAsArray<KeyValuePair<int, Snapshot>, (int, Snapshot)>(_incrementalSnapshots, (kvp) => (kvp.Key, kvp.Value));
FlowAnalysis\NullableWalker.Variables.cs (2)
171var identifier = pair.Key; 179_variableTypes.Add(pair.Key, pair.Value);
Lowering\IteratorRewriter\IteratorMethodToStateMachineRewriter.cs (2)
271group ft.Key by ft.Value into g 450var destination = p.Key;
Lowering\LocalRewriter\LocalRewriter_BasePatternSwitchLocalRewriter.cs (1)
76var switchSections = _switchArms.ToImmutableDictionary(kv => kv.Key, kv => kv.Value.ToImmutableAndFree());
Lowering\LocalRewriter\LocalRewriter.PatternLocalRewriter.cs (1)
83builder.AppendLine(kv.Key.Dump());
Lowering\StateMachineRewriter\IteratorAndAsyncCaptureWalker.cs (1)
85var variable = kvp.Key;
Lowering\StateMachineRewriter\MethodToStateMachineRewriter.cs (2)
137this.proxies.Add(proxy.Key, proxy.Value); 254select F.SwitchSection(kv.Value.SelectAsArray(state => (int)state), F.Goto(kv.Key));
Symbols\AbstractTypeParameterMap.cs (1)
45result.Append(' ').Append(kv.Key).Append(':').Append(kv.Value.Type);
Symbols\Attributes\AttributeData.cs (2)
170stringBuilder.Append(namedArgument.Key); 521if (namedArg.Key == filePropName &&
Symbols\Compilation_WellKnownMembers.cs (1)
424var wellKnownMember = Binder.GetWellKnownTypeMember(this, arg.Key, useSiteInfo: out _, isOptional: true);
Symbols\Metadata\PE\PEModuleSymbol.cs (1)
657var name = MetadataTypeName.FromFullName(forwarder.Key);
Symbols\Metadata\PE\PENamespaceSymbol.cs (1)
266var c = new PENestedNamespaceSymbol(child.Key, this, child.Value);
Symbols\Metadata\PE\SymbolFactory.cs (4)
93if (arg.Key.Kind == SymbolKind.ErrorType && 94arg.Key is UnsupportedMetadataTypeSymbol) 131MetadataDecoder.IsOrClosedOverATypeFromAssemblies(arguments[i].Key, linkedAssemblies))) 149TypeMap substitution = new TypeMap(typeParameters, arguments.SelectAsArray(arg => CreateType(arg.Key, arg.Value)));
Symbols\Retargeting\RetargetingSymbolTranslator.cs (1)
1281newArguments.Add(new KeyValuePair<string, TypedConstant>(oldArgument.Key, newConstant));
Symbols\Source\ConstantEvaluationHelpers.cs (1)
336var field = pair.Key;
Symbols\Source\ExtensionGroupingInfo.cs (2)
60builder.Add(new ExtensionGroupingType(pair.Key, pair.Value)); 696builder.Add(new ExtensionMarkerType(this, name: pair.Key, extensions: pair.Value));
Symbols\Source\SourceAssemblySymbol.cs (3)
742if (oneKey.Key.IsDefaultOrEmpty) 973var fileRef = pair.Key as PortableExecutableReference; 2565switch (namedArg.Key)
Symbols\Source\SourceMemberContainerSymbol.cs (6)
1778dictionary.Add(pair.Key, pair.Value is ArrayBuilder<Symbol> arrayBuilder 2222var name = pair.Key; 2644if (membersByName.TryGetValue(pair.Key, out var members)) 2646membersByName[pair.Key] = concatMembers(members, extension, pair.Value, ref membersUnordered); 2650membersByName.Add(pair.Key, concatMembers([], extension, pair.Value, ref membersUnordered)); 4201Debug.Assert(pair.Key.Equals(WellKnownMemberNames.InstanceConstructorName.AsMemory()));
Symbols\Source\SourceMethodSymbolWithAttributes.cs (2)
890switch (namedArg.Key) 897diagnostics.Add(ErrorCode.ERR_InvalidNamedArgument, arguments.AttributeSyntaxOpt.ArgumentList.Arguments[position].Location, namedArg.Key);
Symbols\Source\SourceNamedTypeSymbol_Bases.cs (1)
177NamedTypeSymbol other = pair.Key;
Symbols\Source\SourceNamedTypeSymbol_Extension.cs (1)
932appendIdentifier(namedArgument.Key, builder);
Symbols\Source\SourceNamespaceSymbol.AliasesAndUsings.cs (2)
298if (builder.ContainsKey(pair.Key)) 301diagnostics.Add(ErrorCode.ERR_DuplicateAlias, pair.Value.Alias.GetFirstLocation(), pair.Key);
Symbols\Synthesized\Records\SynthesizedPrimaryConstructor.cs (1)
125return capturedParameters.OrderBy(static pair => pair.Key.Ordinal).Select(static pair => pair.Value);
Microsoft.CodeAnalysis.CSharp.CodeStyle (14)
src\roslyn\src\Analyzers\CSharp\Analyzers\UsePrimaryConstructor\CSharpUsePrimaryConstructorDiagnosticAnalyzer.cs (6)
168.Where(kvp => !_membersThatCannotBeRemoved.Contains(kvp.Key)) 170static kvp => kvp.Key.Name, 175if (_candidateMembersToRemove.Any(kvp => kvp.Key is IFieldSymbol) && 176_candidateMembersToRemove.All(kvp => kvp.Key is IFieldSymbol)) 181_candidateMembersToRemove.Any(kvp => kvp.Key is IPropertySymbol) && 182_candidateMembersToRemove.All(kvp => kvp.Key is IPropertySymbol))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\MemberDeclarationSyntaxExtensions.cs (1)
23return dictionary.ToDictionary(kvp => kvp.Key, kvp => kvp.Value.AsImmutable());
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaRewriter.cs (7)
56if (pair.Key.Item1.RawKind != 0) 58_trailingTriviaMap.Add(pair.Key.Item1, trailingTrivia); 61if (pair.Key.Item2.RawKind != 0) 63_leadingTriviaMap.Add(pair.Key.Item2, leadingTrivia); 73if (pair.Key.Item1.RawKind == 0) 75return (default(SyntaxTriviaList), GetLeadingTriviaAtBeginningOfTree(pair.Key, pair.Value, cancellationToken)); 89var text = pair.Value.GetTextChanges(GetTextSpan(pair.Key)).Single().NewText ?? "";
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (3)
src\roslyn\src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider_DocComments.cs (1)
179var (removedMember, (memberDeclaration, _)) = removedMembers.FirstOrDefault(kvp => kvp.Key.Name == memberName);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\AttributeGenerator.cs (1)
92NameEquals(IdentifierName(argument.Key)),
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ExpressionGenerator.cs (1)
291if (constant.Key.Equals(value))
Microsoft.CodeAnalysis.CSharp.Features (7)
src\roslyn\src\Analyzers\CSharp\Analyzers\UsePrimaryConstructor\CSharpUsePrimaryConstructorDiagnosticAnalyzer.cs (6)
168.Where(kvp => !_membersThatCannotBeRemoved.Contains(kvp.Key)) 170static kvp => kvp.Key.Name, 175if (_candidateMembersToRemove.Any(kvp => kvp.Key is IFieldSymbol) && 176_candidateMembersToRemove.All(kvp => kvp.Key is IFieldSymbol)) 181_candidateMembersToRemove.Any(kvp => kvp.Key is IPropertySymbol) && 182_candidateMembersToRemove.All(kvp => kvp.Key is IPropertySymbol))
src\roslyn\src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider_DocComments.cs (1)
179var (removedMember, (memberDeclaration, _)) = removedMembers.FirstOrDefault(kvp => kvp.Key.Name == memberName);
Microsoft.CodeAnalysis.CSharp.Workspaces (11)
FileBasedPrograms\FileBasedProgramService.cs (1)
31result.Add(kvp.Key, kvp.Value);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\MemberDeclarationSyntaxExtensions.cs (1)
23return dictionary.ToDictionary(kvp => kvp.Key, kvp => kvp.Value.AsImmutable());
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaRewriter.cs (7)
56if (pair.Key.Item1.RawKind != 0) 58_trailingTriviaMap.Add(pair.Key.Item1, trailingTrivia); 61if (pair.Key.Item2.RawKind != 0) 63_leadingTriviaMap.Add(pair.Key.Item2, leadingTrivia); 73if (pair.Key.Item1.RawKind == 0) 75return (default(SyntaxTriviaList), GetLeadingTriviaAtBeginningOfTree(pair.Key, pair.Value, cancellationToken)); 89var text = pair.Value.GetTextChanges(GetTextSpan(pair.Key)).Single().NewText ?? "";
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\AttributeGenerator.cs (1)
92NameEquals(IdentifierName(argument.Key)),
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ExpressionGenerator.cs (1)
291if (constant.Key.Equals(value))
Microsoft.CodeAnalysis.Extensions.Package (28)
src\roslyn\src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (2)
833result.Add(entry.Key, createMembers(entry.Value)); 878dictionary.Add(entry.Key, namedTypes);
src\roslyn\src\Dependencies\Collections\Extensions\KeyValuePairExtensions.cs (1)
17key = keyValuePair.Key;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (2)
185return TryGetValue(pair.Key, out var value) 240result[item.Key] = item.Value;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Enumerator.cs (2)
49readonly DictionaryEntry IDictionaryEnumerator.Entry => new(Current.Key, Current.Value); 51readonly object IDictionaryEnumerator.Key => Current.Key;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+KeyCollection+Enumerator.cs (1)
25public readonly TKey Current => _enumerator.Current.Key;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueBuilder.cs (6)
119=> Add(item.Key, item.Value); 127Add(pair.Key, pair.Value); 148return TryGetValue(item.Key, out var value) 192GetOrCreateMutableDictionary().Remove(item.Key); 213if (KeyComparer.Equals(pair.Key, equalKey)) 215actualKey = pair.Key;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (10)
210Add(pair.Key, pair.Value); 218Add(pair.Key, pair.Value); 271=> Add(keyValuePair.Key, keyValuePair.Value); 275ref var value = ref FindValue(keyValuePair.Key); 286ref var value = ref FindValue(keyValuePair.Key); 289Remove(keyValuePair.Key); 1234return new DictionaryEntry(_current.Key, _current.Value); 1237return new KeyValuePair<TKey, TValue>(_current.Key, _current.Value); 1261return new DictionaryEntry(_current.Key, _current.Value); 1274return _current.Key;
src\roslyn\src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
650dictionary.Add(pair.Key, pair.Value.ToImmutableAndFree());
Symbols\INamedTypeSymbolExtensions.cs (3)
612comparer.Equals(member.Name, kvp.Key.Name) && 613SignatureComparer.Instance.HaveSameSignature(member, kvp.Key, caseSensitive)); 617result.Remove(match.Key);
Microsoft.CodeAnalysis.ExternalAccess.HotReload (1)
Api\HotReloadService.cs (1)
205static e => e.Key,
Microsoft.CodeAnalysis.ExternalAccess.RazorCompiler (1)
GeneratorExtensions.cs (1)
35public static ImmutableArray<(string Key, string Value)> GetHostOutputs(this GeneratorRunResult runResult) => runResult.HostOutputs.ToImmutableArray().SelectAsArray(a => (a.Key, a.Value.ToString() ?? ""));
Microsoft.CodeAnalysis.Features (60)
ChangeSignature\ChangeSignatureTelemetryLogger.cs (3)
187m[kv.Key.ToString()] = kv.Value.GetCount(); 193statistics.WriteTelemetryPropertiesTo(m, prefix: kv.Key.ToString()); 198kv.Value.WriteTelemetryPropertiesTo(m, prefix: kv.Key.ToString());
CodeFixes\Service\CodeFixService.cs (2)
932return mutableMap.ToImmutableDictionary(kvp => kvp.Key, kvp => kvp.Value.ToImmutableAndFree()); 1019return builder.ToImmutableDictionary(kvp => kvp.Key, kvp => kvp.Value.ToImmutableAndFree());
CodeFixes\Suppression\AbstractSuppressionBatchFixAllProvider.cs (1)
292return documentIdToFinalText.SelectAsArray(kvp => (kvp.Key, kvp.Value));
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.GlobalSuppressMessageFixAllCodeAction.cs (2)
74foreach (var grouping in diagnosticsByDocument.GroupBy(d => d.Key.Project)) 215return builder.OrderBy(kvp => kvp.Key.GetDocumentationCommentId() ?? string.Empty);
Completion\Log\CompletionProvidersLogger.cs (3)
91statistics.WriteTelemetryPropertiesTo(m, prefix: kv.Key.ToString()); 96m[kv.Key.ToString()] = kv.Value.GetCount(); 101kv.Value.WriteTelemetryPropertiesTo(m, prefix: kv.Key.ToString());
Completion\Providers\AbstractSymbolCompletionProvider.cs (3)
216completionContext, symbolGroup.Key.displayText, symbolGroup.Key.suffix, symbolGroup.Key.insertionText, symbolList, arbitraryFirstContext, supportedPlatformData);
Completion\Providers\CompletionUtilities.cs (1)
76return item.AddProperty(property.Key, property.Value);
Completion\Providers\ImportCompletionProvider\ImportCompletionItem.cs (1)
251var properties = item.GetProperties().WhereAsArray(pair => pair.Key != CommitBehaviorKey);
Copilot\CopilotChangeAnalysisUtilities.cs (1)
112=> string.Join(",", dictionary.Select(kvp => FormattableString.Invariant($"{kvp.Key}_{Stringify(kvp.Value)}")).OrderBy(v => v));
Diagnostics\DiagnosticAnalyzerExtensions.cs (2)
43=> analysisResult.SelectAsArray(kv => new AnalyzerPerformanceInfo(kv.Key.GetAnalyzerId(), analyzerInfo.IsTelemetryCollectionAllowed(kv.Key), kv.Value.ExecutionTime));
Diagnostics\Service\DiagnosticAnalyzerService_CoreAnalyze.cs (1)
66var result = builderMap.ToImmutableDictionary(kv => kv.Key, kv => DiagnosticAnalysisResult.CreateFromBuilder(kv.Value));
Diagnostics\Service\DiagnosticAnalyzerService_RemoteOrLocalDispatcher.cs (1)
146kvp => kvp.Key,
DocumentHighlighting\AbstractDocumentHighlightsService.cs (1)
280list.Add(new DocumentHighlights(kvp.Key, [.. kvp.Value]));
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (8)
824map.Any(entry => IsGlobalStatement(entry.Key))) 847=> string.Join(",", features.OrderBy(kvp => kvp.Key).Select(kvp => $"{kvp.Key}={kvp.Value}")); 1658map.ToDictionary(keySelector: entry => entry.Value, elementSelector: entry => entry.Key), 6061static item => item.Key, 6062static item => new RuntimeRudeEdit(item.Value.ToDiagnostic(item.Key.SyntaxTree).ToString(), (int)item.Value.Kind)); 6994=> x.Key.Equals(y.Key) &&
EditAndContinue\ActiveStatementsMap.cs (1)
94keySelector: entry => entry.Key,
EditAndContinue\CommittedSolution.cs (1)
125return _documentState.SelectAsArray(e => (e.Key, e.Value));
EditAndContinue\EditSession.cs (1)
1582var diagnostics = diagnosticBuilders.SelectAsArray(entry => new ProjectDiagnostics(entry.Key, entry.Value.ToImmutableAndFree()));
EditAndContinue\EmitSolutionUpdateResults.cs (1)
86var firstProject = solution.GetProject(runningProjects.FirstOrDefault().Key) ?? solution.Projects.First();
EditAndContinue\Utilities\BidirectionalMap.cs (6)
33forward.Add(entry.Key, entry.Value); 34reverse.Add(entry.Value, entry.Key); 55forward.Add(entry.Key, entry.Value); 56reverse.Add(entry.Value, entry.Key); 61forward.Add(entry.Key, entry.Value); 62reverse.Add(entry.Value, entry.Key);
EmbeddedLanguages\AbstractEmbeddedLanguageFeatureService.cs (1)
75kvp => kvp.Key, kvp => kvp.Value.ToImmutableAndFree(), StringComparer.OrdinalIgnoreCase);
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingSolutionCrawlerLogger.cs (1)
139var change = kv.Key.ToString();
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingAsyncWorkItemQueue.cs (1)
255return pair.Key;
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingSemanticChangeProcessor.cs (1)
279var result = map.Remove(first.Key);
ExtractMethod\MethodExtractor.Analyzer.cs (2)
881foreach (var pair in symbolMap.Where(p => p.Key.Kind == SymbolKind.Field)) 883var field = (IFieldSymbol)pair.Key;
InlineMethod\AbstractInlineMethodRefactoringProvider.InlineContext.cs (2)
333.Select(parameterAndExpressionPair => (parameter: (ISymbol)parameterAndExpressionPair.Key, 341.Select(kvp => (parameter: kvp.Key, syntaxNode: syntaxGenerator.IdentifierName(kvp.Value)));
IntroduceParameter\AbstractIntroduceParameterCodeRefactoringProvider.cs (1)
308source: methodCallSites.GroupBy(kvp => kvp.Key.Project),
LanguageServices\AnonymousTypeDisplayService\AbstractStructuralTypeDisplayService.cs (1)
197var hasAtLeastOneTupleWhichAppearsMultipleTimes = transitiveReferences.Any(kvp => kvp.Key.IsTupleType && kvp.Value.count >= 2);
NavigateTo\AbstractNavigateToSearchService.NormalSearch.cs (1)
142return documentToTextSpans.SelectAsArray(kvp => (kvp.Key, new NormalizedTextSpanCollection(kvp.Value)))!;
QuickInfo\OnTheFlyDocsLogger.cs (1)
47m[kv.Key.ToString()] = kv.Value.GetCount();
Shared\Utilities\AnnotatedSymbolMapping.cs (2)
100var document = annotatedSolution.GetRequiredDocument(root.Key); 105keySelector: (kvp) => kvp.Key,
SpellCheck\AbstractSpellCheckCodeFixProvider.cs (1)
173var codeActions = results.OrderBy(kvp => kvp.Key)
src\roslyn\src\Analyzers\Core\Analyzers\Helpers\DiagnosticHelper.cs (1)
214properties = properties.AddRange(tagIndices.Select(kvp => new KeyValuePair<string, string?>(kvp.Key, EncodeIndices(kvp.Value, additionalLocations.Count()))));
src\roslyn\src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (1)
912Key: "Name" or "Type",
UnusedReferences\ProjectAssets\ProjectAssetsReader.cs (3)
58.ToImmutableDictionary(t => t.Key, t => t.Value.ToImmutableDictionary(l => l.Key.Split('/')[0], l => l.Key));
Microsoft.CodeAnalysis.Features.ExternalAccess (1)
Copilot\Internal\Analyzer\CSharp\CSharpCopilotCodeAnalysisService.cs (1)
171nodeToWrapper.Key,
Microsoft.CodeAnalysis.NetAnalyzers (142)
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\CollectionsShouldImplementGenericInterface.cs (4)
104Debug.Assert(interfacePairs.All(kvp => kvp.Key.TypeKind == TypeKind.Interface && kvp.Value.All(x => x.TypeKind == TypeKind.Interface))); 141if (allInterfaces.Contains(kvp.Key) && !allInterfaces.Intersect(kvp.Value, SymbolEqualityComparer.Default).Any()) 145ReportDiagnosticAlt(kvp.Key, kvp.Value); 149ReportDiagnostic(kvp.Key, kvp.Value[0]);
Microsoft.CodeQuality.Analyzers\Maintainability\AvoidUninstantiatedInternalClasses.cs (2)
163.Select(it => it.Key.OriginalDefinition) 164.Except(instantiatedTypes.Select(it => it.Key.OriginalDefinition))
Microsoft.CodeQuality.Analyzers\QualityGuidelines\AvoidMultipleEnumerations\FlowAnalysis\GlobalFlowStateDictionaryAnalysisValue.cs (5)
51builder[kvp.Key] = kvp.Value; 56var key = kvp.Key; 83var key = kvp.Key; 108var key = kvp.Key; 111if (!intersectedKeys.Contains(kvp.Key))
Microsoft.CodeQuality.Analyzers\QualityGuidelines\ValidateArgumentsOfPublicMethods.cs (1)
102IParameterSymbol parameter = kvp.Key;
Microsoft.NetCore.Analyzers\InteropServices\PlatformCompatibilityAnalyzer.cs (6)
367var value = analysisResult[platformSpecificOperation.Key.Kind, platformSpecificOperation.Key.Syntax]; 374(value.Kind == GlobalFlowStateAnalysisValueSetKind.Unknown && HasGuardedLambdaOrLocalFunctionResult(platformSpecificOperation.Key, 380ReportDiagnostics(platformSpecificOperation.Key, pair.attributes, csAttributes, context, symbol, originalAttributes); 668csAttributes.Any(cs => !cs.Key.Equals(platformName, StringComparison.OrdinalIgnoreCase)); 2255if (attribute.NamedArguments.Length == 1 && attribute.NamedArguments[0].Key is "Url")
Microsoft.NetCore.Analyzers\Performance\AvoidPotentiallyExpensiveCallWhenLogging.cs (1)
349.FirstOrDefault(p => p.Key.Equals("Level", StringComparison.Ordinal))
Microsoft.NetCore.Analyzers\Performance\ConstantExpectedAnalyzer.cs (4)
392if (namedArg.Key.Equals(ConstantExpectedMin, StringComparison.Ordinal) 397else if (namedArg.Key.Equals(ConstantExpectedMax, StringComparison.Ordinal) 560if (namedArg.Key.Equals(ConstantExpectedMin, StringComparison.Ordinal)) 564else if (namedArg.Key.Equals(ConstantExpectedMax, StringComparison.Ordinal))
Microsoft.NetCore.Analyzers\Performance\PreferHashDataOverComputeHash.cs (1)
633var local = kvp.Key;
Microsoft.NetCore.Analyzers\Performance\PreferHashDataOverComputeHash.Fixer.cs (1)
100Project project = pair.Key;
Microsoft.NetCore.Analyzers\Performance\PreferReadOnlySpanOverSpan.cs (1)
106var parameter = kvp.Key;
Microsoft.NetCore.Analyzers\Performance\UseConcreteTypeAnalyzer.Collector.cs (7)
607var field = pair.Key; 620var property = pair.Key; 633var parameter = pair.Key; 649var field = pair.Key; 662var property = pair.Key; 675var parameter = pair.Key; 691var method = pair.Key;
Microsoft.NetCore.Analyzers\Performance\UseConcreteTypeAnalyzer.cs (5)
180var field = pair.Key; 192var property = pair.Key; 204var local = pair.Key; 216var parameter = pair.Key; 234var method = pair.Key;
Microsoft.NetCore.Analyzers\Runtime\AttributeStringLiteralsShouldParseCorrectly.cs (4)
210var valueValidator = GetValueValidator(namedArgument.Key); 212!valueValidator.IsIgnoredName(namedArgument.Key) && 220$"{classDisplayString}.{namedArgument.Key}", 227$"{classDisplayString}.{namedArgument.Key}",
Microsoft.NetCore.Analyzers\Runtime\DetectPreviewFeatureAnalyzer.cs (2)
889if (namedArgument.Key == "Message" && 895if (namedArgument.Key == "Url" &&
Microsoft.NetCore.Analyzers\Runtime\DisposableFieldsShouldBeDisposed.cs (2)
229IFieldSymbol field = fieldWithPointsToValue.Key; 274IFieldSymbol field = kvp.Key;
Microsoft.NetCore.Analyzers\Runtime\DisposeObjectsBeforeLosingScope.cs (1)
204AbstractLocation location = kvp.Key;
Microsoft.NetCore.Analyzers\Runtime\PreferStringContainsOverIndexOfAnalyzer.cs (1)
195ILocalSymbol variable = variableNameAndLocation.Key;
Microsoft.NetCore.Analyzers\Security\DoNotDisableHttpClientCRLCheck.cs (3)
236RoslynDebug.Assert(kvp.Key.Method != null); // HazardousUsageEvaluations only for invocations. 240kvp.Key.Location, 241kvp.Key.Method.ToDisplayString(
Microsoft.NetCore.Analyzers\Security\DoNotInstallRootCert.cs (3)
225RoslynDebug.Assert(kvp.Key.Method != null); // HazardousUsageEvaluations only for invocations. 229kvp.Key.Location, 230kvp.Key.Method.ToDisplayString(
Microsoft.NetCore.Analyzers\Security\DoNotUseCreateEncryptorWithNonDefaultIV.cs (3)
201RoslynDebug.Assert(kvp.Key.Method != null); // HazardousUsageEvaluations only for invocations. 205kvp.Key.Location, 206kvp.Key.Method.ToDisplayString(
Microsoft.NetCore.Analyzers\Security\DoNotUseInsecureDeserializerJavascriptSerializerWithSimpleTypeResolver.cs (3)
260RoslynDebug.Assert(kvp.Key.Method != null); // HazardousUsageEvaluations only for invocations. 264kvp.Key.Location, 265kvp.Key.Method.ToDisplayString(
Microsoft.NetCore.Analyzers\Security\DoNotUseInsecureDeserializerJsonNetWithoutBinder.cs (1)
243kvp.Key.Location));
Microsoft.NetCore.Analyzers\Security\DoNotUseInsecureDeserializerWithoutBinderBase.cs (3)
224RoslynDebug.Assert(kvp.Key.Method != null); // HazardousUsageEvaluations only for invocations. 228kvp.Key.Location, 229kvp.Key.Method.ToDisplayString(
Microsoft.NetCore.Analyzers\Security\DoNotUseInsecureSettingsForJsonNet.cs (1)
270kvp.Key.Location));
Microsoft.NetCore.Analyzers\Security\DoNotUseWeakKDFInsufficientIterationCount.cs (1)
224kvp.Key.Location,
Microsoft.NetCore.Analyzers\Security\PotentialReferenceCycleInDeserializedObjectGraph.cs (3)
86var leftVertices = inDegree.Where(s => s.Value > 0).Select(s => s.Key).ToImmutableHashSet(); 87var invertedLeftVertices = outDegree.Where(s => s.Value > 0).Select(s => s.Key).ToImmutableHashSet(); 230var stack = new Stack<ISymbol>(degree.Where(s => s.Value == 0).Select(s => s.Key));
Microsoft.NetCore.Analyzers\Security\SetHttpOnlyForHttpCookie.cs (1)
188kvp.Key.Location));
Microsoft.NetCore.Analyzers\Security\UseSecureCookiesASPNetCore.cs (3)
219RoslynDebug.Assert(kvp.Key.Method != null); // HazardousUsageEvaluations only for invocations. 223kvp.Key.Location, 224kvp.Key.Method.ToDisplayString(
src\0437c1690f5501bd\CopyAnalysis.CopyDataFlowOperationVisitor.cs (1)
527var key = kvp.Key;
src\0437c1690f5501bd\CopyAnalysis.CoreCopyAnalysisDataDomain.cs (4)
36var key = kvp.Key; 56if (!result.ContainsKey(kvp.Key)) 58result.Add(kvp.Key, _getDefaultCopyValue(kvp.Key));
src\11b41c7305441175\HazardousUsageEvaluatorCollection.cs (5)
109if (kvp.Key.InstanceTypeName == null || kvp.Key.Kind != HazardousUsageEvaluatorKind.Invocation) 114if (wellKnownTypeProvider.TryGetOrCreateTypeByMetadataName(kvp.Key.InstanceTypeName, out INamedTypeSymbol? namedTypeSymbol)) 116pooledDictionary[(namedTypeSymbol, kvp.Key.derivedClasses)] = kvp.Key.InstanceTypeName;
src\11b41c7305441175\PropertySetAnalysis.PropertySetDataFlowOperationVisitor.cs (4)
358kvp.Key, out var pointsToAbstractValue)) 674if (this._hazardousUsageBuilder.TryGetValue(kvp.Key, out HazardousUsageEvaluationResult existingValue)) 676this._hazardousUsageBuilder[kvp.Key] = MergeHazardousUsageEvaluationResult(kvp.Value, existingValue); 680this._hazardousUsageBuilder.Add(kvp.Key, kvp.Value);
src\40daf5e1cab76dff\TaintedDataAnalysis.TaintedDataOperationVisitor.cs (1)
49kvp.Key,
src\47c588c5b8785708\ParameterValidationAnalysis.ParameterValidationDataFlowOperationVisitor.cs (1)
368var parameter = kvp.Key;
src\9382845807600969\AnalysisEntityDataFlowOperationVisitor.cs (1)
675var entity = kvp.Key;
src\9382845807600969\AnalysisEntityMapAbstractDomain.cs (3)
69AssertValidEntryForMergedMap(kvp.Key, kvp.Value); 89AnalysisEntity key1 = entry1.Key; 200var key2 = kvp.Key;
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\Extensions\KeyValuePairExtensions.cs (1)
12key = pair.Key;
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\Options\SymbolNamesWithValueOption.cs (7)
137wildcardNamesBuilder.ToImmutableDictionaryAndFree(x => x.Key, x => x.Value.ToImmutableDictionaryAndFree(), wildcardNamesBuilder.Comparer)); 310names.FirstOrDefault(kvp => symbolDeclarationId.StartsWith(kvp.Key, StringComparison.Ordinal)) is var prefixedFirstMatchOrDefault && 311!string.IsNullOrWhiteSpace(prefixedFirstMatchOrDefault.Key)) 321value.FirstOrDefault(kvp => symbolDeclarationId.StartsWith(kvp.Key, StringComparison.Ordinal)) is var unprefixedFirstMatchOrDefault && 322!string.IsNullOrWhiteSpace(unprefixedFirstMatchOrDefault.Key)) 331allKindsValue.FirstOrDefault(kvp => symbol.Name.StartsWith(kvp.Key, StringComparison.Ordinal)) is var partialFirstMatchOrDefault && 332!string.IsNullOrWhiteSpace(partialFirstMatchOrDefault.Key))
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\PooledObjects\ArrayBuilder.cs (1)
424dictionary.Add(pair.Key, pair.Value.ToImmutableAndFree());
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\PooledObjects\PooledConcurrentDictionary.cs (1)
79var added = instance.TryAdd(kvp.Key, kvp.Value);
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\PooledObjects\PooledConcurrentSet.cs (2)
121yield return kvp.Key; 151public T Current => _kvpEnumerator.Current.Key;
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\PooledObjects\PooledDictionary.cs (1)
107instance.Add(kvp.Key, kvp.Value);
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\RulesetToEditorconfigConverter.cs (2)
76foreach (var kvp in ruleset.SpecificDiagnosticOptions.OrderBy(kvp => kvp.Key)) 78var id = kvp.Key;
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\SmallDictionary.cs (1)
57this.Add(kv.Key, kv.Value);
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\FlowAnalysis\FlowAnalysis\Analysis\CopyAnalysis\CopyAnalysisData.cs (6)
135if (coreAnalysisData.TryGetValue(kvp.Key, out var currentValue)) 174coreAnalysisData[kvp.Key] = kvp.Value; 179Debug.Assert(predicatedData.All(kvp => kvp.Value.AnalysisEntities.IsSubsetOf(coreAnalysisData[kvp.Key].AnalysisEntities))); 210AssertValidCopyAnalysisEntity(kvp.Key); 211Debug.Assert(kvp.Value.AnalysisEntities.Contains(kvp.Key)); 222var defaultCopyValue = tryGetDefaultCopyValue?.Invoke(kvp.Key);
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\FlowAnalysis\FlowAnalysis\Analysis\PointsToAnalysis\PointsToAnalysisData.cs (1)
130AssertValidPointsToAnalysisKeyValuePair(kvp.Key, kvp.Value, isDisposable);
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\FlowAnalysis\FlowAnalysis\Analysis\PropertySetAnalysis\PropertySetAnalysis.cs (3)
268if (allResults.TryGetValue(kvp.Key, out HazardousUsageEvaluationResult existingValue)) 270allResults[kvp.Key] = PropertySetAnalysis.MergeHazardousUsageEvaluationResult(existingValue, kvp.Value); 274allResults.Add(kvp.Key, kvp.Value);
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\DataFlowAnalysisResult.cs (3)
129if (kvp.Key.Kind == operationKind && kvp.Key.Syntax == syntax) 131if (!kvp.Key.IsImplicit)
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\DataFlowAnalysisResultBuilder.cs (1)
64var block = kvp.Key;
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\DataFlowOperationVisitor.cs (2)
538IParameterSymbol parameter = kvp.Key; 589IParameterSymbol parameter = kvp.Key;
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\DictionaryAnalysisData.cs (2)
93_coreAnalysisData.Add(item.Key, item.Value); 135return Remove(item.Key);
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\MapAbstractDomain.cs (7)
57var key = kvp.Key; 102if (result.TryGetValue(entry.Key, out var value)) 108result[entry.Key] = value; 112result.Remove(entry.Key); 117result.Add(entry.Key, entry.Value); 132if (!map2.TryGetValue(kvp.Key, out var value2)) 137result.Add(kvp.Key, intersect(kvp.Value, value2));
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\PredicatedAnalysisData.cs (8)
166coreAnalysisData[kvp.Key] = kvp.Value; 208clonedMap.Add(kvp.Key, new PerEntityPredicatedAnalysisData(kvp.Value)); 251result.Add(kvp.Key, perEntityPredicatedData); 283if (!predicatedData2.TryGetValue(kvp.Key, out var value2)) 300result.Add(kvp.Key, perEntityPredicatedData); 305if (!predicatedData1.TryGetValue(kvp.Key, out _)) 312result.Add(kvp.Key, perEntityPredicatedData); 395if (!other._lazyPredicateDataMap.TryGetValue(kvp.Key, out var otherValue) ||
Microsoft.CodeAnalysis.Razor.Compiler (9)
CSharp\DefaultUtf8WriteLiteralFeature.cs (2)
277hash.Add(kvp.Key, StringComparer.OrdinalIgnoreCase); 283hash.Add(kvp.Key, StringComparer.Ordinal);
Language\Components\ComponentGenericTypePass.cs (3)
104var mappings = bindings.ToDictionary(kvp => kvp.Key, kvp => kvp.Value.Node); 227bindings.Remove(entryToRemove.Key); 251var mappings = bindings.ToDictionary(kvp => kvp.Key, kvp => kvp.Value.Node);
Language\Components\TagHelperDescriptorExtensions.cs (1)
73binding.Attributes.FirstOrDefault(boundAttribute.PropertyName, static (kvp, propertyName) => kvp.Key == propertyName) is { Value: var bindingTypeName })
Mvc.Version1_X\ViewComponentTagHelperDescriptorFactory.cs (1)
244.Where(namedArgument => string.Equals(namedArgument.Key, ViewComponentTypes.ViewComponent.Name, StringComparison.Ordinal))
Mvc.Version2_X\ViewComponentTagHelperDescriptorFactory.cs (1)
259.Where(namedArgument => string.Equals(namedArgument.Key, ViewComponentTypes.ViewComponent.Name, StringComparison.Ordinal))
Mvc\ViewComponentTagHelperDescriptorFactory.cs (1)
262.Where(namedArgument => string.Equals(namedArgument.Key, ViewComponentTypes.ViewComponent.Name, StringComparison.Ordinal))
Microsoft.CodeAnalysis.ResxSourceGenerator (56)
src\b310f676f7308b7f\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (1)
241foreach (var (symbol, write) in SymbolsWriteBuilder.SelectAsArray(kvp => !kvp.Value, kvp => kvp.Key))
src\roslyn\src\Compilers\Core\Portable\Collections\SmallDictionary.cs (1)
57this.Add(kv.Key, kv.Value);
src\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (1)
740var oldPrefix = kv.Key;
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\ConcurrentSet.cs (2)
125public T Current => _kvpEnumerator.Current.Key; 157yield return kvp.Key;
src\roslyn\src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (2)
833result.Add(entry.Key, createMembers(entry.Value)); 878dictionary.Add(entry.Key, namedTypes);
src\roslyn\src\Dependencies\Collections\Extensions\KeyValuePairExtensions.cs (1)
17key = keyValuePair.Key;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (2)
185return TryGetValue(pair.Key, out var value) 240result[item.Key] = item.Value;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Enumerator.cs (2)
49readonly DictionaryEntry IDictionaryEnumerator.Entry => new(Current.Key, Current.Value); 51readonly object IDictionaryEnumerator.Key => Current.Key;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+KeyCollection+Enumerator.cs (1)
25public readonly TKey Current => _enumerator.Current.Key;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueBuilder.cs (6)
119=> Add(item.Key, item.Value); 127Add(pair.Key, pair.Value); 148return TryGetValue(item.Key, out var value) 192GetOrCreateMutableDictionary().Remove(item.Key); 213if (KeyComparer.Equals(pair.Key, equalKey)) 215actualKey = pair.Key;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (10)
210Add(pair.Key, pair.Value); 218Add(pair.Key, pair.Value); 271=> Add(keyValuePair.Key, keyValuePair.Value); 275ref var value = ref FindValue(keyValuePair.Key); 286ref var value = ref FindValue(keyValuePair.Key); 289Remove(keyValuePair.Key); 1234return new DictionaryEntry(_current.Key, _current.Value); 1237return new KeyValuePair<TKey, TValue>(_current.Key, _current.Value); 1261return new DictionaryEntry(_current.Key, _current.Value); 1274return _current.Key;
src\roslyn\src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
650dictionary.Add(pair.Key, pair.Value.ToImmutableAndFree());
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\SymbolNamesWithValueOption.cs (7)
139wildcardNamesBuilder.ToImmutableDictionaryAndFree(x => x.Key, x => x.Value.ToImmutableDictionaryAndFree(), wildcardNamesBuilder.Comparer)); 311names.FirstOrDefault(kvp => symbolDeclarationId.StartsWith(kvp.Key, StringComparison.Ordinal)) is var prefixedFirstMatchOrDefault && 312!string.IsNullOrWhiteSpace(prefixedFirstMatchOrDefault.Key)) 321value.FirstOrDefault(kvp => symbolDeclarationId.StartsWith(kvp.Key, StringComparison.Ordinal)) is var unprefixedFirstMatchOrDefault && 322!string.IsNullOrWhiteSpace(unprefixedFirstMatchOrDefault.Key)) 331allKindsValue.FirstOrDefault(kvp => symbol.Name.StartsWith(kvp.Key, StringComparison.Ordinal)) is var partialFirstMatchOrDefault && 332!string.IsNullOrWhiteSpace(partialFirstMatchOrDefault.Key))
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledConcurrentDictionary.cs (1)
81var added = instance.TryAdd(kvp.Key, kvp.Value);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledConcurrentSet.cs (2)
122yield return kvp.Key; 152public T Current => _kvpEnumerator.Current.Key;
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledDictionary.cs (1)
81instance.Add(kvp.Key, kvp.Value);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (2)
77foreach (var kvp in ruleset.SpecificDiagnosticOptions.OrderBy(kvp => kvp.Key)) 79var id = kvp.Key;
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\SmallDictionary.cs (1)
59this.Add(kv.Key, kv.Value);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageResult.cs (4)
48=> SymbolWritesMap.SelectAsArray(kvp => !kvp.Value, kvp => kvp.Key); 59if (kvp.Key.write == null && Equals(kvp.Key.symbol, parameter)) 76if (Equals(kvp.Key.symbol, symbol))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser.cs (2)
97where kvp.Key.Trim().StartsWith("dotnet_naming_rule.", StringComparison.Ordinal) 98let nameSplit = kvp.Key.Split('.')
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BidirectionalMap.cs (1)
25backwardMap: ImmutableDictionary.CreateRange(valueComparer, pairs.Select(static p => KeyValuePair.Create(p.Value, p.Key))))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IDictionaryExtensions.cs (2)
253if (predicate(entry.Key, entry.Value, arg)) 255keysToRemove.Add(entry.Key);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\INamedTypeSymbolExtensions.cs (3)
612comparer.Equals(member.Name, kvp.Key.Name) && 613SignatureComparer.Instance.HaveSameSignature(member, kvp.Key, caseSensitive)); 617result.Remove(match.Key);
Microsoft.CodeAnalysis.Scripting (1)
ScriptBuilder.cs (1)
144var path = (referencedAssembly.Key as PortableExecutableReference)?.FilePath;
Microsoft.CodeAnalysis.VisualBasic (26)
Binding\Binder_Lambda.vb (2)
824Dim target As UnboundLambda.TargetSignature = pair.Key 834Dim target As UnboundLambda.TargetSignature = pair.Key
CommandLine\VisualBasicCommandLineParser.vb (1)
1836result(kvp.Key) = kvp.Value.ValueAsObject
Emit\SynthesizedPrivateImplementationDetailsSharedConstructor.vb (1)
80Dim analysisKind As Integer = payloadRoot.Key
Lowering\LocalRewriter\LocalRewriter_XmlLiterals.vb (1)
302prefixesBuilder.Add(CreateCompilerGeneratedXmlnsPrefix(syntax, pair.Key))
Symbols\Attributes\AttributeData.vb (2)
130stringBuilder.Append(namedArgument.Key) 385If namedArg.Key = filePropName AndAlso
Symbols\EmbeddedSymbols\EmbeddedSymbolManager.SymbolsCollection.vb (2)
121If Not filter.Contains(pair.Key) Then 122builder.Add(pair.Key)
Symbols\Metadata\PE\PENamespaceSymbol.vb (1)
205Dim ns = New PENestedNamespaceSymbol(child.Key, Me, child.Value)
Symbols\NamespaceSymbol.vb (1)
505map.Add(pair.Key, bucket)
Symbols\ReducedExtensionMethodSymbol.vb (3)
237curryTypeArguments(fixed.Key.Ordinal) = fixed.Value 286If TypeSymbol.Equals(pair.Key, reducedFromTypeParameter, TypeCompareKind.ConsiderEverything) Then 313resultTypeArguments(pair.Key.Ordinal) = pair.Value
Symbols\Source\SourceAssemblySymbol.vb (1)
1430If oneKey.Key.IsDefaultOrEmpty Then
Symbols\Source\SourceFieldSymbol.vb (1)
401Dim field As SourceFieldSymbol = pair.Key
Symbols\TypeSubstitution.vb (9)
140If p.Key.Equals(tp) Then Return p.Value 166result(p.Key.Ordinal) = p.Value.Type 196If p.Key.Ordinal = originalDefinition.Ordinal Then 551builder.AppendFormat("{0}->{1}", _pairs(i).Key.ToString(), _pairs(i).Value.Type.ToString()) 772haveSubstitutionForOrdinal(oldPairs(i).Key.Ordinal) = True 779If Not newValue.Is(oldPairs(i).Key) Then 780pairs.Add(New KeyValuePair(Of TypeParameterSymbol, TypeWithModifiers)(oldPairs(i).Key, newValue)) 788If haveSubstitutionForOrdinal.IsNull OrElse Not haveSubstitutionForOrdinal(additionalPair.Key.Ordinal) Then 905If Not pair.Key.Equals(pair.Value.Type.OriginalDefinition) Then
Syntax\VisualBasicSyntaxTree.ConditionalSymbolsMap.vb (1)
85Me.ProcessConditionalSymbolDefinition(kvPair.Key, kvPair.Value, 0)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (1)
Serialization\VisualBasicOptionsSerializationService.vb (1)
50writer.WriteString(kv.Key)
Microsoft.CodeAnalysis.Workspaces (85)
CodeCleanup\AbstractCodeCleanerService.cs (1)
595var tokenMap = map.ToDictionary(p => p.Key, p => p.Value);
CodeFixes\FixAllOccurrences\BatchFixAllProvider.cs (4)
69foreach (var group in docIdToTextMerger.GroupBy(kvp => kvp.Key.ProjectId)) 70currentSolution = await ApplyChangesAsync(currentSolution, group.SelectAsArray(kvp => (kvp.Key, kvp.Value)), cancellationToken).ConfigureAwait(false); 94if (kvp.Key.Project != fixAllContext.Project) 97if (fixAllContext.Document != null && fixAllContext.Document != kvp.Key)
CodeFixes\FixAllOccurrences\FixAllState.cs (2)
68var triggerDocument = diagnosticsToFix.First().Key; 90var triggerProject = diagnosticsToFix.First().Key;
CodeRefactorings\FixAllOccurences\RefactorAllState.cs (1)
102return spansByDocument.Select(kvp => KeyValuePair.Create(kvp.Key, new Optional<ImmutableArray<TextSpan>>(kvp.Value)))
Diagnostics\DiagnosticAnalysisResultBuilder.cs (1)
190: map.ToImmutableDictionary(kv => kv.Key, kv => kv.Value.ToImmutableArray());
Diagnostics\HostDiagnosticAnalyzers.cs (1)
269builder.Add(reference.Key, [.. analyzers.WhereNotNull()]);
Differencing\Match.cs (5)
43if (comparer.GetLabel(knownMatch.Key) != comparer.GetLabel(knownMatch.Value)) 45throw new ArgumentException(string.Format(WorkspacesResources.Matching_nodes_0_and_1_must_have_the_same_label, knownMatch.Key, knownMatch.Value), nameof(knownMatches)); 48if (!comparer.TreesEqual(knownMatch.Key, root1)) 50throw new ArgumentException(string.Format(WorkspacesResources.Node_0_must_be_contained_in_the_old_tree, knownMatch.Key), nameof(knownMatches)); 59TryAdd(knownMatch.Key, knownMatch.Value);
Differencing\Match.LongestCommonSubsequence.cs (1)
33result.Add(oldNodes[pair.Key], newNodes[pair.Value]);
Editing\SyntaxGenerator.cs (1)
1078.Concat(attribute.NamedArguments.Select(n => this.AttributeArgument(n.Key, this.TypedConstantExpression(n.Value))))
FindSymbols\FindReferences\DependentTypeFinder_ProjectIndex.cs (2)
83regularDocumentStates.States.Select(kvp => (kvp.Key, kvp.Value)).Concat( 84sourceGeneratorDocumentStates.States.Select(kvp => (kvp.Key, (DocumentState)kvp.Value)));
FindSymbols\FindReferences\FindReferencesSearchEngine.cs (1)
254ProcessDocumentAsync(kvp.Key, kvp.Value, symbolToGlobalAliases, onReferenceFound, cancellationToken)).ConfigureAwait(false);
FindSymbols\SymbolFinder_Helpers.cs (2)
128Contract.ThrowIfFalse(equivalentTypesWithDifferingAssemblies.All(kvp => !SymbolEquivalenceComparer.Instance.Equals(kvp.Key.ContainingAssembly, kvp.Value.ContainingAssembly))); 131Contract.ThrowIfFalse(equivalentTypesWithDifferingAssemblies.All(kvp => kvp.Key.ContainingType == null));
FindSymbols\SymbolFinder.FindReferencesServerCallback.cs (1)
60_definitionMap[pair.Key] = pair.Value;
FindSymbols\SymbolTree\SymbolTreeInfo_Serialization.cs (1)
122writer.WriteInt32(kvp.Key);
FindSymbols\TopLevelSyntaxTree\TopLevelSyntaxTreeIndex_Create.cs (1)
31static kvp => kvp.Key,
Log\AbstractLogAggregator.cs (1)
42=> _map.Select(static kvp => KeyValuePair.Create((TKey)kvp.Key, kvp.Value)).GetEnumerator();
Log\KeyValueLogMessage.cs (1)
187Append(builder, entry.Key);
Serialization\AbstractOptionsSerializationService.cs (4)
55foreach (var kv in options.SpecificDiagnosticOptions.OrderBy(o => o.Key)) 57writer.WriteString(kv.Key); 199foreach (var kv in options.Features.OrderBy(o => o.Key)) 201writer.WriteString(kv.Key);
Shared\Extensions\ILanguageMetadataExtensions.cs (2)
41return builder.Select(kvp => KeyValuePair.Create(kvp.Key, kvp.Value.ToImmutableAndFree())).ToImmutableDictionary(); 61return map.ToImmutableDictionary(kvp => kvp.Key, kvp => kvp.Value.ToImmutableAndFree());
Shared\TestHooks\AsynchronousOperationListenerProvider.cs (1)
244return _singletonListeners.Where(kv => featureNames.Contains(kv.Key)).Select(kv => (IAsynchronousOperationWaiter)kv.Value);
Shared\Utilities\DocumentationComment.cs (1)
155_comment._exceptionTexts.Add(typeAndBuilderPair.Key, typeAndBuilderPair.Value.AsImmutable());
src\b310f676f7308b7f\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (1)
241foreach (var (symbol, write) in SymbolsWriteBuilder.SelectAsArray(kvp => !kvp.Value, kvp => kvp.Key))
src\roslyn\src\Compilers\Core\Portable\Collections\SmallDictionary.cs (1)
57this.Add(kv.Key, kv.Value);
src\roslyn\src\Compilers\Core\Portable\DiagnosticAnalyzer\AnalyzerAssemblyLoader.cs (1)
396return _resolvedToOriginalPathMap.Select(x => (x.Value, x.Key)).ToImmutableArray();
src\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (1)
740var oldPrefix = kv.Key;
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\ConcurrentSet.cs (2)
125public T Current => _kvpEnumerator.Current.Key; 157yield return kvp.Key;
src\roslyn\src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (2)
833result.Add(entry.Key, createMembers(entry.Value)); 878dictionary.Add(entry.Key, namedTypes);
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (2)
185return TryGetValue(pair.Key, out var value) 240result[item.Key] = item.Value;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Enumerator.cs (2)
49readonly DictionaryEntry IDictionaryEnumerator.Entry => new(Current.Key, Current.Value); 51readonly object IDictionaryEnumerator.Key => Current.Key;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+KeyCollection+Enumerator.cs (1)
25public readonly TKey Current => _enumerator.Current.Key;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueBuilder.cs (6)
119=> Add(item.Key, item.Value); 127Add(pair.Key, pair.Value); 148return TryGetValue(item.Key, out var value) 192GetOrCreateMutableDictionary().Remove(item.Key); 213if (KeyComparer.Equals(pair.Key, equalKey)) 215actualKey = pair.Key;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (10)
210Add(pair.Key, pair.Value); 218Add(pair.Key, pair.Value); 271=> Add(keyValuePair.Key, keyValuePair.Value); 275ref var value = ref FindValue(keyValuePair.Key); 286ref var value = ref FindValue(keyValuePair.Key); 289Remove(keyValuePair.Key); 1234return new DictionaryEntry(_current.Key, _current.Value); 1237return new KeyValuePair<TKey, TValue>(_current.Key, _current.Value); 1261return new DictionaryEntry(_current.Key, _current.Value); 1274return _current.Key;
src\roslyn\src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
650dictionary.Add(pair.Key, pair.Value.ToImmutableAndFree());
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageResult.cs (4)
48=> SymbolWritesMap.SelectAsArray(kvp => !kvp.Value, kvp => kvp.Key); 59if (kvp.Key.write == null && Equals(kvp.Key.symbol, parameter)) 76if (Equals(kvp.Key.symbol, symbol))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser.cs (2)
97where kvp.Key.Trim().StartsWith("dotnet_naming_rule.", StringComparison.Ordinal) 98let nameSplit = kvp.Key.Split('.')
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BidirectionalMap.cs (1)
25backwardMap: ImmutableDictionary.CreateRange(valueComparer, pairs.Select(static p => KeyValuePair.Create(p.Value, p.Key))))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IDictionaryExtensions.cs (2)
239if (predicate(entry.Key, entry.Value, arg)) 241dictionary.Remove(entry.Key);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\INamedTypeSymbolExtensions.cs (3)
612comparer.Equals(member.Name, kvp.Key.Name) && 613SignatureComparer.Instance.HaveSameSignature(member, kvp.Key, caseSensitive)); 617result.Remove(match.Key);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (1)
246predicate: kvp => safeImportsToAdd.Contains(kvp.Key),
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\AbstractSemanticModelReuseLanguageService.cs (1)
44m[kv.Key.ToString()] = kv.Value.GetCount();
Workspace\ProjectSystem\ProjectSystemProject.BatchingDocumentCollection.cs (2)
261if (entry.Key != null) 263_documentPathsToDocumentIds.Remove(entry.Key);
Workspace\Solution\SolutionCompilationState.cs (2)
112Contract.ThrowIfTrue(_projectIdToTrackerMap.Any(kvp => kvp.Key != kvp.Value.ProjectState.Id)); 1767missingDocumentStates.SelectAsArray(kvp => (kvp.Key, kvp.Value.ToImmutableAndFree())),
Workspace\Workspace_Editor.cs (1)
283return _bufferToAssociatedDocumentsMap.Where(kvp => kvp.Value.Contains(documentId)).Select(kvp => kvp.Key).FirstOrDefault();
Workspace\Workspace.cs (1)
396var relatedDocumentIdsAndStatesArray = relatedDocumentIdsAndStates.SelectAsArray(static kvp => (kvp.Key, kvp.Value));
Microsoft.CodeAnalysis.Workspaces.MSBuild (1)
MSBuild\BuildHostProcessManager.cs (1)
220_processes.Remove(existingProcess.Value.Key);
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (4)
Build\ProjectBuildManager.cs (2)
87allProperties[kvp.Key] = kvp.Value; 222mergedGlobalProperties[pair.Key] = pair.Value;
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\ConcurrentSet.cs (2)
125public T Current => _kvpEnumerator.Current.Key; 157yield return kvp.Key;
Microsoft.CSharp (2)
Microsoft\CSharp\RuntimeBinder\ComInterop\ComTypeLibDesc.cs (1)
140retval[i++] = enumDesc.Key;
Microsoft\CSharp\RuntimeBinder\DynamicDebuggerProxy.cs (1)
100pairArray[i] = new DynamicProperty(results[i].Key, results[i].Value);
Microsoft.Data.Analysis (10)
DataFrame.cs (2)
627string columnName = columnAndValue.Key; 650string columnName = columnAndValue.Key;
DataFrame.Join.cs (2)
235newOccurrences = newOccurrences.ToDictionary(kvp => retainedIndicesReverseMapping[kvp.Key], kvp => kvp.Value); 259var newOccurrenceKey = newOccurrence.Key;
DataFrameColumn.cs (1)
490heapOfValueAndListOfTupleOfSortAndBufferIndex.Remove(minElement.Key);
DataFrameColumns\StringDataFrameColumn.cs (1)
390keys.Append(keyValuePair.Key);
GroupBy.cs (3)
125groupByColumnDelegate(rowNumber, pairs.Key); 134columnDelegate(columnIndex, rowNumber, rows, pairs.Key, firstGroup); 503return _keyToRowIndicesMap.Select(kvp => new Grouping(kvp.Key, kvp.Value.Select(index => _dataFrame.Rows[index])));
PrimitiveDataFrameColumn.cs (1)
388keys.Append(keyValuePair.Key);
Microsoft.Data.Analysis.Interactive (1)
TabularDataResourceExtensions.cs (1)
35return row.FirstOrDefault(kvp => kvp.Key == fieldName).Value;
Microsoft.Diagnostics.DataContractReader (6)
_generated\4\ContractDescriptorContext.DictionaryStringFieldDescriptor.g.cs (1)
61writer.WritePropertyName(entry.Key);
_generated\5\ContractDescriptorContext.DictionaryStringGlobalDescriptor.g.cs (1)
61writer.WritePropertyName(entry.Key);
_generated\6\ContractDescriptorContext.DictionaryStringTypeDescriptor.g.cs (1)
61writer.WritePropertyName(entry.Key);
_generated\7\ContractDescriptorContext.DictionaryStringJsonElement.g.cs (1)
61writer.WritePropertyName(entry.Key);
_generated\8\ContractDescriptorContext.DictionaryStringString.g.cs (1)
61writer.WriteString(entry.Key, entry.Value);
ContractDescriptorTarget.cs (1)
332yield return (subDescriptor.Key, descriptor.PointerData[(int)subDescriptor.Value.NumericValue]);
Microsoft.Diagnostics.DataContractReader.Contracts (1)
Contracts\GCInfo\X86\GCInfo.cs (1)
871int spOffset = (depthSlots - 1 - pushed.Key) * (int)_target.PointerSize;
Microsoft.Diagnostics.DataContractReader.DataGenerator (5)
Parser.cs (5)
105if (kv.Key == name && kv.Value.Value is bool b) 129if (kv.Key == name) 139if (kv.Key == name && kv.Value.Value is INamedTypeSymbol typeSymbol) 272bool usePropertyName = !fieldAttr.NamedArguments.Any(kv => kv.Key == "UsePropertyName" && kv.Value.Value is false); 309bool usePropertyName = !addrAttr.NamedArguments.Any(kv => kv.Key == "UsePropertyName" && kv.Value.Value is false);
Microsoft.Diagnostics.NETCore.Client (4)
DiagnosticsClient\EventPipeProvider.cs (4)
114string escapedKey = a.Key.Contains(';') || a.Key.Contains('=') ? $"\"{a.Key}\"" : a.Key;
Microsoft.DotNet.ApiCompatibility (5)
Comparing\NamedArgumentComparer.cs (2)
19x.Key.Equals(y.Key) && typedConstantEqualityComparer.Equals(x.Value, y.Value);
Mapping\AssemblyMapper.cs (1)
81INamespaceMapper mapper = AddMapper(kvp.Key, checkIfExists: true, typeForwardsOnly: true);
Rules\EnumsMustMatch.cs (2)
69if (!rightMembers.TryGetValue(lEntry.Key, out IFieldSymbol? rField)) 80string.Format(Resources.EnumValuesMustMatch, left.Name, lEntry.Key, lEntry.Value.ConstantValue, rField.ConstantValue),
Microsoft.DotNet.Arcade.Sdk (6)
src\InstallDotNetCore.cs (6)
85if (runtimeItems.SelectMany(r => r.Value).Select(r => r.Key).FirstOrDefault(f => !SemanticVersion.TryParse(f, out SemanticVersion version)) != null) 113if (!SemanticVersion.TryParse(item.Key, out version)) 115var propertyName = item.Key.Trim(s_keyTrimChars); 121Log.LogError($"Unable to find '{item.Key}' in properties defined in '{VersionsPropsPath}'"); 125Log.LogError($"Unable to parse '{item.Key}' from properties defined in '{VersionsPropsPath}'"); 132string runtime = runtimeItem.Key;
Microsoft.DotNet.Build.Manifest (9)
ArtifactModel.cs (3)
111if (other.Attributes.GetOrDefault(localAttr.Key) != null) 117other.Attributes.GetOrDefault(localAttr.Key), 135hash *= (item.Key, item.Value).GetHashCode();
BuildModelFactory.cs (1)
209attributes[attribute.Key] = NormalizeAzureDevOpsUrl(attribute.Value);
PdbArtifactModel.cs (1)
23hash *= (item.Key, item.Value).GetHashCode();
VersionIdentifier.cs (1)
245replacementIterationResult = replacementIterationResult.Replace(sequence.Key, sequence.Value);
XElementParsingExtensions.cs (3)
35.OrderBy(pair => keySortOrder.TakeWhile(o => pair.Key != o).Count()) 36.ThenBy(pair => pair.Key, StringComparer.OrdinalIgnoreCase) 37.Select(pair => new XAttribute(pair.Key, pair.Value))
Microsoft.DotNet.Build.Tasks.Installers (3)
src\CreateWixBuildWixpack.cs (1)
356string kv = $"{kvp.Key}={kvp.Value}";
src\RpmBuilder.cs (2)
348entries.Add(new((RpmHeaderTag)Enum.Parse(typeof(RpmHeaderTag), script.Key), RpmHeaderEntryType.String, script.Value)); 349entries.Add(new((RpmHeaderTag)Enum.Parse(typeof(RpmHeaderTag), $"{script.Key}prog"), RpmHeaderEntryType.String, "/bin/sh"));
Microsoft.DotNet.Build.Tasks.Packaging (42)
ApplyMetaPackages.cs (1)
122updatedDependencies.AddRange(metaPackagesToAdd.SelectMany(pair => pair.Value.Select(tfm => CreateDependency(pair.Key, tfm))));
GeneratePackageReport.cs (3)
92foreach (var framework in _frameworks.OrderBy(f => f.Key.ToString())) 94var fx = framework.Key; 325string packageSpecificTargetPath = AggregateNuGetAssetResolver.AsPackageSpecificTargetPath(packageSpecificItems.Key, packageItem.TargetPath);
GetApplicableAssetsFromPackages.cs (1)
181string packageSpecificTargetPath = AggregateNuGetAssetResolver.AsPackageSpecificTargetPath(packageFiles.Key, packageFile.TargetPath);
GetLastStablePackage.cs (1)
125LastStablePackages = lastStablePackages.Select(p => CreateItem(originalItems[p.Key], p.Value)).ToArray();
GetLayoutFiles.cs (1)
62var targetName = targetInfo.Key;
HarvestPackage.cs (1)
165resolver.AddPackageItems(packageFolder.Key, GetPackageItems(packageFolder.Value));
NuGetPack.cs (1)
297Log.LogMessage(LogImportance.Low, $"Nuspec {nuspecPath} does not contain any files matching {pathPair.Key}. Not creating symbol package.");
PackageIndex.cs (17)
161if (Packages.TryGetValue(otherPackage.Key, out info)) 167Packages[otherPackage.Key] = info = otherInfo; 179ModulesToPackages[otherModuleToPackage.Key] = otherModuleToPackage.Value; 288inboxFrameworks = info.InboxOn.GetInboxVersions().Where(p => p.Value >= assemblyVersion).Select(p => p.Key); 410InboxOn.AddInboxVersion(inboxOnPair.Key, inboxOnPair.Value); 415Version otherAssemblyVersion = assemblyVersionInPackage.Key; 518var existingFrameworkVersion = mapping.Key; 534redundantMappings.Add(mapping.Key); 559var fx = FromFrameworkKeyAndVersion(framework.Key, frameworkVersion); 572var frameworkVersion = frameworkInboxVersionPair.Key; 575var fx = FromFrameworkKeyAndVersion(framework.Key, frameworkVersion); 630var compatibleMapping = mappings.LastOrDefault(m => m.Key < normalizedFramework.Version); 631if (compatibleMapping.Key == null || compatibleMapping.Value == null) 728var shortName = frameworkPair.Key.GetShortFolderName(); 779if (!packageToMetaPackage.ContainsKey(metaPackage.Key)) 781packageToMetaPackage.Add(metaPackage.Key, metaPackage.Value); 788return packageToMetaPackage.GroupBy(p => p.Value, p => p.Key);
UpdatePackageIndex.cs (6)
192IEnumerable<Version> stablePackageVersions = NuGetUtility.GetAllVersionsForPackageId(package.Key, includePrerelease: false, includeUnlisted: false, Log, CancellationToken.None); 307.Where(pair => pair.Value == packageVersion && !assmVersions.Contains(pair.Key)) 308.Select(pair => pair.Key); 314.Where(p => p.Key.StartsWith("runtime.") && p.Key.EndsWith(id)) 317.Select(pair => pair.Key);
ValidateFrameworkPackage.cs (4)
48var name = testAssetByName.Key; 71var missingInboxAssemblies = _index.Packages.Where(packageInfo => packageInfo.Value.InboxOn.IsAnyVersionInbox(fx) && !testAssetsByName.ContainsKey(packageInfo.Key)); 75var logMissingPackage = permittedMissingInbox.Contains(missingInboxAssembly.Key) ? 79logMissingPackage($"File {missingInboxAssembly.Key}.dll is marked as inbox for framework {Framework} but was missing from framework package {_report.Id}/{_report.Version}. Either add the file or update {nameof(PackageInfo.InboxOn)} entry in {string.Join(";", _index.IndexSources)}. This may be suppressed with {nameof(Suppression.PermitMissingInbox)} suppression");
ValidatePackage.cs (6)
413.Where(pair => pair.Value == thisPackageVersion && !assemblyVersions.Contains(pair.Key)) 414.Select(pair => pair.Key); 592if (!_frameworks.ContainsKey(inboxPair.Key)) 594_frameworks[inboxPair.Key] = new ValidationFramework(inboxPair.Key) 616var framework = NuGetFramework.Parse(supportedFramework.Key);
Microsoft.DotNet.Cli.Definitions (1)
Utilities\OptionExtensions.cs (1)
81return properties.Select(kv => $"{optionName}:{kv.Key}={kv.Value}");
Microsoft.DotNet.Cli.Telemetry (7)
_generated\16\TelemetryJsonContext.DictionaryStringString.g.cs (1)
59writer.WriteString(entry.Key, entry.Value);
Implementation\AzureMonitorLogSerializer.cs (3)
57if (string.IsNullOrEmpty(scopeItem.Key) || scopeItem.Key == BreezeSchema.OriginalFormatKey) 80if (attribute.Key == BreezeSchema.OriginalFormatKey)
Implementation\AzureMonitorTelemetrySerializer.cs (1)
175switch (tag.Key)
Implementation\BreezeWriter.cs (1)
61key = tag.Key;
Implementation\TelemetryResourceContextFactory.cs (1)
35switch (attribute.Key)
Microsoft.DotNet.Cli.Utils (12)
ForwardingAppImplementation.cs (1)
83processInfo.Environment[entry.Key] = entry.Value;
MSBuildArgs.cs (3)
247newRestoreProperties[kvp.Key] = kvp.Value; 297newProperties[kvp.Key] = kvp.Value; 380newdict[restoreKvp.Key] = restoreKvp.Value;
MSBuildForwardingAppWithoutLogging.cs (7)
149return IsRestoreSources(property.Key) 150? $"--{label}:{property.Key}={Escape(property.Value)}" 151: $"--{label}:{property.Key}={property.Value}"; 242savedEnvironmentVariables[kvp.Key] = Environment.GetEnvironmentVariable(kvp.Key); 243Environment.SetEnvironmentVariable(kvp.Key, kvp.Value); 266Environment.SetEnvironmentVariable(kvp.Key, kvp.Value);
TelemetryEventEntry.cs (1)
75var appliedProperties = Properties?.ToDictionary(p => p.Key, p => (string?)func(p.Value ?? string.Empty));
Microsoft.DotNet.HotReload.Watch (15)
Aspire\AspireServiceFactory.cs (2)
104=> _service.GetServerConnectionEnvironment().Select(kvp => (kvp.Key, kvp.Value)); 247LaunchEnvironmentVariables = projectLaunchInfo.Environment?.Select(e => (e.Key, e.Value))?.ToArray() ?? [],
FileWatcher\FileWatcher.cs (2)
108var alreadyWatched = _directoryTreeWatchers.Any(d => directory.StartsWith(d.Key, PathUtilities.OSSpecificPathComparison)); 130.Where(d => d.Key.StartsWith(directory, PathUtilities.OSSpecificPathComparison))
HotReload\ProjectUpdatesBuilder.cs (2)
115.Where(e => IsAutoRestartEnabled(e.Key)) 297updates.ProjectsToRestart.SelectMany(e => RunningProjects.TryGetValue(GetRequiredProjectFilePath(e.Key), out var array) ? array : []));
HotReload\RunningProjectsManager.cs (1)
354builder.StaticAssetUpdates.Select(e => e.Key.Options.Representation)).Distinct());
Process\LaunchSettingsProfile.cs (4)
66string.Equals(kvp.Key, launchProfileName, StringComparison.Ordinal)).Value; 74string.Equals(kvp.Key, launchProfileName, StringComparison.OrdinalIgnoreCase)).Key; 101entry.Value.CommandName != null && supportedCommandNames.Contains(entry.Value.CommandName, StringComparer.Ordinal)).Key;
Process\ProcessRunner.cs (1)
171process.StartInfo.Environment.Add(env.Key, env.Value);
src\sdk\src\Dotnet.Watch\HotReloadClient\Web\StaticWebAssetsManifest.cs (3)
66var url = entry.Key; 91var url = entry.Key; 185var childName = entry.Key;
Microsoft.DotNet.ProjectTools (2)
_generated\3\LaunchProfileJsonSerializerContext.ImmutableDictionaryStringString.g.cs (1)
59writer.WriteString(entry.Key, entry.Value);
BuildService.cs (1)
101mergedGlobalProperties[pair.Key] = pair.Value;
Microsoft.DotNet.SharedFramework.Sdk (3)
src\GenerateSharedFrameworkDepsFile.cs (1)
102.Select(runtimeDict => runtimeGraph.ExpandRuntime(runtimeDict.Key))
src\ValidateFileVersions.cs (2)
76p.Key.EndsWith(".exe", StringComparison.OrdinalIgnoreCase) || 77p.Key.EndsWith(".dll", StringComparison.OrdinalIgnoreCase))
Microsoft.DotNet.TemplateLocator (25)
_generated\0\WorkloadSetJsonSerializerContext.DictionaryStringString.g.cs (1)
59writer.WriteString(entry.Key, entry.Value);
_generated\1\WorkloadSetJsonSerializerContext.IDictionaryStringString.g.cs (1)
59writer.WriteString(entry.Key, entry.Value);
_generated\9\InstallStateJsonSerializerContext.DictionaryStringString.g.cs (1)
59writer.WriteString(entry.Key, entry.Value);
src\sdk\src\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\SdkDirectoryWorkloadManifestProvider.cs (5)
408var manifestSpecifier = new ManifestSpecifier(kvp.Key, kvp.Value.Version, kvp.Value.FeatureBand); 429var manifestSpecifier = new ManifestSpecifier(kvp.Key, kvp.Value.Version, kvp.Value.FeatureBand); 463_knownManifestIdsAndOrder.TryGetValue(kvp.Key, out var order)) 469.ThenBy(kvp => kvp.Key, StringComparer.OrdinalIgnoreCase) 575var manifestSpecifier = new ManifestSpecifier(manifestEntry.Key, manifestEntry.Value.Version, manifestEntry.Value.FeatureBand);
src\sdk\src\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\WorkloadResolver.cs (11)
148if (_manifests.TryGetValue(dependency.Key, out var t)) 153throw new WorkloadManifestCompositionException(Strings.ManifestDependencyVersionTooLow, dependency.Key, resolvedDependency.Version, dependency.Value, manifest.Id, manifest.ManifestPath); 158throw new WorkloadManifestCompositionException(Strings.ManifestDependencyMissing, dependency.Key, manifest.Id, manifest.ManifestPath); 171if (!_workloads.TryAdd(workload.Key, ((WorkloadDefinition)workload.Value, manifest))) 173WorkloadManifest conflictingManifest = _workloads[workload.Key].manifest; 174throw new WorkloadManifestCompositionException(Strings.ConflictingWorkloadDefinition, workload.Key, manifest.Id, manifest.ManifestPath, conflictingManifest.Id, conflictingManifest.ManifestPath); 181if (!_packs.TryAdd(pack.Key, (pack.Value, manifest))) 183WorkloadManifest conflictingManifest = _packs[pack.Key].manifest; 184throw new WorkloadManifestCompositionException(Strings.ConflictingWorkloadPack, pack.Key, manifest.Id, manifest.ManifestPath, conflictingManifest.Id, conflictingManifest.ManifestPath); 397throw new Exception($"Workload not found: {workloadId}. Known workloads: {string.Join(" ", _workloads.Select(workload => workload.Key.ToString()))}"); 642overlayResolver._manifests.TryAdd(manifest.Key, manifest.Value);
src\sdk\src\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\WorkloadSet.cs (6)
45throw new FormatException(string.Format(Strings.InvalidVersionForWorkload, manifest.Key, manifestVersionString)); 57return (id: new ManifestId(manifest.Key), manifestVersion, manifestFeatureBand); 86if (workloadSet.ManifestVersions.ContainsKey(kvp.Key)) 88throw new InvalidOperationException($"Workload set files in {path} defined the same manifest ({kvp.Key}) multiple times"); 90workloadSet.ManifestVersions.Add(kvp.Key, kvp.Value); 112var dictionary = ManifestVersions.ToDictionary(kvp => kvp.Key.ToString(), kvp => kvp.Value.Version + "/" + kvp.Value.FeatureBand, StringComparer.OrdinalIgnoreCase);
Microsoft.DotNet.XliffTasks (1)
Model\JsonDocument.cs (1)
35=> _json.Select(kvp => new Node(_json, kvp.Key, kvp.Value)).OrderBy(entry => entry.Id);
Microsoft.Extensions.AI (14)
ChatCompletion\OpenTelemetryChatClient.cs (2)
384_ = activity.AddTag(prop.Key, prop.Value); 492_ = activity.AddTag(prop.Key, prop.Value);
ChatCompletion\OpenTelemetryImageGenerator.cs (1)
196_ = activity.AddTag(prop.Key, prop.Value);
ChatRouting\SemanticRoutingChatClient.cs (1)
134IChatClient client = profile.Key;
Common\OtelMessageSerializer.cs (1)
183Arguments = mstcc.Arguments as IReadOnlyDictionary<string, object?> ?? mstcc.Arguments?.ToDictionary(k => k.Key, v => v.Value),
Embeddings\OpenTelemetryEmbeddingGenerator.cs (2)
173_ = activity.AddTag(prop.Key, prop.Value); 242_ = activity.AddTag(prop.Key, prop.Value);
Files\OpenTelemetryHostedFileClient.cs (1)
407_ = activity.AddTag(prop.Key, prop.Value);
Realtime\OpenTelemetryRealtimeClientSession.cs (2)
603Arguments = mstcc.Arguments as IReadOnlyDictionary<string, object?> ?? mstcc.Arguments?.ToDictionary(k => k.Key, v => v.Value), 819_ = activity.AddTag(prop.Key, prop.Value);
SpeechToText\OpenTelemetrySpeechToTextClient.cs (2)
229_ = activity.AddTag(prop.Key, prop.Value); 314_ = activity.AddTag(prop.Key, prop.Value);
TextToSpeech\OpenTelemetryTextToSpeechClient.cs (2)
228_ = activity.AddTag(prop.Key, prop.Value); 309_ = activity.AddTag(prop.Key, prop.Value);
Microsoft.Extensions.AI.Abstractions (18)
AdditionalPropertiesDictionary{TValue}.cs (3)
48_dictionary.Add(item.Key, item.Value); 209_dictionary[item.Key] = item.Value; 256public AdditionalProperty[] Items => (from p in _properties select new AdditionalProperty(p.Key, p.Value)).ToArray();
Functions\AIFunctionFactory.cs (2)
660if (!expectedNames.Contains(kvp.Key)) 664$"The arguments dictionary contains an unexpected key '{kvp.Key}' that does not correspond to any parameter of '{Name}'.");
Generated\361d1da7f942c932\JsonContext.AdditionalPropertiesDictionaryInt64.g.cs (1)
59writer.WriteNumber(entry.Key, entry.Value);
SpeechToText\SpeechToTextResponseUpdateExtensions.cs (1)
120response.AdditionalProperties[entry.Key] = entry.Value;
TextToSpeech\TextToSpeechResponseUpdateExtensions.cs (1)
104response.AdditionalProperties[entry.Key] = entry.Value;
Tools\AITool.cs (1)
78_ = sb.Append(", ").Append(entry.Key).Append(" = ").Append(entry.Value);
UsageDetails.cs (3)
142AdditionalCounts[kvp.Key] = AdditionalCounts.TryGetValue(kvp.Key, out var existingValue) ? 206parts.Add($"{entry.Key} = {entry.Value}");
Utilities\AIJsonUtilities.cs (2)
175var entries = obj.OrderBy(e => e.Key, StringComparer.Ordinal).ToArray(); 180obj.Add(entry.Key, entry.Value);
Utilities\AIJsonUtilities.Schema.Create.cs (1)
833jsonObject[entry.Key] = entry.Value;
Utilities\AIJsonUtilities.Schema.Transform.cs (3)
74path?.Add(prop.Key); 75properties[prop.Key] = TransformSchemaCore(prop.Value, transformOptions, path); 138requiredProps.Add((JsonNode)prop.Key);
Microsoft.Extensions.AI.Abstractions.Tests (26)
AdditionalPropertiesDictionaryTests.cs (1)
127Assert.Equal($"key{count}", item.Key);
AssertExtensions.cs (5)
111if (!actual.TryGetValue(expectedEntry.Key, out object? actualValue)) 113throw new XunitException($"Expected parameter '{expectedEntry.Key}' not found in actual value."); 116AreJsonEquivalentValues(expectedEntry.Value, actualValue, options, propertyName: expectedEntry.Key); 122.Where(e => !expected.ContainsKey(e.Key)) 123.Select(e => $"'{e.Key}'")
Contents\FunctionCallContentTests.cs (9)
247""", TestJsonSerializerContext.Default.Options)!.ToDictionary(k => k.Key, k => (object?)k.Value); 268""", TestJsonSerializerContext.Default.Options)!.ToDictionary(k => k.Key, k => (object?)k.Value); 287""", TestJsonSerializerContext.Default.Options)!.ToDictionary(k => k.Key, k => (object?)k.Value)); 323""", TestJsonSerializerContext.Default.Options)!.ToDictionary(k => k.Key, k => (object?)k.Value)); 357Assert.Equal("Key1", kvp.Key); 362Assert.Equal("Key2", kvp.Key); 367Assert.Equal("Key3", kvp.Key); 372Assert.Equal("Key4", kvp.Key); 377Assert.Equal("Key5", kvp.Key);
Generated\361d1da7f942c932\TestJsonSerializerContext.AdditionalPropertiesDictionaryInt64.g.cs (1)
57writer.WriteNumber(entry.Key, entry.Value);
Generated\361d1da7f942c932\TestJsonSerializerContext.DictionaryStringJsonDocument.g.cs (1)
57writer.WritePropertyName(entry.Key);
Generated\361d1da7f942c932\TestJsonSerializerContext.DictionaryStringJsonNode.g.cs (1)
57writer.WritePropertyName(entry.Key);
Generated\361d1da7f942c932\TestJsonSerializerContext.DictionaryStringString.g.cs (1)
57writer.WriteString(entry.Key, entry.Value);
Generated\361d1da7f942c932\TestJsonSerializerContext.ReadOnlyDictionaryStringString.g.cs (1)
57writer.WriteString(entry.Key, entry.Value);
Generated\361d1da7f942c932\TestTypesContext.DictionaryStringInt32.g.cs (1)
59writer.WriteNumber(entry.Key, entry.Value);
Generated\361d1da7f942c932\TestTypesContext.DictionaryStringSimplePoco.g.cs (1)
59writer.WritePropertyName(entry.Key);
Generated\361d1da7f942c932\TestTypesContext.StructDictionaryStringInt32.g.cs (1)
53writer.WriteNumber(entry.Key, entry.Value);
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\TestTypesContext.DerivedDictionary.g.cs (1)
59writer.WriteNumber(entry.Key, entry.Value);
parent\parent\Shared\JsonSchemaExporter\SchemaTestHelpers.cs (1)
38.SelectMany(d => d.Errors!.Select(error => $"Path:${d.InstanceLocation} {error.Key}:{error.Value}"));
parent\parent\Shared\JsonSchemaExporter\TestTypes.cs (1)
1172private readonly IReadOnlyDictionary<TKey, TValue> _dictionary = values.ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
Microsoft.Extensions.AI.Evaluation (1)
EvaluationMetricExtensions.cs (1)
135metric.AddOrUpdateMetadata(item.Key, item.Value);
Microsoft.Extensions.AI.Evaluation.Console (1)
Telemetry\TelemetryHelper.cs (1)
178combinedProperties.Add(kvp.Key, kvp.Value);
Microsoft.Extensions.AI.Evaluation.NLP (9)
Common\BLEUAlgorithm.cs (6)
82if (maxCounts.TryGetValue(ct.Key, out int val)) 84maxCounts[ct.Key] = Math.Max(val, ct.Value); 88maxCounts[ct.Key] = ct.Value; 96if (maxCounts.TryGetValue(h.Key, out var v)) 98clippedCounts[h.Key] = Math.Min(h.Value, v); 103clippedCounts[h.Key] = 0;
Common\MatchCounter.cs (3)
66if (larger.TryGetValue(kvp.Key, out int otherCount)) 68intersection._counts[kvp.Key] = Math.Min(kvp.Value, otherCount); 75public string ToDebugString() => string.Join(",", _counts.Select(v => $"{v.Key}: {v.Value}"));
Microsoft.Extensions.AI.Evaluation.Reporting (4)
Generated\361d1da7f942c932\JsonContext.AdditionalPropertiesDictionaryInt64.g.cs (1)
59writer.WriteNumber(entry.Key, entry.Value);
Generated\361d1da7f942c932\JsonContext.IDictionaryStringEvaluationContext.g.cs (1)
59writer.WritePropertyName(entry.Key);
Generated\361d1da7f942c932\JsonContext.IDictionaryStringEvaluationMetric.g.cs (1)
59writer.WritePropertyName(entry.Key);
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\JsonContext.IDictionaryStringString.g.cs (1)
59writer.WriteString(entry.Key, entry.Value);
Microsoft.Extensions.AI.Evaluation.Reporting.Azure (4)
Generated\361d1da7f942c932\JsonContext.AdditionalPropertiesDictionaryInt64.g.cs (1)
59writer.WriteNumber(entry.Key, entry.Value);
Generated\361d1da7f942c932\JsonContext.IDictionaryStringEvaluationContext.g.cs (1)
59writer.WritePropertyName(entry.Key);
Generated\361d1da7f942c932\JsonContext.IDictionaryStringEvaluationMetric.g.cs (1)
59writer.WritePropertyName(entry.Key);
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\JsonContext.IDictionaryStringString.g.cs (1)
59writer.WriteString(entry.Key, entry.Value);
Microsoft.Extensions.AI.Integration.Tests (5)
PromptBasedFunctionCallingChatClient.cs (1)
155arguments[kvp.Key] = jsonElement.ValueKind switch
VerbatimHttpHandler.cs (1)
60newContent.Headers.TryAddWithoutValidation(header.Key, header.Value);
VerbatimMultiPartHttpHandler.cs (3)
235if (!actualFrequencies.ContainsKey(kvp.Key) || kvp.Value != actualFrequencies[kvp.Key]) 241Assert.Equal(kvp.Value, actualFrequencies[kvp.Key]);
Microsoft.Extensions.AI.OpenAI (6)
Generated\361d1da7f942c932\OpenAIJsonContext.DictionaryStringJsonElement.g.cs (1)
57writer.WritePropertyName(entry.Key);
OpenAIRealtimeClientSession.cs (3)
257metadata[kvp.Key] = BinaryData.FromString(kvp.Value?.ToString() ?? string.Empty); 563sdkHeaders[kvp.Key] = kvp.Value; 953dict[kvp.Key] = kvp.Value;
OpenAIResponsesChatClient.cs (2)
1064result.Tools.Add(ToNamespaceResponseTool(kvp.Key.Name, kvp.Key.Description, kvp.Value));
Microsoft.Extensions.AI.OpenAI.Tests (5)
parent\Microsoft.Extensions.AI.Abstractions.Tests\AssertExtensions.cs (5)
111if (!actual.TryGetValue(expectedEntry.Key, out object? actualValue)) 113throw new XunitException($"Expected parameter '{expectedEntry.Key}' not found in actual value."); 116AreJsonEquivalentValues(expectedEntry.Value, actualValue, options, propertyName: expectedEntry.Key); 122.Where(e => !expected.ContainsKey(e.Key)) 123.Select(e => $"'{e.Key}'")
Microsoft.Extensions.AI.Stabilization.Tests (1)
Generated\361d1da7f942c932\AIContentSerializationRegressionContext.AdditionalPropertiesDictionaryInt64.g.cs (1)
57writer.WriteNumber(entry.Key, entry.Value);
Microsoft.Extensions.AI.Tests (25)
ChatCompletion\FunctionInvokingChatClientTests.cs (7)
1140var args = Assert.Single(executeTool.Tags, t => t.Key == "gen_ai.tool.call.arguments"); 1145var result = Assert.Single(executeTool.Tags, t => t.Key == "gen_ai.tool.call.result"); 1150Assert.DoesNotContain(executeTool.Tags, t => t.Key == "gen_ai.tool.call.arguments"); 1151Assert.DoesNotContain(executeTool.Tags, t => t.Key == "gen_ai.tool.call.result"); 1929var hasArguments = executeToolActivity.Tags.Any(t => t.Key == "gen_ai.tool.call.arguments"); 1930var hasResult = executeToolActivity.Tags.Any(t => t.Key == "gen_ai.tool.call.result"); 1937var argsTag = Assert.Single(executeToolActivity.Tags, t => t.Key == "gen_ai.tool.call.arguments");
ChatCompletion\OpenTelemetryChatClientTests.cs (6)
208var tags = activity.Tags.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); 469var inputMessages = activity.Tags.First(kvp => kvp.Key == "gen_ai.input.messages").Value; 524var outputMessages = activity.Tags.First(kvp => kvp.Key == "gen_ai.output.messages").Value; 617var inputMessages = activity.Tags.First(kvp => kvp.Key == "gen_ai.input.messages").Value; 723var outputMessages = activity.Tags.First(kvp => kvp.Key == "gen_ai.output.messages").Value; 858var inputMessages = activity.Tags.First(kvp => kvp.Key == "gen_ai.input.messages").Value;
Generated\361d1da7f942c932\TestJsonSerializerContext.AdditionalPropertiesDictionaryInt64.g.cs (1)
57writer.WriteNumber(entry.Key, entry.Value);
Generated\361d1da7f942c932\TestJsonSerializerContext.DictionaryStringJsonDocument.g.cs (1)
57writer.WritePropertyName(entry.Key);
Generated\361d1da7f942c932\TestJsonSerializerContext.DictionaryStringJsonNode.g.cs (1)
57writer.WritePropertyName(entry.Key);
Generated\361d1da7f942c932\TestJsonSerializerContext.DictionaryStringString.g.cs (1)
57writer.WriteString(entry.Key, entry.Value);
Image\OpenTelemetryImageGeneratorTests.cs (1)
117var tags = activity.Tags.ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
parent\Microsoft.Extensions.AI.Abstractions.Tests\AssertExtensions.cs (5)
111if (!actual.TryGetValue(expectedEntry.Key, out object? actualValue)) 113throw new XunitException($"Expected parameter '{expectedEntry.Key}' not found in actual value."); 116AreJsonEquivalentValues(expectedEntry.Value, actualValue, options, propertyName: expectedEntry.Key); 122.Where(e => !expected.ContainsKey(e.Key)) 123.Select(e => $"'{e.Key}'")
Realtime\OpenTelemetryRealtimeClientTests.cs (1)
148var tags = activity.Tags.ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
SpeechToText\OpenTelemetrySpeechToTextClientTests.cs (1)
128var tags = activity.Tags.ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
Microsoft.Extensions.Caching.Hybrid.Tests (2)
TestEventListener.cs (2)
79switch (pair.Key) 170Assert.Fail($"{pair.Key}: expected 0, actual {pair.Value.value}");
Microsoft.Extensions.Caching.Memory (2)
MemoryCache.cs (2)
855yield return pairs.Key; 859yield return pairs.Key;
Microsoft.Extensions.Compliance.Redaction (1)
RedactorProvider.cs (1)
53dict[m.Key] = r;
Microsoft.Extensions.Configuration (6)
ConfigurationProvider.cs (5)
71results.Add(Segment(kv.Key, 0)); 80if (kv.Key.Length > parentPath.Length && 81kv.Key.StartsWith(parentPath, StringComparison.OrdinalIgnoreCase) && 82kv.Key[parentPath.Length] == ':') 84results.Add(Segment(kv.Key, parentPath.Length + 1));
MemoryConfigurationProvider.cs (1)
31Data.Add(pair.Key, pair.Value);
Microsoft.Extensions.Configuration.CommandLine (5)
CommandLineConfigurationProvider.cs (5)
144if (!mapping.Key.StartsWith('-')) 147SR.Format(SR.Error_InvalidSwitchMapping, mapping.Key), 151if (switchMappingsCopy.ContainsKey(mapping.Key)) 154SR.Format(SR.Error_DuplicatedKeyInSwitchMappings, mapping.Key), 158switchMappingsCopy.Add(mapping.Key, mapping.Value);
Microsoft.Extensions.DataIngestion (3)
Writers\VectorStoreWriter.cs (3)
92record[metadata.Key] = metadata.Value; 148definition.Properties.Add(new VectorStoreDataProperty(metadata.Key, propertyType) 152StorageName = metadata.Key.ToLowerInvariant()
Microsoft.Extensions.DataIngestion.Tests (3)
Writers\VectorStoreWriterTests.cs (3)
55Assert.True(record.ContainsKey(kvp.Key), $"Record does not contain key '{kvp.Key}'"); 56Assert.Equal(kvp.Value, record[kvp.Key]);
Microsoft.Extensions.DependencyInjection (3)
ServiceLookup\CallSiteChain.cs (1)
56ServiceIdentifier serviceIdentifier = pair.Key;
ServiceLookup\CallSiteFactory.cs (2)
366callSitesByIndex.Sort((a, b) => a.Key.CompareTo(b.Key));
Microsoft.Extensions.Diagnostics (6)
Metrics\Configuration\MetricsConfigureOptions.cs (1)
101var instrumentName = instrumentPair.Key;
src\runtime\src\libraries\Common\src\System\Diagnostics\DiagnosticsHelper.cs (4)
61if (pair.Key == pair1.Key && object.Equals(pair.Value, pair1.Value)) 101if (pair.Key == pair1.Key && object.Equals(pair.Value, pair1.Value))
Tracing\Configuration\TracingConfigureOptions.cs (1)
94var operationName = activityPair.Key;
Microsoft.Extensions.Diagnostics.HealthChecks (1)
DefaultHealthCheckService.cs (1)
321builder.Append(kvp.Key);
Microsoft.Extensions.Diagnostics.HealthChecks.Common (3)
ManualHealthCheckTracker.cs (1)
37var check = checkPair.Key.Result;
TelemetryHealthCheckPublisher.cs (2)
63_metrics.UnhealthyHealthCheckCounter.RecordMetric(entry.Key, entry.Value.Status); 67.Append(entry.Key)
Microsoft.Extensions.Diagnostics.ResourceMonitoring (5)
Windows\Disk\WindowsDiskMetrics.cs (5)
141measurements.Add(new Measurement<long>(pair.Value, new TagList { _directionWriteTag, new(DeviceKey, pair.Key) })); 150measurements.Add(new Measurement<long>(pair.Value, new TagList { _directionReadTag, new(DeviceKey, pair.Key) })); 166measurements.Add(new Measurement<long>(pair.Value, new TagList { _directionWriteTag, new(DeviceKey, pair.Key) })); 175measurements.Add(new Measurement<long>(pair.Value, new TagList { _directionReadTag, new(DeviceKey, pair.Key) })); 190measurements.Add(new Measurement<double>(pair.Value, new TagList { new(DeviceKey, pair.Key) }));
Microsoft.Extensions.Diagnostics.Testing (6)
Logging\FakeLogger.cs (2)
151l.Add(new KeyValuePair<string, string?>(pair.Key, ConvertToString(pair))); 155l.Add(new KeyValuePair<string, string?>(pair.Key, null));
Logging\FakeLoggerProvider.cs (1)
98internal string FirstLoggerName => _loggers.First().Key;
Logging\FakeLogRecord.cs (1)
81if (kvp.Key == key)
Metrics\CollectedMeasurement.cs (2)
31d[tag.Key] = tag.Value; 63if (!Tags.TryGetValue(kvp.Key, out var value))
Microsoft.Extensions.Diagnostics.Testing.Tests (2)
Logging\FakeLoggerTests.cs (2)
86var ss = logger.LatestRecord.StructuredState!.ToDictionary(x => x.Key, x => x.Value); 102ss = logger.LatestRecord.StructuredState!.ToDictionary(x => x.Key, x => x.Value);
Microsoft.Extensions.Features (4)
FeatureCollection.cs (3)
150return x.Key.Equals(y.Key); 155return obj.Key.GetHashCode();
src\aspnetcore\src\Shared\Debugger\DictionaryItemDebugView.cs (1)
23Key = keyValue.Key;
Microsoft.Extensions.FileProviders.Physical (5)
PhysicalFilesWatcher.cs (5)
427if (tokens.TryRemove(entry.Key, out ChangeTokenInfo matchInfo)) 429if (requiresSubdirectories(entry.Key)) 542_wildcardTokenLookup.TryRemove(wildCardEntry.Key, out matchInfo)) 544if (WildcardRequiresSubdirectories(wildCardEntry.Key)) 843IPollingChangeToken token = item.Key;
Microsoft.Extensions.FileSystemGlobbing (1)
InMemoryDirectoryInfo.cs (1)
130yield return new InMemoryDirectoryInfo(item.Key, item.Value, true, _comparisonType);
Microsoft.Extensions.Hosting.Testing.Tests (12)
FakeConfigurationSourceTests.cs (2)
22Assert.Equal("testKey", item.Key); 27Assert.Equal("anotherTestKey", item.Key);
HostingFakesExtensionsTests.cs (10)
146Assert.Equal("testKey", item.Key); 172Assert.Equal("testKey1", item.Key); 177Assert.Equal("testKey2", item.Key); 201Assert.Equal("testKey", item.Key); 206Assert.Equal("anotherTestKey", item.Key); 232Assert.Equal("testKey", item.Key); 258Assert.Equal("testKey1", item.Key); 263Assert.Equal("testKey2", item.Key); 287Assert.Equal("testKey", item.Key); 292Assert.Equal("anotherTestKey", item.Key);
Microsoft.Extensions.Http (3)
Logging\HttpHeadersLogValue.cs (3)
82string value = _shouldRedactHeaderValue(kvp.Key) 89values.Add(new KeyValuePair<string, object>(kvp.Key, value)); 122builder.Append(kvp.Key);
Microsoft.Extensions.Http.Diagnostics (6)
Http\HttpDependencyMetadataResolver.cs (1)
187finalArrayDict.Add(dep.Key, finalArray);
Logging\Internal\HttpHeadersReader.cs (1)
103var header = kvp.Key;
Logging\Internal\HttpResponseBodyReader.cs (1)
123_ = newContent.Headers.TryAddWithoutValidation(header.Key, header.Value);
Logging\Internal\Log.cs (1)
180if (kvp.Key == HttpClientLoggingTagNames.Method)
Logging\Internal\LoggerMessageStateExtensions.cs (2)
29items[i].Key, 48items[i].Key,
Microsoft.Extensions.Http.Diagnostics.Tests (68)
Logging\AcceptanceTests.cs (11)
127state!.Single(kvp => kvp.Key == enricher2!.KvpRequest.Key).Value.Should().Be(enricher2!.KvpRequest.Value!.ToString()); 326state!.Single(kvp => kvp.Key == HttpClientLoggingTagNames.Path).Value.Should().Be(redactedPath); 369.ContainSingle(kvp => kvp.Key == HttpClientLoggingTagNames.Path) 372state.Should().ContainSingle(kvp => kvp.Key == HttpClientLoggingTagNames.Host) 375state.Should().ContainSingle(kvp => kvp.Key == HttpClientLoggingTagNames.Method) 378state.Should().ContainSingle(kvp => kvp.Key == HttpClientLoggingTagNames.StatusCode) 381state.Should().ContainSingle(kvp => kvp.Key == HttpClientLoggingTagNames.Duration) 393state.Should().ContainSingle(kvp => kvp.Key == "userId").Which.Value.Should().Be(expectedUserId); 394state.Should().ContainSingle(kvp => kvp.Key == "unitId").Which.Value.Should().Be(expectedUnitId); 438state!.Single(kvp => kvp.Key == HttpClientLoggingTagNames.Path).Value.Should().Be(redactedPath);
Logging\HttpClientLoggerTest.cs (21)
254logRecordState.Contains(testEnricher.KvpRequest.Key, expectedLogRecord.GetEnrichmentProperty(testEnricher.KvpRequest.Key)); 347logRecordRequest.NotContains(testEnricher.KvpRequest.Key); 360logRecordFull.Contains(testEnricher.KvpRequest.Key, expectedLogRecord.GetEnrichmentProperty(testEnricher.KvpRequest.Key)); 361logRecordFull.Contains(testEnricher.KvpResponse.Key, expectedLogRecord.GetEnrichmentProperty(testEnricher.KvpResponse.Key)); 455logRecordState.Contains(testEnricher.KvpRequest.Key, expectedLogRecord.GetEnrichmentProperty(testEnricher.KvpRequest.Key)); 456logRecordState.NotContains(testEnricher.KvpResponse.Key); 458Assert.DoesNotContain(logRecordState, kvp => kvp.Key.StartsWith(HttpClientLoggingTagNames.ResponseHeaderPrefix)); 571logRecordState.Contains(testEnricher.KvpRequest.Key, expectedLogRecord.GetEnrichmentProperty(testEnricher.KvpRequest.Key)); 572logRecordState.Contains(testEnricher.KvpResponse.Key, expectedLogRecord.GetEnrichmentProperty(testEnricher.KvpResponse.Key)); 574Assert.DoesNotContain(logRecordState, kvp => kvp.Key.StartsWith(HttpClientLoggingTagNames.ResponseHeaderPrefix)); 664logRecordState.Contains(testEnricher.KvpRequest.Key, expectedLogRecord.GetEnrichmentProperty(testEnricher.KvpRequest.Key)); 939logRecordState.Contains(testEnricher.KvpRequest.Key, expectedLogRecord.GetEnrichmentProperty(testEnricher.KvpRequest.Key)); 1039Assert.Equal("{OriginalFormat}", pair.Key);
Logging\HttpRequestReaderTest.cs (31)
64RequestHeadersDataClasses = new Dictionary<string, DataClassification> { { header1.Key, FakeTaxonomy.PrivateData }, { header3.Key, FakeTaxonomy.PrivateData } }, 65ResponseHeadersDataClasses = new Dictionary<string, DataClassification> { { header2.Key, FakeTaxonomy.PrivateData }, { header3.Key, FakeTaxonomy.PrivateData } }, 90httpRequestMessage.Headers.Add(header1.Key, header1.Value); 91httpRequestMessage.Headers.Add(header3.Key, header3.Value); 99httpResponseMessage.Headers.Add(header2.Key, header2.Value); 100httpResponseMessage.Headers.Add(header3.Key, header3.Value); 194RequestHeadersDataClasses = new Dictionary<string, DataClassification> { { header1.Key, FakeTaxonomy.PrivateData } }, 195ResponseHeadersDataClasses = new Dictionary<string, DataClassification> { { header2.Key, FakeTaxonomy.PrivateData } }, 220httpRequestMessage.Headers.Add(header1.Key, header1.Value); 232httpResponseMessage.Headers.Add(header2.Key, header2.Value); 269RequestHeadersDataClasses = new Dictionary<string, DataClassification> { { header1.Key, FakeTaxonomy.PrivateData } }, 270ResponseHeadersDataClasses = new Dictionary<string, DataClassification> { { header2.Key, FakeTaxonomy.PrivateData } }, 296httpRequestMessage.Headers.Add(header1.Key, header1.Value); 308httpResponseMessage.Headers.Add(header2.Key, header2.Value); 344RequestHeadersDataClasses = new Dictionary<string, DataClassification> { { header1.Key, FakeTaxonomy.PrivateData } }, 369httpRequestMessage.Headers.Add(header1.Key, header1.Value); 403RequestHeadersDataClasses = new Dictionary<string, DataClassification> { { header1.Key, FakeTaxonomy.PrivateData } }, 404ResponseHeadersDataClasses = new Dictionary<string, DataClassification> { { header2.Key, FakeTaxonomy.PrivateData } }, 429httpRequestMessage.Headers.Add(header1.Key, header1.Value); 441httpResponseMessage.Headers.Add(header2.Key, header2.Value); 476RequestHeadersDataClasses = new Dictionary<string, DataClassification> { { header1.Key, FakeTaxonomy.PrivateData } }, 477ResponseHeadersDataClasses = new Dictionary<string, DataClassification> { { header2.Key, FakeTaxonomy.PrivateData } }, 502httpRequestMessage.Headers.Add(header1.Key, header1.Value); 510httpResponseMessage.Headers.Add(header2.Key, header2.Value); 545RequestHeadersDataClasses = new Dictionary<string, DataClassification> { { header1.Key, FakeTaxonomy.PrivateData } }, 546ResponseHeadersDataClasses = new Dictionary<string, DataClassification> { { header2.Key, FakeTaxonomy.PrivateData } }, 571httpRequestMessage.Headers.Add(header1.Key, header1.Value); 580httpResponseMessage.Headers.Add(header2.Key, header2.Value); 820tag => tag.Key == "url.query" && (tag.Value!).Contains("userId=REDACTED"));
Logging\Internal\LogRecordExtensions.cs (1)
19return logRecord.StructuredState.ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
Logging\Internal\TestEnricher.cs (2)
38tagCollector.Add(KvpRequest.Key, KvpRequest.Value!); 43tagCollector.Add(KvpResponse.Key, KvpResponse.Value!);
Logging\LoggerMessageStateExtensionsTests.cs (2)
45Assert.Equal(prefix + NormalizedHeader1, state.TagArray[0].Key); 48Assert.Equal(prefix + NormalizedHeader2, state.TagArray[1].Key);
Microsoft.Extensions.Http.Resilience (1)
Internal\RequestMessageSnapshot.cs (1)
53_ = clone.Headers.TryAddWithoutValidation(header.Key, header.Value);
Microsoft.Extensions.Http.Resilience.Tests (4)
Helpers\OptionsUtilities.cs (1)
36var propertyName = propertyDefinition1.Key;
Resilience\HttpClientBuilderExtensionsTests.Resilience.cs (1)
371Tags[tag.Key] = tag.Value;
Resilience\HttpResilienceMetricsEnricherTests.cs (1)
54tags[0].Key.Should().Be("error.type");
Routing\RoutingStrategyTest.cs (1)
168return new ConfigurationBuilder().AddInMemoryCollection(values.Select(pair => new KeyValuePair<string, string?>("section:" + pair.Key, pair.Value))).Build().GetSection("section");
Microsoft.Extensions.Identity.Core (1)
UserManager.cs (1)
1964results.Add(f.Key);
Microsoft.Extensions.Logging (6)
LoggerFactory.cs (1)
189loggerInformation[newLoggerIndex] = new LoggerInformation(provider, existingLogger.Key);
LoggerFactoryScopeProvider.cs (5)
192sb.Append(_items[0].Key); 199sb.Append(_items[i].Key); 249_stringBuilder.Append(enumerator.Current.Key); 256_stringBuilder.Append(enumerator.Current.Key); 276public KeyValuePair<string, object?> Current => new KeyValuePair<string, object?>(_enumerator.Current.Key, _enumerator.Current.Value);
Microsoft.Extensions.Logging.Configuration (1)
LoggerFilterConfigureOptions.cs (1)
61string? category = section.Key;
Microsoft.Extensions.Logging.Console (1)
JsonConsoleFormatter.cs (1)
161var key = item.Key;
Microsoft.Extensions.Logging.EventLog (1)
EventLogLogger.cs (1)
104sb.Append(pair.Key).Append(": ").AppendLine(pair.Value?.ToString());
Microsoft.Extensions.Logging.EventSource (2)
EventSourceLogger.cs (2)
265arguments[i] = new KeyValuePair<string, string?>(keyValuePair.Key, keyValuePair.Value?.ToString()); 286writer.WriteString(keyValue.Key, keyValue.Value);
Microsoft.Extensions.Logging.Generators (11)
LoggerMessageGenerator.Emitter.cs (3)
245ReadOnlySpan<char> template = RemoveSpecialSymbol(t.Key.AsSpan()); 260_builder.AppendLine($" {nestedIndentation}var {t.Key} = " 267_builder.AppendLine($" {nestedIndentation}var {t.Key} = this.{NormalizeSpecialSymbol(lm.TemplateParameters[index].CodeName)};");
LoggerMessageGenerator.Parser.cs (7)
202switch (namedArgument.Key) 527if (t.Key.Equals(p.Name, StringComparison.OrdinalIgnoreCase) || 528t.Key.Equals(p.CodeName, StringComparison.OrdinalIgnoreCase) || 529t.Key[0] == '@' && t.Key.Substring(1).Equals(p.CodeName, StringComparison.OrdinalIgnoreCase)) 538Diag(DiagnosticDescriptors.TemplateHasNoCorrespondingArgument, ma.GetLocation(), t.Key); 1034TemplateMap = TemplateMap.Select(kvp => new KeyValuePairEquatable<string, string>(kvp.Key, kvp.Value)).ToImmutableEquatableArray(),
LoggerMessageGenerator.Roslyn4.0.cs (1)
208.OrderBy(static kvp => kvp.Key, System.StringComparer.Ordinal)
Microsoft.Extensions.Logging.MSBuild (4)
MSBuildLogger.cs (4)
118switch (kvp.Key) 180var wrappedKey = "{" + kvp.Key + "}"; 183builder.Append($" {kvp.Key}={kvp.Value}"); 197switch (kvp.Key)
Microsoft.Extensions.Options.SourceGeneration (16)
Emitter.cs (13)
633var attributesData = _optionsSourceGenContext.AttributesToGenerate.OrderBy(static kvp => kvp.Key, StringComparer.Ordinal).ToArray(); 640if (attributeData.Key == _symbolHolder.MaxLengthAttributeSymbol.Name) 643EmitMaxLengthAttribute(_optionsSourceGenContext.ClassModifier, Emitter.StaticAttributeClassNamePrefix, attributeData.Key, linesToInsert, _optionsSourceGenContext.Suffix); 645else if (attributeData.Key == _symbolHolder.MinLengthAttributeSymbol.Name) 648EmitMinLengthAttribute(_optionsSourceGenContext.ClassModifier, Emitter.StaticAttributeClassNamePrefix, attributeData.Key, linesToInsert, _optionsSourceGenContext.Suffix); 650else if (_symbolHolder.LengthAttributeSymbol is not null && attributeData.Key == _symbolHolder.LengthAttributeSymbol.Name) 653EmitLengthAttribute(_optionsSourceGenContext.ClassModifier, Emitter.StaticAttributeClassNamePrefix, attributeData.Key, linesToInsert, _optionsSourceGenContext.Suffix); 655else if (attributeData.Key == _symbolHolder.CompareAttributeSymbol.Name && attributeData.Value is not null) 658EmitCompareAttribute(_optionsSourceGenContext.ClassModifier, Emitter.StaticAttributeClassNamePrefix, attributeData.Key, linesToInsert: linesToInsert, _optionsSourceGenContext.Suffix); 660else if (attributeData.Key == _symbolHolder.RangeAttributeSymbol.Name) 662EmitRangeAttribute(_optionsSourceGenContext.ClassModifier, Emitter.StaticAttributeClassNamePrefix, attributeData.Key, _optionsSourceGenContext.Suffix, attributeData.Value is not null); 1209.OrderBy(p => p.Key) 1216attrInstantiationStatementLines.Add($"{GetPaddingString(1)}{prop.Key} = {prop.Value}{(notLast ? "," : string.Empty)}");
Parser.cs (3)
646bool isParams = lastParameterDeclaredWithParamsKeyword && namedArgument.Key == parameters[parameters.Length - 1].Name; 647validationAttr.Properties.Add(namedArgument.Key, GetArrayArgumentExpression(namedArgument.Value.Values, isParams)); 651validationAttr.Properties.Add(namedArgument.Key, GetArgumentExpression(namedArgument.Value.Type!, namedArgument.Value.Value));
Microsoft.Extensions.Resilience.Tests (1)
Resilience\ResilienceMetricsEnricherTests.cs (1)
26private IReadOnlyDictionary<string, object?> Tags => _tags.ToDictionary(v => v.Key, v => v.Value);
Microsoft.Extensions.ServiceDiscovery (3)
parent\parent\Shared\FxPolyfills\ConcurrentDictionary.cs (2)
37if (dictionary.TryRemove(pair.Key, out var existing) && !EqualityComparer<TValue>.Default.Equals(existing, pair.Value)) 39dictionary.TryAdd(pair.Key, pair.Value);
parent\parent\Shared\FxPolyfills\KeyValuePair.cs (1)
12key = pair.Key;
Microsoft.Extensions.ServiceDiscovery.Abstractions (3)
parent\parent\Shared\FxPolyfills\ConcurrentDictionary.cs (2)
37if (dictionary.TryRemove(pair.Key, out var existing) && !EqualityComparer<TValue>.Default.Equals(existing, pair.Value)) 39dictionary.TryAdd(pair.Key, pair.Value);
parent\parent\Shared\FxPolyfills\KeyValuePair.cs (1)
12key = pair.Key;
Microsoft.Extensions.Telemetry (11)
Buffering\StringifyComprarer.cs (3)
13if (x.Key != y.Key) 33return HashCode.Combine(obj.Key, obj.Value?.ToString());
Enrichment\ApplicationLogEnricher.cs (1)
29collector.Add(kvp.Key, kvp.Value);
Logging\ExtendedLoggerFactory.cs (1)
183loggerInformation[newLoggerIndex] = new LoggerInformation(provider, existingLogger.Key);
Logging\Import\LoggerFactoryScopeProvider.cs (5)
204sb.Append(_items[0].Key); 211sb.Append(_items[i].Key); 262_stringBuilder.Append(enumerator.Current.Key); 269_stringBuilder.Append(enumerator.Current.Key); 290new KeyValuePair<string, object?>(_enumerator.Current.Key, _enumerator.Current.Value);
parent\parent\parent\eng\MSBuild\parent\parent\src\Shared\LogBuffering\SerializedLogRecordFactory.cs (1)
32string key = attributes[i].Key;
Microsoft.Extensions.Telemetry.Abstractions (3)
Logging\LoggerMessageHelper.cs (2)
101if (typeof(TKey).IsValueType || kvp.Key is not null) 104_ = sb.Append(CultureInfo.InvariantCulture, $"\"{kvp.Key}\"=");
Logging\LoggerMessageState.cs (1)
139_ = sb.Append(_tags[i].Key);
Microsoft.Extensions.Telemetry.Abstractions.Tests (15)
Logging\LoggerMessageStateTests.cs (15)
26Assert.Equal(PropName, lms.TagArray[0].Key); 38Assert.Equal(PropName, lms.TagArray[0].Key); 45Assert.Equal(PropName, lms.TagArray[0].Key); 59Assert.Equal(PropName, lms.TagArray[0].Key); 61Assert.Equal(PropName + "X", lms.TagArray[1].Key); 79Assert.Equal("K1", lms.TagArray[0].Key); 97Assert.Equal(PropertyNamPrefix + "." + PropName, lms.TagArray[0].Key); 102Assert.Equal(PropertyNamPrefix + "." + PropName, lms.TagArray[0].Key); 115Assert.Equal(PropName, lms.TagArray[0].Key); 120Assert.Equal(PropName, lms.TagArray[0].Key); 142Assert.Equal(PropName, list[0].Key); 152Assert.Equal(PropName, list[0].Key); 158Assert.Equal(PropName, list[0].Key); 168Assert.Equal(current.Key, list[count].Key);
Microsoft.Extensions.Telemetry.Tests (9)
Enrichment\Internals\TestLogEnrichmentTagCollector.cs (1)
18_tags.Add(kvp.Key, kvp.Value);
Enrichment\Internals\TestMetricEnrichmentTagCollector.cs (1)
18_tags.Add(kvp.Key, kvp.Value.ToString() ?? string.Empty);
Logging\ExtendedLoggerTests.cs (7)
549Assert.DoesNotContain(state!, x => x.Key == "exception.message"); 855Assert.Equal("{OriginalFormat}", property.Key); 923Assert.Equal("{OriginalFormat}", property.Key); 1178enrichmentPropertyBag.Add(kvp.Key, kvp.Value!); 1201collector.Add(kvp.Key, kvp.Value); 1210a[i++] = new(kvp.Key, (string)kvp.Value!); 1215collector.Add(kvp.Key, kvp.Value);
Microsoft.Extensions.Validation (1)
ValidateContext.cs (1)
49=> _validationErrors?.ToDictionary(kvp => kvp.Key, kvp => (IReadOnlyList<ValidationError>)kvp.Value.AsReadOnly()).AsReadOnly();
Microsoft.Extensions.Validation.ValidationsGenerator (4)
Extensions\ISymbolExtensions.cs (2)
34if (string.Equals(arg.Key, "Name", StringComparison.Ordinal) && arg.Value.Kind == TypedConstantKind.Primitive) 38else if (string.Equals(arg.Key, "ResourceType", StringComparison.Ordinal) && arg.Value.Kind == TypedConstantKind.Type)
Extensions\ITypeSymbolExtensions.cs (1)
218if (string.Equals(namedArgument.Key, "Condition", System.StringComparison.Ordinal))
src\aspnetcore\src\Shared\RoslynUtils\SymbolExtensions.cs (1)
285if (string.Equals(namedArgument.Key, argumentName, StringComparison.Ordinal))
Microsoft.Gen.ComplianceReports (1)
Parser.cs (1)
266if (namedArg.Key == "Notes")
Microsoft.Gen.ContextualOptions (2)
Parser.cs (2)
18.Select(type => new OptionsContextType(type.Key, type.Value.ToImmutableArray(), GetContextProperties(type.Key)))
Microsoft.Gen.ContextualOptions.Unit.Tests (3)
SyntaxContextReceiverTests.cs (3)
36Assert.Equal(declaration.Key.Name, declaration.Value.Single().Identifier.Text); 37Assert.Equal("TestClasses", declaration.Key.ContainingNamespace.ToString()); 73Assert.Equal("TestClasses", declaration.Key.ContainingNamespace.ToString());
Microsoft.Gen.Logging (5)
AttributeProcessors.cs (5)
69switch (a.Key) 138if (a.Key == SkipNullProperties) 145else if (a.Key == OmitReferenceName) 152else if (a.Key == Transitive) 176if (a.Key == OmitReferenceName)
Microsoft.Gen.Logging.Generated.Tests (17)
LoggerMessageAttributeTests.cs (1)
163Assert.Contains(collector.LatestRecord.StructuredState, x => x.Key == key && x.Value == value);
LogMethodTests.cs (7)
47if (field.Key == "RequestId") 433Assert.Equal("p1", logRecord.StructuredState![0].Key); 834Assert.Contains(record.StructuredState, x => x.Key == "event"); 835Assert.DoesNotContain(record.StructuredState, x => x.Key == "@event"); 1053Assert.Equal(kvp.Value, rol.GetValue(kvp.Key)); 1069Assert.Equal(kvp.Value, rol!.GetValue(kvp.Key)); 1080Assert.Equal("{OriginalFormat}", pair.Key);
LogPropertiesTests.cs (4)
45var ss = _logger.LatestRecord.StructuredState!.ToDictionary(x => x.Key, x => x.Value); 176var ss = collector.LatestRecord.StructuredState!.ToDictionary(x => x.Key, x => x.Value); 194ss = collector.LatestRecord.StructuredState!.ToDictionary(x => x.Key, x => x.Value); 604.ToDictionary(p => p.Key, p => p.Value);
TagProviderTests.cs (4)
168Assert.Equal("P0", state[0].Key); 170Assert.Equal("Custom_property_name", state[1].Key); 194Assert.Equal("P0", state[0].Key); 196Assert.Equal("Custom_property_name", state[1].Key);
Utils.cs (1)
99if (kvp.Key == key)
Microsoft.Gen.MetadataExtractor (5)
Parser_2.cs (4)
294arg.Key is "MetricName" or "Name") 299arg.Key is "Unit") 621if (namedArgument.Key == "Name" && namedArgument.Value.Value is { } nameValue) 625else if (namedArgument.Key == "Unit" && namedArgument.Value.Value is { } unitValue)
Parser.cs (1)
266if (namedArg.Key == "Notes")
Microsoft.Gen.Metrics (8)
Emitter.cs (2)
35foreach (var entry in metricClassesDict.OrderBy(static x => x.Key)) 38GenTypeByNamespace(entry.Key, entry.Value, cancellationToken);
MetricFactoryEmitter.cs (2)
31foreach (var entry in metricClassesDict.OrderBy(static x => x.Key)) 33GenMetricFactoryByNamespace(entry.Key, entry.Value, cancellationToken);
Parser.cs (4)
294arg.Key is "MetricName" or "Name") 299arg.Key is "Unit") 621if (namedArgument.Key == "Name" && namedArgument.Value.Value is { } nameValue) 625else if (namedArgument.Key == "Unit" && namedArgument.Value.Value is { } unitValue)
Microsoft.Gen.Metrics.Generated.Tests (33)
MetricTests.cs (22)
71Assert.Equal(new (string, object?)[] { ("s1", "val1"), ("s2", "val2") }, measurement.Tags.Select(x => (x.Key, x.Value))); 154Assert.Equal(new (string, object?)[] { ("s1", "val_1"), ("s2", "val_2") }, measurement.Tags.Select(x => (x.Key, x.Value))); 174var tags = measurements[0].Tags.Select(x => (x.Key, x.Value)); 177tags = measurements[1].Tags.Select(x => (x.Key, x.Value)); 198var tags = measurements[0].Tags.Select(x => (x.Key, x.Value)); 201tags = measurements[1].Tags.Select(x => (x.Key, x.Value)); 253Assert.Equal(new (string, object?)[] { ("s1", "val1"), ("s2", "val2") }, measurement.Tags.Select(x => (x.Key, x.Value))); 259Assert.Equal(new (string, object?)[] { ("s1", "val1"), ("s2", "val2") }, measurement.Tags.Select(x => (x.Key, x.Value))); 266Assert.Equal(new (string, object?)[] { ("s1", "val1"), ("s2", "val4") }, measurement.Tags.Select(x => (x.Key, x.Value))); 278Assert.Equal(new (string, object?)[] { ("s1", "val1"), ("s2", "val2") }, measurement.Tags.Select(x => (x.Key, x.Value))); 284Assert.Equal(new (string, object?)[] { ("s1", "val1"), ("s2", "val2") }, measurement.Tags.Select(x => (x.Key, x.Value))); 291Assert.Equal(new (string, object?)[] { ("s1", "val1"), ("s2", "val4") }, measurement.Tags.Select(x => (x.Key, x.Value))); 329Assert.Equal(new (string, object?)[] { ("Dim1", "val1"), ("Dim_2", "val2"), ("Dim_3", "val3") }, measurement.Tags.Select(x => (x.Key, x.Value))); 342Assert.Equal(new (string, object?)[] { ("Dim1", "val1"), ("Dim_2", "val2"), ("Dim_3", "val3") }, measurement.Tags.Select(x => (x.Key, x.Value))); 372measurement.Tags.Select(x => (x.Key, x.Value))); 421measurement.Tags.Select(x => (x.Key, x.Value))); 444measurement.Tags.Select(x => (x.Key, x.Value))); 467measurement.Tags.Select(x => (x.Key, x.Value))); 515measurement.Tags.Select(x => (x.Key, x.Value))); 564measurement.Tags.Select(x => (x.Key, x.Value))); 587measurement.Tags.Select(x => (x.Key, x.Value))); 609measurement.Tags.Select(x => (x.Key, x.Value)));
MetricTests.Ext.cs (8)
55Assert.Equal(new (string, object?)[] { ("s1", "val1"), ("s2", "val2") }, measurement.Tags.Select(x => (x.Key, x.Value))); 135Assert.Equal(new (string, object?)[] { ("s1", "val_1"), ("s2", "val_2") }, measurement.Tags.Select(x => (x.Key, x.Value))); 184measurement.Tags.Select(x => (x.Key, x.Value))); 206measurement.Tags.Select(x => (x.Key, x.Value))); 228measurement.Tags.Select(x => (x.Key, x.Value))); 277measurement.Tags.Select(x => (x.Key, x.Value))); 299measurement.Tags.Select(x => (x.Key, x.Value))); 321measurement.Tags.Select(x => (x.Key, x.Value)));
MetricTests.Ext.Unit.cs (3)
57measurement.Tags.Select(x => (x.Key, x.Value))); 111measurement.Tags.Select(x => (x.Key, x.Value))); 141measurement.Tags.Select(x => (x.Key, x.Value)));
Microsoft.Gen.MetricsReports (4)
Parser.cs (4)
294arg.Key is "MetricName" or "Name") 299arg.Key is "Unit") 621if (namedArgument.Key == "Name" && namedArgument.Value.Value is { } nameValue) 625else if (namedArgument.Key == "Unit" && namedArgument.Value.Value is { } unitValue)
Microsoft.Interop.ComInterfaceGenerator (3)
src\runtime\src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (2)
89foreach (var option in options.OrderBy(item => item.Key)) 91equivalenceKeyBuilder.Append($";{option.Key}={option.Value}");
VirtualMethodPointerStubGenerator.cs (1)
368if (arg.Key == CallConvsField)
Microsoft.Interop.LibraryImportGenerator (4)
Analyzers\CustomMarshallerAttributeFixer.cs (1)
62var (marshallerType, managedType, isLinearCollectionMarshaller) = marshallerInfo.Key;
LibraryImportGenerator.cs (1)
110if (arg.Key == CallConvsField)
src\runtime\src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (2)
89foreach (var option in options.OrderBy(item => item.Key)) 91equivalenceKeyBuilder.Append($";{option.Key}={option.Value}");
Microsoft.Interop.SourceGeneration (12)
ComInterfaceMarshallingInfoProvider.cs (3)
99if (kvp.Key != MarshalMode.Default) 101builder[kvp.Key] = kvp.Value; 146if (namedArg.Key == "Options" && namedArg.Value.Value is int rawOptions && rawOptions != 0)
ManualTypeMarshallingHelper.cs (1)
42hash = HashCode.Combine(hash, mode.Key, mode.Value);
MarshalAsParser.cs (3)
220switch (namedArg.Key) 227_diagnostics.ReportConfigurationNotSupported(attributeData, $"{attributeData.AttributeClass!.Name}{Type.Delimiter}{namedArg.Key}"); 242_diagnostics.ReportConfigurationNotSupported(attributeData, $"{attributeData.AttributeClass!.Name}{Type.Delimiter}{namedArg.Key}");
MarshalUsingAttributeParser.cs (2)
78if (arg.Key == ManualTypeMarshallingHelper.MarshalUsingProperties.ConstantElementCount) 82else if (arg.Key == ManualTypeMarshallingHelper.MarshalUsingProperties.CountElementName)
SignatureContext.cs (1)
209if (named.Key == ManualTypeMarshallingHelper.MarshalUsingProperties.ElementIndirectionDepth)
ValueEqualityImmutableDictionary.cs (2)
25if (!other.TryGetValue(kvp.Key, out var value) || !kvp.Value.Equals(value)) 41_hash = HashCode.Combine(_hash, kvp.Key, kvp.Value);
Microsoft.Maui (3)
Debugger\DebuggerDisplayHelpers.cs (1)
61 sb.Append(kvp.Key);
HotReload\HotReloadHelper.cs (1)
180 var view = pair.Key;
PropertyMapper.cs (1)
173 yield return mapper.Key;
Microsoft.Maui.Controls (70)
Application\Application.cs (2)
353 innerKeys.Add(c.Key); 356 if (innerKeys.Add(value.Key))
BindableObject.cs (6)
132 if (original.Key == SetterSpecificity.FromHandler) 189 Current = new LocalValueEntry(_propertiesEnumerator.Current.Key, _propertiesEnumerator.Current.Value.Values.GetValue(), _propertiesEnumerator.Current.Value.Attributes); 228 resultArray[i].IsSet = pair.Key != SetterSpecificity.DefaultValue; 319 oldSpecificity = b_p.Key; 614 var originalSpecificity = specificityAndValue.Key; 714 var specificity = kvp.Key;
DataTemplate.cs (4)
83 if (Values.ContainsKey(kvp.Key)) 84 throw new InvalidOperationException("Binding and Value found for " + kvp.Key.PropertyName); 86 bindable.SetBinding(kvp.Key, kvp.Value.Clone()); 99 bindable.SetValue(kvp.Key, kvp.Value);
DragAndDrop\DataPackage.cs (2)
34 dataPackage.Properties.Add(property.Key, property.Value); 37 dataPackage.PropertiesInternal.Add(property.Key, property.Value);
Element\Element.cs (2)
768 if (dynR.Value.Item1 != value.Key) 771 changedResources.Add((dynR.Key, dynR.Value.Item2));
ListProxy.cs (1)
103 return kvp.Key;
OrderedDictionary.cs (7)
80 Add(kvp.Key, kvp.Value); 107 Add(item.Key, item.Value); 155 return _kvpCollection.Remove(item) && _keyOrder.Remove(item.Key); 252 return _keyOrder.IndexOf(item.Key); 257 Insert(index, item.Key, item.Value); 265 _keyOrder[index] = value.Key; 266 _dict[value.Key] = value.Value;
PlatformBindingHelpers.cs (2)
203 wrapper.SetBinding(kvp.Key, kvp.Value); 205 wrapper.SetValue(kvp.Key, kvp.Value);
ResourcesExtensions.cs (11)
23 if (!resources.ContainsKey(res.Key) && ve.Resources.TryGetValue(res.Key, out object value)) 24 resources.Add(res.Key, value); 25 else if (res.Key.StartsWith(Style.StyleClassPrefix, StringComparison.Ordinal)) 27 var mergedClassStyles = new List<Style>(resources[res.Key] as List<Style>); 29 resources[res.Key] = mergedClassStyles; 38 if (!resources.ContainsKey(res.Key)) 39 resources.Add(res.Key, res.Value); 40 else if (res.Key.StartsWith(Style.StyleClassPrefix, StringComparison.Ordinal)) 42 var mergedClassStyles = new List<Style>(resources[res.Key] as List<Style>); 44 resources[res.Key] = mergedClassStyles;
Shell\ShellNavigationManager.cs (2)
330 if (!returnValue.ContainsKey(datum.Key)) 331 returnValue[datum.Key] = datum.Value;
Shell\ShellNavigationQueryParameters.cs (4)
20 this.Add(item.Key, item.Value); 26 this.Add(item.Key, item.Value); 68 _internal.Add(item.Key, item.Value); 77 public bool Contains(KeyValuePair<string, object> item) => _internal.ContainsKey(item.Key);
Shell\ShellRouteParameters.cs (13)
21 _shellNavigationQueryParameters[item.Key] = item.Value; 32 if (!returnValue.ContainsKey(item.Key)) 33 returnValue.Add(item.Key, item.Value); 47 if (!q.Key.StartsWith(prefix, StringComparison.Ordinal)) 49 var key = q.Key.Substring(prefix.Length); 56 _shellNavigationQueryParameters[item.Key] = item.Value; 66 this.Add(item.Key, item.Value); 69 _shellNavigationQueryParameters[item.Key] = item.Value; 79 if (this.ContainsKey(item.Key)) 81 this.Remove(item.Key); 96 if (!this.ContainsKey(item.Key)) 97 this[item.Key] = item.Value; 124 key = tuple.Key;
Style.cs (4)
69 target.Key.RemoveDynamicResource(_basedOnResourceProperty); 71 target.Key.SetDynamicResource(_basedOnResourceProperty, value); 142 UnApplyCore(target.Key, oldValue); 143 ApplyCore(target.Key, newValue, (SetterSpecificity)target.Value);
StyleSheets\Style.cs (1)
70 var property = ((IStylable)styleable).GetProperty(decl.Key, inheriting);
StyleSheets\StyleSheet.cs (1)
110 var selector = kvp.Key;
TemplatedItemsList.cs (1)
428 if (ReferenceEquals(group, kvp.Key))
VisualElement\VisualElement.cs (5)
1553 innerKeys.Add(c.Key); 1556 if (innerKeys.Add(value.Key)) 1558 else if (value.Key.StartsWith(Style.StyleClassPrefix, StringComparison.Ordinal)) 1560 var mergedClassStyles = new List<Style>(Resources[value.Key] as List<Style>); 1562 changedResources.Add(new KeyValuePair<string, object>(value.Key, mergedClassStyles));
VisualStateManager.cs (1)
80 var vsgSpecificity = vsgSpecificityValue.Key;
Xaml\Diagnostics\BindablePropertyDiagnostics.cs (1)
18 var specificity = context.Values.GetSpecificityAndValue().Key;
Microsoft.Maui.Controls.Build.Tasks (11)
BindablePropertyReferenceExtensions.cs (1)
67 key = kvp.Key;
CreateObjectVisitor.cs (4)
79 if (!node.SkipProperties.Contains(prop.Key)) 80 node.SkipProperties.Add(prop.Key); 120 if (!node.SkipProperties.Contains(prop.Key)) 121 node.SkipProperties.Add(prop.Key);
ExpandMarkupsVisitor.cs (1)
77 name = kvp.Key;
NodeILExtensions.cs (1)
703 yield return Create(Ldstr, kvp.Key);
PerformanceProvider.cs (2)
63 foreach (KeyValuePair<string, Statistic> kvp in Statistics.OrderBy(kvp => kvp.Key)) 65 string key = ShortenPath(kvp.Key);
SetPropertiesVisitor.cs (2)
227 name = kvp.Key; 1900 templateContext.Scopes[kvp.Key] = new Tuple<VariableDefinition, IList<string>>(varDefScope, kvp.Value.Item2);
Microsoft.Maui.Controls.SourceGen (2)
CodeBehindGenerator.cs (1)
218 if (attr.NamedArguments.Length == 1 && attr.NamedArguments[0].Key == nameof(XmlnsDefinitionAttribute.AssemblyName))
src\Controls\src\Xaml\XamlNode.cs (1)
217 clone.Properties.Add(kvp.Key, kvp.Value.Clone());
Microsoft.Maui.Controls.Xaml (10)
NodeExtensions.cs (1)
21 name = kvp.Key;
PruneIgnoredNodesVisitor.cs (4)
23 var propertyName = propertyKvp.Key; 42 var prefix = node.NamespaceResolver.LookupPrefix(propertyKvp.Key.NamespaceURI); 44 node.Properties.Remove(propertyKvp.Key); 48 node.Properties.Remove(propertyKvp.Key);
RemoveDuplicateDesignNodes.cs (1)
29 var key = props[i].Key;
XamlNode.cs (1)
217 clone.Properties.Add(kvp.Key, kvp.Value.Clone());
XamlParser.cs (3)
199 return attributes.Any(kvp => kvp.Key == XmlName.xTypeArguments) 200 ? ((ValueNode)attributes.First(kvp => kvp.Key == XmlName.xTypeArguments).Value).Value as IList<XmlType> 292 var prefix = kvp.Key;
Microsoft.Maui.Essentials (2)
WebAuthenticator\WebAuthenticatorResult.shared.cs (2)
45 Properties[kvp.Key] = kvp.Value; 56 Properties[kvp.Key] = kvp.Value;
Microsoft.Maui.Graphics (3)
Text\TextAttributes.cs (2)
20 this[entry.Key] = entry.Value; 23 this[entry.Key] = entry.Value;
Text\XmlAttributedTextWriter.cs (1)
72 Write(attributes, entry.Key, null, writer);
Microsoft.Maui.Graphics.Win2D.WinUI.Desktop (1)
src\Graphics\src\Graphics\Platforms\Windows\AsyncPump.cs (1)
116 workItem.Key(workItem.Value);
Microsoft.Maui.Resizetizer (5)
DetectInvalidResourceOutputFilenamesTask.cs (1)
58 builder.Append($"{pair.Value} ({pair.Key.ItemSpec})");
GenerateTizenManifest.cs (4)
173 && d.Attribute(DpiName)?.Value == image.Key.Resolution 174 && d.Attribute("orientation")?.Value == image.Key.Orientation 181 splashscreenElement.SetAttributeValue(DpiName, image.Key.Resolution); 182 splashscreenElement.SetAttributeValue("orientation", image.Key.Orientation);
Microsoft.ML.AutoML (21)
SweepableEstimator\MultiModelPipeline.cs (1)
114var estimators = _estimators.ToDictionary(x => x.Key, x => x.Value);
SweepableEstimator\SweepableEstimatorPipeline.cs (1)
58searchSpace.Add(kv.Key, kv.Value);
SweepableEstimator\SweepablePipeline.cs (3)
35searchSpace.Add(kv.Key, kv.Value.SearchSpace); 57parameter[kv.Key] = kv.Value; 174var estimators = _estimators.ToDictionary(x => x.Key, x => x.Value);
TrainerExtensions\TrainerExtensionCatalog.cs (1)
50_trainerNamesToExtensionTypes.ToDictionary(kvp => kvp.Value, kvp => kvp.Key);
TrainerExtensions\TrainerExtensionUtil.cs (7)
126properties[property.Key] = property.Value; 195props = props.Where(p => p.Key != LabelColumn && p.Key != WeightColumn) 196.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); 204var paramVals = props.Select(p => new StringParameterValue(p.Key, p.Value.ToString())); 229var parentProps = props.Where(p => p.Key != LightGbmBoosterPropName); 232parameters = allProps.Select(p => new StringParameterValue(p.Key, p.Value.ToString()));
TransformInference\TransformInference.cs (1)
49sb.Append($" {property.Key}={property.Value}");
Tuner\AutoZeroTuner.cs (2)
95var pipelineSchema = pipelineSchemas.First().Key; 98var trainerEstimatorName = pipeline.Estimators.Where(kv => kv.Value.EstimatorType.IsTrainer()).First().Key;
Tuner\EciCfoTuner.cs (3)
57if (!parameter.ContainsKey(k.Key)) 59parameter[k.Key] = _defaultParameter[k.Key];
Tuner\PipelineProposer.cs (2)
97schema = _eci.OrderBy(kv => kv.Value).First().Key; 152_k2 = _k1.ToDictionary(kv => kv.Key, kv => kv.Value);
Microsoft.ML.AutoML.Tests (3)
TunerTests.cs (3)
252Output.WriteLine($"verify tuner {kv.Key}"); 307Output.WriteLine($"verify tuner {kv.Key}"); 379Output.WriteLine($"{kv.Key} - best metric {bestMetric}");
Microsoft.ML.CodeGenerator (7)
CodeGenerator\CSharp\TrainerGeneratorBase.cs (4)
114_arguments.Add(_hasAdvancedSettings ? kv.Key : NamedParameters[kv.Key], value); 118_arguments.Add(kv.Key, value); 143sb.Append(kv.Key);
Templates\Console\PredictProgram.cs (3)
46this.Write(this.ToStringHelper.ToStringWithCulture(kv.Key)); 67this.Write(this.ToStringHelper.ToStringWithCulture(kv.Key)); 69this.Write(this.ToStringHelper.ToStringWithCulture(kv.Key));
Microsoft.ML.Core (20)
CommandLine\CmdParser.cs (4)
1572string tag = values[i].Key; 1575if (i < values.Count && IsCurlyGroup((string)values[i].Value) && string.IsNullOrEmpty(values[i].Key)) 1596var kvp = Activator.CreateInstance(ItemType, comList[i].Key, comList[i].Value); 1639var kvp = Activator.CreateInstance(ItemType, values[i].Key, values[i].Value);
ComponentModel\ComponentCatalog.cs (1)
752return _signatures.Select(kvp => kvp.Key).ToArray();
Data\Repository.cs (1)
400var ae = _archive.CreateEntry(kvp.Key);
Data\RoleMappedSchema.cs (7)
174switch (kvp.Key) 222Contracts.AssertNonEmpty(kvp.Key.Value); 227Add(map, kvp.Key.Value, info.Value); 229throw Contracts.ExceptParam(nameof(schema), $"{kvp.Value} column '{kvp.Key.Value}' not found"); 267yield return new KeyValuePair<ColumnRole, DataViewSchema.Column>(roleAndList.Key, info); 279yield return new KeyValuePair<ColumnRole, string>(roleAndList.Key, info.Name); 318copy.Add(kvp.Key, cols);
Utilities\LruCache.cs (3)
25public IEnumerable<TKey> Keys => _lru.Select(kvp => kvp.Key); 47Contracts.Assert(key.GetHashCode() == node.Value.Key.GetHashCode()); 71_cache.Remove(node.Value.Key);
Utilities\ReservoirSampler.cs (1)
196var tmp = _counts.Select((count, i) => new KeyValuePair<int, int>(count, i)).First(kvp => kvp.Key == 0);
Utilities\Tree.cs (3)
121return item.Value != null && item.Value._parent == this && _children.Comparer.Equals(item.Key, item.Value.Key); 130Add(item.Key, item.Value); 188if (!TryGetValue(item.Key, out child) || item.Value != child)
Microsoft.ML.Core.Tests (17)
UnitTests\TestEntryPoints.cs (2)
2251writer.WriteLine(kvp.Key); 2255writer.WriteLine("{0}: {1}", kvp.Key, kvp.Value);
UnitTests\TestVBuffer.cs (15)
326var aIndices = new HashSet<int>(a.Items().Select(iv => iv.Key)); 327int[] indices = aIndices.Union(b.Items().Select(iv => iv.Key)).OrderBy(i => i).ToArray(); 372int[] indices = a.Items().Select(iv => iv.Key).Union(b.Items().Select(iv => iv.Key)).OrderBy(i => i).ToArray(); 417var aIndices = a.Items().Select(iv => iv.Key); 418var bIndices = b.Items().Select(iv => iv.Key); 475values[indices.Count] = func(iv.Key, iv.Value); 476indices.Add(iv.Key); 503int[] indices = a.Items().Select(iv => iv.Key) 504.Union(b.Items().Select(iv => iv.Key)).Distinct().OrderBy(x => x).ToArray(); 742a.GetItemOrDefault(iv.Key + copyMin, ref value); 770a.GetItemOrDefault(iv.Key, ref value); 799HashSet<int> aIndices = new HashSet<int>(a.Items().Select(iv => iv.Key)); 800HashSet<int> bIndices = new HashSet<int>(b.Items().Select(iv => iv.Key)); 804a.GetItemOrDefault(iv.Key, ref value);
Microsoft.ML.CpuMath.UnitTests (1)
UnitTests.cs (1)
994options.StartInfo.Environment.Add(item.Key, item.Value);
Microsoft.ML.Data (126)
Commands\DataCommand.cs (2)
148pipe.Send(TelemetryMessage.CreateMetric(pair.Key, pair.Value, null)); 199newAverageMetric.Add(pair.Key, pair.Value / metricValues.Length);
Commands\ShowSchemaCommand.cs (2)
176itw.WriteLine("{0}:{1}", kvp.Key, kvp.Value); 294itw.Write("[{0}] '{1}'", item.Key, sb);
Commands\TrainCommand.cs (2)
522if (string.IsNullOrWhiteSpace(kindName.Key)) 525return customColumnArg.Select(kindName => new ColumnRole(kindName.Key).Bind(kindName.Value));
Data\RowCursorUtils.cs (2)
441editor.Values[kv.Key] = kv.Value - 1; 443editor.Values[kv.Key] = Single.NaN;
Data\SchemaDefinition.cs (1)
283builder.Add(kvp.Key, kvp.Value.AnnotationType, kvp.Value.GetGetterDelegate());
DataLoadSave\Binary\BinaryLoader.cs (1)
2198isLiveAndCol.Key ? "" : " (DEAD!)", typeDesc, blockLookups.Length, col.RowsPerBlock);
DataLoadSave\LegacyCompositeDataLoader.cs (5)
141.Select(x => new KeyValuePair<string, string>(x.Key, GetTagData(x.Value))) 152if (!string.IsNullOrEmpty(pair.Key) && composite._transforms.Any(x => x.Tag == pair.Key)) 153ch.Warning("The transform with tag '{0}' already exists in the chain", pair.Key); 221var tag = tagData[i].Key;
DataLoadSave\TransformerChain.cs (7)
302roles.Where(x => x.Key.Value == RoleMappedSchema.ColumnRole.Feature.Value).First().Value); 306roles.Where(x => x.Key.Value == RoleMappedSchema.ColumnRole.Feature.Value).First().Value, 307roles.Where(x => x.Key.Value == RoleMappedSchema.ColumnRole.Label.Value).First().Value); 310roles.Where(x => x.Key.Value == RoleMappedSchema.ColumnRole.Feature.Value).First().Value); 313roles.Where(x => x.Key.Value == RoleMappedSchema.ColumnRole.Feature.Value).First().Value); 316roles.Where(x => x.Key.Value == RoleMappedSchema.ColumnRole.Feature.Value).First().Value); 319roles.Where(x => x.Key.Value == RoleMappedSchema.ColumnRole.Feature.Value).First().Value);
DataView\InternalSchemaDefinition.cs (1)
77: metadataInfos.ToDictionary(entry => entry.Key, entry => entry.Value);
DataView\Transposer.cs (7)
553var heap = new Heap<KeyValuePair<int, int>>((p1, p2) => p1.Key > p2.Key || (p1.Key == p2.Key && p1.Value > p2.Value), _rbuff.Length); 615if (pair.Key != s) 617Ch.Assert(pair.Key > s); 618s = pair.Key;
DataView\TypedCursor.cs (2)
440buf[pair.Key] = convert(pair.Value); 476buf[pair.Key] = pair.Value;
Deprecated\Instances\HeaderSchema.cs (7)
53indexList.Add(kvp.Key); 107var items = map.Where(kvp => 0 <= kvp.Key && kvp.Key < count && kvp.Value != null); 112if (lim <= kvp.Key) 113lim = kvp.Key + 1; 126indices[iv] = kvp.Key; 136names[kvp.Key] = kvp.Value;
Deprecated\Vector\VectorUtils.cs (2)
121aEditor.Indices[count] = pair.Key; 128aEditor.Indices[count] = pair.Key;
EntryPoints\EntryPointNode.cs (25)
358if (!_vars.TryGetValue(kvp.Key, out v)) 359_vars.Add(kvp.Key, kvp.Value); 361throw _ectx.Except($"Duplicate variable '{kvp.Key}' in subgraph."); 607var paramBinding = new SimpleParameterBinding(kvp.Key); 608inputBindingMap.Add(kvp.Key, new List<ParameterBinding>() { paramBinding }); 624var inputName = _inputBuilder.GetFieldNameOrNull(pair.Key); 627Type valueType = _inputBuilder.GetFieldTypeOrNull(pair.Key); 629throw _host.Except($"Unexpected input name: '{pair.Key}'"); 647throw _host.Except($"Input {pair.Key} may ONLY contain variables."); 649Type valueType = _inputBuilder.GetFieldTypeOrNull(pair.Key); 651throw _host.Except($"Unexpected input name: '{pair.Key}'"); 672if (!_inputBuilder.TrySetValueJson(pair.Key, pair.Value)) 673throw _host.Except($"Unexpected input: '{pair.Key}'"); 690throw _host.Except($"Output '{pair.Key}' can only be bound to a variable"); 692var valueType = _outputHelper.GetFieldType(pair.Key); 694throw _host.Except($"Unexpected output name: '{pair.Key}"); 697throw _host.Except($"Output '{pair.Key}' has invalid type"); 700_outputMap[pair.Key] = varBinding.VariableName; 709toModify.Add(kvp.Key); 722key = kvp.Key; 756toModify.Add(kvp.Key, newName); 759_outputMap[kvp.Key] = kvp.Value; 789return _inputMap.Where(kv => !_inputBuilder.IsInputOptional(kv.Key.ParameterName)).Select(kv => kv.Value).Distinct() 802bool success = _inputBuilder.TrySetValue(pair.Key, BuildParameterValue(pair.Value)); 822if (_outputMap.TryGetValue(pair.Key, out tgt))
EntryPoints\InputBuilder.cs (5)
505if (!inputBuilder.TrySetValueJson(pair.Key, pair.Value)) 506throw ectx.Except($"Unexpected value for component '{type}', field '{pair.Key}': '{pair.Value}'"); 566if (!inputBuilder.TrySetValueJson(pair.Key, pair.Value)) 567throw ectx.Except($"Unexpected value for component '{name}', field '{pair.Key}': '{pair.Value}'"); 595dict[pair.Key] = (T)GetFieldAssignableValue(ectx, typeof(T), ParseJsonValue(ectx, typeof(T), attributes, pair.Value, catalog));
Evaluators\ClusteringEvaluator.cs (1)
805if (!col.Key.Equals(RoleMappedSchema.ColumnRole.Label))
Evaluators\EvaluatorUtils.cs (8)
367string.Format("{0} {1}", colName, names.GetItemOrDefault(metric.Key)), metric.Value); 486var index = kvp.Key; 516editor.Values[map[kvp.Key]] = kvp.Value; 540editor.Values[map[kvp.Key]] = kvp.Value; 586var key = kvp.Key; 899ReconcileKeyValuesWithNoNames(env, views, keyCol.Key, keyCol.Value); 917var hidden = FindHiddenColumns(idv.Schema, keyCol.Key); 1508var index = val.Key;
Evaluators\QuantileRegressionEvaluator.cs (3)
103res[i.Key] = Math.Sqrt(i.Value / SumWeights); 117res[i.Key] = 1 - i.Value / (TotalLabelSquaredW - TotalLabelW * TotalLabelW / SumWeights); 409l1Editor.Values[s.Key] = Math.Abs(lab - s.Value);
Model\Pfa\BoundPfaContext.cs (1)
211string colName = vars[i].Key;
Model\Pfa\PfaContext.cs (5)
44vars[v.Key] = v.Value; 161if (_variables.Contains(l.Key)) 168_variables.UnionWith(locals.Select(v => v.Key)); 175if (!_variables.Contains(l.Key)) 178_variables.UnionWith(locals.Select(v => v.Key));
Scorers\PredictedLabelScorerBase.cs (1)
197if (pair.Key != AnnotationUtils.Kinds.ScoreColumnKind)
Scorers\RowToRowScorerBase.cs (1)
421ctx.SaveNonEmptyString(kvp.Key.Value);
Transforms\ColumnBindingsBase.cs (2)
283var getter = Utils.MarshalInvoke(GetAnnotationGetterDelegate<int>, kvp.Value.RawType, inputBindings, i, kvp.Key); 284meta.Add(kvp.Key, kvp.Value, getter);
Transforms\ColumnConcatenatingTransformer.cs (6)
96if (Source == null || Source.Any(kvp => !string.IsNullOrEmpty(kvp.Key))) 400.Select(c => new ColumnOptions(c.Name, c.Source.Select(kvp => (kvp.Value, kvp.Key != "" ? kvp.Key : null)))) 665bldr.AddFeature(slot + kvp.Key, sb.ToString().AsMemory()); 892toHide.Add(toSave.Key); 940var node = ctx.CreateNode(opType, inputList.Select(t => t.Key),
Transforms\ConversionsExtensionsCatalog.cs (5)
339var keys = keyValuePairs.Select(pair => pair.Key); 371var keys = keyValuePairs.Select(pair => pair.Key); 405var keys = keyValuePairs.Select(pair => pair.Key); 443var keys = keyValuePairs.Select(pair => pair.Key); 475var keys = keyValuePairs.Select(pair => pair.Key);
Transforms\Hashing.cs (3)
1563return (x.Key == y.Key) && _tComparer.Equals(x.Value, y.Value); 1568return Hashing.CombineHash(obj.Key, _tComparer.GetHashCode(obj.Value));
Transforms\InvertHashUtils.cs (8)
84dst.Append(pair.Key); 247Contracts.Assert(0 <= p.Key && p.Key < _slots); 248indices[i] = p.Key; 261Contracts.Assert(0 <= p.Key && p.Key < _slots); 262values[p.Key] = Textify(ref sb, ref temp, ref cbuffer, ref pairs, p.Value); 425writer.Write("{0}\t", pair.Key);
Transforms\KeyToVector.cs (2)
405Contracts.Assert(slot == (long)kvpSlot.Key * keyCount); 410sb.Append('[').Append(kvpSlot.Key).Append(']');
Transforms\MetadataDispatcher.cs (2)
238if (kinds != null && kinds.Contains(kvp.Key)) 240if (info.FilterSrc != null && !info.FilterSrc(kvp.Key, index))
Transforms\OneToOneTransformerBase.cs (1)
113if (activeOutput(pair.Key))
Transforms\ValueToKeyMappingTransformer.cs (1)
970jsonMap[kv.Value.ToString()] = kv.Key;
Transforms\ValueToKeyMappingTransformerImpl.cs (2)
1140srcMeta.GetItemOrDefault((int)(convKeyVal - 1), ref editor.Values[pair.Key]); 1226writer.Write("{0}\t{1}", pair.Key, sb.ToString());
Utilities\ColumnCursor.cs (1)
173dst[kvp.Key] = convert(kvp.Value);
Utilities\ModelFileUtils.cs (2)
245foreach (var role in schema.GetColumnRoleNames().OrderBy(r => r.Key.Value)) 247rolesList.Add(role.Key.Value);
Microsoft.ML.Ensemble (8)
Selector\SubModelSelector\BaseBestPerformanceSelector.cs (2)
90if (_metricName == kvp.Key) 103if (_metricName == kvp.Key)
Selector\SubModelSelector\BaseSubModelSelector.cs (1)
40if (kvp.Key == metricName)
Trainer\EnsembleDistributionModelParameters.cs (3)
234if (Utils.ExtractLettersAndNumbers(m.Key).ToLower().Equals(weightedAverager.WeightageMetricName.ToLower())) 241averagedWeights = Models.SelectMany(model => model.Metrics).Where(m => m.Key == metric.Key).Select(m => (Single)m.Value).ToArray();
Trainer\EnsembleModelParametersBase.cs (1)
121ctx.SaveStringOrNull(metric.Key);
Trainer\EnsembleTrainerBase.cs (1)
215ch.Info("{0}| Name of Model |", string.Join("", models[0].Metrics.Select(m => string.Format("| {0} |", m.Key))));
Microsoft.ML.EntryPoints (14)
JsonUtils\ExecuteGraphCommand.cs (2)
74var varName = kvp.Key; 92var varName = kvp.Key;
JsonUtils\JsonManifestUtils.cs (2)
276return new JArray(inputs.OrderBy(x => x.Key).Select(x => x.Value).ToArray()); 304return new JArray(outputs.OrderBy(x => x.Key).Select(x => x.Value).ToArray());
OneVersusAllMacro.cs (1)
86subGraphRunContext.RenameContextVariable(kvp.Key, kvp.Value);
PermutationFeatureImportance.cs (9)
91var featureColumnName = roles.Where(x => x.Key.Value == RoleMappedSchema.ColumnRole.Feature.Value).First().Value; 92var labelColumnName = roles.Where(x => x.Key.Value == RoleMappedSchema.ColumnRole.Label.Value).First().Value; 148var featureColumnName = roles.Where(x => x.Key.Value == RoleMappedSchema.ColumnRole.Feature.Value).First().Value; 149var labelColumnName = roles.Where(x => x.Key.Value == RoleMappedSchema.ColumnRole.Label.Value).First().Value; 207var featureColumnName = roles.Where(x => x.Key.Value == RoleMappedSchema.ColumnRole.Feature.Value).First().Value; 208var labelColumnName = roles.Where(x => x.Key.Value == RoleMappedSchema.ColumnRole.Label.Value).First().Value; 259var featureColumnName = roles.Where(x => x.Key.Value == RoleMappedSchema.ColumnRole.Feature.Value).First().Value; 260var labelColumnName = roles.Where(x => x.Key.Value == RoleMappedSchema.ColumnRole.Label.Value).First().Value; 261var groupIdColumnName = roles.Where(x => x.Key.Value == RoleMappedSchema.ColumnRole.Group.Value).First().Value;
Microsoft.ML.Fairlearn (1)
Metrics\FairlearnMetricCatalog.cs (1)
96var groupMetric = res.Select(kv => (kv.Key, _context.BinaryClassification.EvaluateNonCalibrated(kv.Value)))
Microsoft.ML.FastTree (41)
Dataset\Dataset.cs (2)
341newAuxData[pair.Key] = pair.Value.GetSubset(pair.Value.IsQueryLevel ? queryIndices.Distinct().ToArray() : docIndices); 686datasetSkeleton[p].SetData(pair.Key, newData, qddata.IsQueryLevel);
Dataset\SparseIntArray.cs (1)
132int index = pair.Key;
FastTree.cs (31)
1684rowHasMissing.Set(kv.Key, true); 1875_instanceList[kvp.Key].Add(index, kvp.Value); 1968int irow = kvEnums[i].Current.Key; 1969int jrow = kvEnums[j].Current.Key; 1995ch.Assert(kvp.Key >= last); 1997while (kvp.Key - last > Byte.MaxValue) 2003ch.Assert(kvp.Key - last <= Byte.MaxValue); 2006delta.Add((byte)(kvp.Key - last)); 2008ch.Assert(kvp.Key > last || values.Count == 1 || values[values.Count - 1] > values[values.Count - 2]); 2009last = kvp.Key; 2440Contracts.Assert(_sparse.Count == 0 || _sparse[_sparse.Count - 1].Key < length); 2464Contracts.Assert(_sparse.Count == 0 || _sparse[_sparse.Count - 1].Key < lim); 2471Contracts.Assert(prev < kvp.Key); 2472while (++prev < kvp.Key) 2475yield return kvp.Key; 2487yield return kvp.Key; 2537editor.Indices[i] = _sparse[i].Key; 2576Contracts.Assert(kvp.Key < length); 2579yield return new KeyValuePair<int, int>(kvp.Key, binned); 2588Contracts.Assert(kvp.Key < length); 2589while (++last < kvp.Key) 2593yield return new KeyValuePair<int, int>(kvp.Key, binned); 2661Contracts.Assert(sp.Count == 0 || sp[last].Key > lastRow); 2666if (s.Key < rowIndex) 2668if (s.Key > rowIndex) 2675Contracts.Assert(s.Key == rowIndex); 3142writer.WriteLine("\t{0}\t{1}", pair.Key, (double)pair.Value); 3157var name = names.GetItemOrDefault(pair.Key).ToString(); 3159name = $"f{pair.Key}"; 3171results.Add(new KeyValuePair<string, object>(pair.Key, pair.Value)); 3251bldr.AddFeature(pair.Key, (float)(Math.Sqrt(pair.Value) * normFactor));
GamModelParameters.cs (1)
188ctx.Writer.Write(kvp.Key);
Training\EnsembleCompression\LassoBasedEnsembleCompressor.cs (1)
108short curLabel = labelFreqList[i].Key;
TreeEnsemble\InternalTreeEnsemble.cs (3)
335int outputInputId = featureToID.ContainsKey(pair.Key) ? featureToID[pair.Key] : 0; 337fmap.GetName(pair.Key), Math.Pow(pair.Value, power) / normalizingFactor));
Utils\BufferPoolManager.cs (2)
53List<Array> buffers = availableBuffers.FirstOrDefault(x => x.Value.Count > 0 && x.Key >= size && (x.Key - size) < (size * 0.2)).Value as List<Array>;
Microsoft.ML.GenAI.Core (6)
Extension\ModuleExtension.cs (6)
152var childrenDeviceMap = deviceMap.Where(x => x.Key.StartsWith($"{key}.")).ToDictionary(x => x.Key.Substring($"{key}.".Length), x => x.Value); 180var remainingLayerSizeMap = layerSizeMap.Where(x => !deviceMap.ContainsKey(x.Key)).ToDictionary(x => x.Key, x => x.Value); 257foreach (var (key, value) in stateDict.OrderBy(x => x.Key, StringComparer.OrdinalIgnoreCase)) 275foreach (var (key, value) in stateDict.OrderBy(x => x.Key, StringComparer.OrdinalIgnoreCase))
Microsoft.ML.GenAI.Phi.Tests (1)
Phi3Tests.cs (1)
107var sizeInMB = size.ToDictionary(x => x.Key, x => x.Value / 1024 / 1024);
Microsoft.ML.InternalCodeAnalyzer (1)
ContractsCheckNameofFixProvider.cs (1)
152var shortPair = attr.NamedArguments.FirstOrDefault(p => p.Key == "ShortName");
Microsoft.ML.KMeansClustering (1)
KMeansModelParameters.cs (1)
206writer.Write(pair.Key);
Microsoft.ML.LightGbm (2)
LightGbmTrainerBase.cs (1)
501GbmOptions[pair.Key] = pair.Value;
WrappedLightGbmInterface.cs (1)
256res.Add(keyVal.Key + "=" + string.Format(CultureInfo.InvariantCulture, "{0}", keyVal.Value));
Microsoft.ML.OnnxConverter (1)
OnnxContextImpl.cs (1)
119string columnName = _columnNameMap.Single(kvp => kvp.Value == variableName).Key;
Microsoft.ML.OnnxTransformer (5)
OnnxTransform.cs (4)
321CustomShapeInfos = shapeDictionary?.Select(pair => new CustomShapeInfo(pair.Key, pair.Value)).ToArray(), 347CustomShapeInfos = shapeDictionary?.Select(pair => new CustomShapeInfo(pair.Key, pair.Value)).ToArray(), 377CustomShapeInfos = shapeDictionary?.Select(pair => new CustomShapeInfo(pair.Key, pair.Value)).ToArray(), 409CustomShapeInfos = shapeDictionary?.Select(pair => new CustomShapeInfo(pair.Key, pair.Value)).ToArray(),
OnnxUtils.cs (1)
305var name = pair.Key;
Microsoft.ML.OnnxTransformerTest (2)
OnnxTransformTests.cs (2)
856output.Output.Add(pair.Key + 1, pair.Value); 870Assert.Equal(pair.Value, transformedDataPoints[i].Output[pair.Key + 1]);
Microsoft.ML.Predictor.Tests (6)
CmdLine\CmdLine.cs (4)
252sb.AppendFormat(" subTaggedArray{1}={0}{2}", value.Name, pair.Key == "" ? "" : "[" + pair.Key + "]", value.GetSettingsString()); 282if (pair.Key != "") 283sb.AppendFormat("[{0}]", pair.Key);
CompareBaselines.cs (2)
89log.WriteLine("*** Missing left file: '{0}'", Path.Combine(rel, kvp.Key)); 112log.WriteLine("*** Missing left directory: '{0}'", Path.Combine(rel, kvp.Key));
Microsoft.ML.ResultProcessor (19)
ResultProcessor.cs (19)
100SettingHeaderNames.Add(setting.Key.StartsWith("/") ? setting.Key : "/" + setting.Key); 118ResultHeaderNames.Add(resultEntity.Key); 173.GroupBy(kvp => kvp.Key, kvp => kvp.Value) 296settings.Add(entity.Key + ":" + entity.Value); 537GroupBy(kvp => kvp.Key, kvp => kvp.Value).ToDictionary(g => "/" + g.Key, g => string.Join(",", g)); 910if (thisFoldResults.Key < 0 || thisFoldResults.Value == null) 914if (foldResults.ContainsKey(thisFoldResults.Key)) 916Console.Error.WriteLine("Fold {0} results have already been added, not adding.", thisFoldResults.Key); 918foldResults[thisFoldResults.Key] = thisFoldResults.Value; 932int foldIdx = kvp.Key; 936if (!metricToFoldValuesDict.TryGetValue(kvp1.Key, out metricDict)) 939metricToFoldValuesDict[kvp1.Key] = metricDict; 947perFoldMetrics[metricValues.Key] = new ResultMetric(float.NaN) 950orderby kvp.Key ascending 1078srcFiles.Add(new KeyValuePair<string, string>(taggedPattern.Key, src)); 1093resultValue.CustomizedTag = fileWithTag.Key; 1157outStream.Write("\t" + kvp.Key + ":"
Microsoft.ML.Samples (5)
Dynamic\NgramExtraction.cs (1)
78Console.Write($"'{slots[item.Key]}' - {item.Value} ");
Dynamic\Transforms\Text\ProduceHashedNgrams.cs (1)
85Console.Write($"{slots[item.Key]} ");
Dynamic\Transforms\Text\ProduceHashedWordBags.cs (1)
86Console.Write($"{slots[item.Key]} ");
Dynamic\Transforms\Text\ProduceNgrams.cs (1)
92Console.Write($"{slots[item.Key]} ");
Dynamic\Transforms\Text\ProduceWordBags.cs (1)
92Console.Write($"{slots[item.Key]} ");
Microsoft.ML.SearchSpace (17)
Option\NestOption.cs (4)
31return this.OrderBy(kv => kv.Key) 42return this.OrderBy(kv => kv.Key) 53foreach (var kv in this.OrderBy(kv => kv.Key)) 57param[kv.Key] = kv.Value.SampleFromFeatureSpace(feature);
Parameter.cs (2)
224parameter[param.Key] = param.Value; 327(_value as Dictionary<string, Parameter>).Add(item.Key, item.Value);
SearchSpace.cs (11)
39_options = options.ToDictionary(kv => kv.Key, kv => kv.Value); 45_options = options.ToDictionary(kv => kv.Key, kv => kv.Value); 59return this.OrderBy(kv => kv.Key) 99return this.OrderBy(kv => kv.Key) 176return fieldOptions.Concat(propertyOptions).ToDictionary(kv => kv.Key, kv => kv.Value); 187nestOption[kv.Key] = kv.Value; 393res[kv.Key] = Update(left.ContainsKey(kv.Key) ? left[kv.Key] : null, right.ContainsKey(kv.Key) ? right[kv.Key] : null);
Microsoft.ML.StandardTrainers (7)
FactorizationMachine\FieldAwareFactorizationMachineUtils.cs (2)
39featureIndexBuffer[count] = bias + pair.Key; 153return InputRoleMappedSchema.GetColumnRoles().Select(kvp => new KeyValuePair<RoleMappedSchema.ColumnRole, string>(kvp.Key, kvp.Value.Name));
Standard\LinearPredictorUtils.cs (3)
201b.AppendLine().AppendFormat("{0}\t{1}", weightValue.Key, (float)weightValue.Value); 217int index = weight.Key; 237results.Add(new KeyValuePair<string, object>(kvp.Key, kvp.Value));
Standard\LogisticRegression\MulticlassLogisticRegression.cs (2)
856int index = weight.Key; 879writer.WriteLine("\t{0}\t{1}", namedValues.Key, (float)namedValues.Value);
Microsoft.ML.Sweeper (29)
Algorithms\NelderMead.cs (29)
167if (previousRuns.Any(runResult => runResult.ParameterSet.Equals(_pendingSweeps[0].Key))) 176return _pendingSweeps.Select(kvp => kvp.Key).ToArray(); 178return new ParameterSet[] { _pendingSweeps[0].Key }; 183if (_secondWorst.Key.CompareTo(_lastReflectionResult.Key) < 0 && _lastReflectionResult.Key.CompareTo(_best.Key) <= 0) 186UpdateSimplex(_lastReflectionResult.Key, _lastReflectionResult.Value); 190if (_lastReflectionResult.Key.CompareTo(_best.Key) > 0) 203else if (_lastReflectionResult.Key.CompareTo(_worst.Key) > 0) 217if (previousRuns.Any(runResult => runResult.ParameterSet.Equals(_pendingSweeps[0].Key))) 226return _pendingSweeps.Select(kvp => kvp.Key).ToArray(); 228return new ParameterSet[] { _pendingSweeps[0].Key }; 232var expansionResult = FindRunResult(previousRuns)[0].Key; 233if (expansionResult.CompareTo(_lastReflectionResult.Key) > 0) 240UpdateSimplex(_lastReflectionResult.Key, _lastReflectionResult.Value); 245var outerContractionResult = FindRunResult(previousRuns)[0].Key; 246if (outerContractionResult.CompareTo(_lastReflectionResult.Key) > 0) 260return _pendingSweeps.Select(kvp => kvp.Key).ToArray(); 264var innerContractionResult = FindRunResult(previousRuns)[0].Key; 265if (innerContractionResult.CompareTo(_worst.Key) > 0) 279return _pendingSweeps.Select(kvp => kvp.Key).ToArray(); 303_simplexVertices.Remove(_worst.Key); 353newSimplexVertices.Add(result.Key, result.Value); 354newSimplexVertices.Add(_best.Key, _best.Value); 368if (run.ParameterSet.Equals(sweep.Key)) 426result[i] = point.Key;
Microsoft.ML.Sweeper.Tests (1)
TestSweeper.cs (1)
292sweeper.Update(run.Key, run.Value);
Microsoft.ML.Tests (7)
TextLoaderTests.cs (7)
758Assert.Equal(entry.Key, previewIris.RowView[0].Values[index].Key); 761Assert.Equal("Type", previewIris.RowView[0].Values[index].Key); 774Assert.Equal("Features", previewIrisStartEnd.RowView[0].Values[0].Key); 856Assert.Equal(entry.Key, previewIris.RowView[0].Values[index].Key); 859Assert.Equal("Type", previewIris.RowView[0].Values[index].Key);
Microsoft.ML.TimeSeries (18)
RootCauseAnalyzer.cs (16)
80string key = entry.Key; 130return new Dictionary<string, object>(keyList.Select(dim => new KeyValuePair<string, object>(dim, dimension[dim])).ToDictionary(kvp => kvp.Key, kvp => kvp.Value)); 490if (dimension.Key.AnomalyDis.Count == 1 || (isLeavesLevel ? dimension.Value >= meanGain : dimension.Value <= meanGain)) 494best = dimension.Key; 499if (dimension.Key.AnomalyDis.Count > 1) 506else if (dimension.Key.AnomalyDis.Count == 1) 511best = dimension.Key; 527valueMapAsList.RemoveAll(kv => kv.Key == best); 539if (dimension.Key.AnomalyDis.Count != dimension.Key.PointDis.Count) 541best = dimension.Key; 546best = dimension.Key; 726if (!bigDictionary.ContainsKey(item.Key) || !object.Equals(bigDictionary[item.Key], smallDictionary[item.Key])) 830if (!object.Equals(pair.Value, y[pair.Key]))
RootCauseLocalizationType.cs (2)
158if (!object.Equals(other.Dimension[item.Key], item.Value)) 231if (!object.Equals(other.Dimension[item.Key], item.Value))
Microsoft.ML.TimeSeries.Tests (5)
TimeSeriesDirectApi.cs (5)
977Assert.Equal(expectedDim[pair.Key], pair.Value); 1006Assert.Equal(expectedDim[pair.Key], pair.Value); 1022Assert.Equal(expectedDim[pair.Key], pair.Value); 1056Assert.Equal(expectedDim[pair.Key], pair.Value); 1206Assert.Equal(expectedDim[pair.Key], pair.Value);
Microsoft.ML.Tokenizers (37)
Model\BertTokenizer.cs (3)
778if (!vocab.TryGetValue(new StringSpanOrdinalKey(kvp.Key), out int id) || id != kvp.Value) 780throw new ArgumentException($"The special token '{kvp.Key}' is not in the vocabulary or assigned id value {id} different than the value {kvp.Value} in the special tokens."); 785AddSpecialToken(vocab, tempSpecialTokens, kvp.Key, true);
Model\BPETokenizer.cs (6)
156vocab.Add(new StringSpanOrdinalKey(kvp.Key), kvp.Value); 349VocabReverse.Add(kvp.Value, kvp.Key.Data!); 355_specialTokens = specialTokens.ToDictionary(kvp => new StringSpanOrdinalKey(kvp.Key), kvp => (kvp.Value, kvp.Key)); 356_specialTokensReverse = specialTokens.ToDictionary(kvp => kvp.Value, kvp => kvp.Key); 766public IReadOnlyDictionary<string, int> Vocabulary => _vocabOriginal ??= new ReadOnlyDictionary<string, int>(_vocab.ToDictionary(kvp => kvp.Key.Data!, kvp => kvp.Value));
Model\CodeGenTokenizer.cs (3)
137_specialTokens = specialTokens.ToDictionary(kvp => new StringSpanOrdinalKey(kvp.Key), kvp => (kvp.Value, kvp.Key)); 138_specialTokensReverse = specialTokens.ToDictionary(kvp => kvp.Value, kvp => kvp.Key);
Model\EnglishRobertaTokenizer.cs (1)
242vocab.Add(item.Key.ToString(), item.Value);
Model\SentencePieceBaseModel.cs (4)
46InternalSpecialTokens.Add(new StringSpanOrdinalKey(item.Key), item.Value); 47SpecialTokensReverse.Add(item.Value, item.Key); 93InternalSpecialTokens.Add(new StringSpanOrdinalKey(item.Key), item.Value); 94SpecialTokensReverse.Add(item.Value, item.Key);
Model\SentencePieceBpeModel.cs (1)
54vocab.Add(item.Key.ToString(), item.Value.Id);
Model\SentencePieceTokenizer.cs (1)
724mergedSpecialTokens[kvp.Key] = kvp.Value;
Model\TiktokenTokenizer.cs (7)
143_decoder![specialToken.Value] = Encoding.UTF8.GetBytes(specialToken.Key); 144_cache!.Add(specialToken.Key, new[] { (Id: specialToken.Value, TokenIndex0: 0, TokenLength: specialToken.Key.Length) }); 991internal IReadOnlyDictionary<string, int> Vocabulary => _vocabOriginal ??= _vocab.ToDictionary(kvp => kvp.Key.Data!, kvp => kvp.Value.Id); 1309tiktokenConfiguration.SpecialTokens.Add(extraSpecialToken.Key, extraSpecialToken.Value); 1469tiktokenConfiguration.SpecialTokens.Add(extraSpecialToken.Key, extraSpecialToken.Value); 1509tiktokenConfiguration.SpecialTokens.Add(extraSpecialToken.Key, extraSpecialToken.Value);
Model\WordPieceTokenizer.cs (1)
45SpecialTokensReverse = options.SpecialTokens is not null ? options.SpecialTokens.GroupBy(kvp => kvp.Value).ToDictionary(g => g.Key, g => g.First().Key) : null;
Normalizer\SentencePieceNormalizer.cs (2)
259var token = kvp.Key; 294var token = kvp.Key;
Utils\ByteToUnicodeEncoding.cs (1)
36UnicodeToByte = ByteToUnicode.ToDictionary(kv => kv.Value, kv => kv.Key);
Utils\DoubleArrayTrie.cs (2)
746int encodingLength = Encoding.UTF8.GetByteCount(pair.Key); 758encodingLength = Helpers.GetUtf8Bytes(pair.Key.AsSpan(), bytes);
Utils\LruCache.cs (1)
113_cache.Remove(new StringSpanOrdinalKey(nodeToEvict!.Value.Key));
Utils\TokenizerExtensions.cs (4)
42dictionary[pair.Value] = pair.Key; 56dictionary[pair.Value] = pair.Key; 74if (pair.Key >= 0) 76writer.WriteNumber(pair.Value, pair.Key);
Microsoft.ML.Tokenizers.Tests (16)
BpeTests.cs (2)
316var reverseVocabulary = bpe.Vocabulary.ToDictionary(kvp => kvp.Value, kvp => kvp.Key); 814private static IReadOnlyDictionary<int, string> _vocabReverse = _deepSeekR1Tokenizer.Vocabulary.ToDictionary(kvp => kvp.Value, kvp => kvp.Key);
CodeGenTests.cs (2)
498var reverseVocab = codeGenTokenizer.Vocabulary.ToDictionary(kvp => kvp.Value, kvp => kvp.Key); 499var reverseSpecialTokens = codeGenTokenizer.SpecialTokens?.ToDictionary(kvp => kvp.Value, kvp => kvp.Key);
EnglishRobertaTests.cs (1)
287var reverseVocab = robertaModel.Vocabulary.ToDictionary(kvp => kvp.Value, kvp => kvp.Key);
LlamaTests.cs (7)
253var reverseVocabulary = bpe.Vocabulary.ToDictionary(kvp => kvp.Value, kvp => kvp.Key); 664encodedTokens = tokenizer.EncodeToTokens(kvp.Key, out normalizedText); 665Assert.Equal(new[] { tokenizer.BeginningOfSentenceToken, kvp.Key }, encodedTokens.Select(et => et.Value).ToArray()); 667Assert.Equal($"{kvp.Key}", normalizedText); 669encodedIds = tokenizer.EncodeToIds(kvp.Key); 672tokenCount = tokenizer.CountTokens(kvp.Key); 675sb.Append($" Hello{kvp.Key}");
src\Microsoft.ML.Tokenizers\Utils\ByteToUnicodeEncoding.cs (1)
36UnicodeToByte = ByteToUnicode.ToDictionary(kv => kv.Value, kv => kv.Key);
src\Microsoft.ML.Tokenizers\Utils\DoubleArrayTrie.cs (2)
746int encodingLength = Encoding.UTF8.GetByteCount(pair.Key); 758encodingLength = Helpers.GetUtf8Bytes(pair.Key.AsSpan(), bytes);
TiktokenTests.cs (1)
136Assert.True(externalEncoder.TryGetValue(kvp.Key, out int value));
Microsoft.ML.TorchSharp (4)
Utils\DefaultDictionary.cs (2)
57_dictionary.Add(item.Key, item.Value); 77return _dictionary.Remove(item.Key);
Utils\TorchUtils.cs (2)
29if (kvp.Key is torch.Tensor keyTensor) 32else if (kvp.Key is Dictionary<dynamic, dynamic> subDictionary)
Microsoft.ML.Transforms (29)
CountFeatureSelection.cs (1)
438_count[kvp.Key]++;
Dracula\CMCountTable.cs (4)
62Contracts.Check(tables.All(t => t.All(t2 => t2.Max(kvp => kvp.Key) < Width)), "Keys must be between 0 and Width - 1"); 138ctx.Writer.Write(kvp.Key); 254_tables[iLabel][iDepth].Add(kvp.Key, kvp.Value); 273tables[iLabel][iDepth].Add(kvp.Key, (float)kvp.Value);
Dracula\CountTableTransformer.cs (1)
659int i = pair.Key;
Dracula\DictCountTable.cs (3)
109ctx.Writer.Write(pair.Key); 191_tables[i][kvp.Key] = kvp.Value; 216dest[pair.Key] = (float)pair.Value;
Expression\LambdaParser.cs (2)
247_mapTidStr[kvp.Value.Kind] = kvp.Key.Value.ToString(); 250_mapTidStr[kvp.Value] = kvp.Key.Value.ToString();
KeyToVectorMapping.cs (2)
315Contracts.Assert(slot == (long)kvpSlot.Key * _bitsPerKey[iinfo]); 320sb.Append('[').Append(kvpSlot.Key).Append(']');
PermutationFeatureImportance.cs (2)
88msgFilteredOutFeatures.Append(GetSlotName(slotNames, k.Key)); 93workingFeatureIndices.Add(k.Key);
SvmLight\SvmLightSaver.cs (2)
164writer.Write(" {0}:{1}", _zero ? pair.Key : (pair.Key + 1), pair.Value);
Text\LdaTransform.cs (5)
347itemScores.Add(new ModelParameters.ItemScore(p.Key, p.Value)); 364mapping.GetItemOrDefault(p.Key, ref slotName); 365wordScores.Add(new ModelParameters.WordItemScore(p.Key, slotName.ToString(), p.Value)); 404ctx.Writer.Write(p.Key); 531int index = retTopics[i].Key;
Text\NgramTransform.cs (1)
293invDocFreqs[iinfo][pair.Key] += 1;
Text\SentimentAnalyzingTransform.cs (2)
134return new ColumnCopyingTransformer(env, hiddenNames.Select(x => (Name: x.Key, Source: x.Value)).ToArray()).Transform(input); 142input = new ColumnCopyingTransformer(env, hiddenNames.Select(x => (outputColumnName: x.Key, inputColumnName: x.Value)).ToArray()).Transform(input);
Text\StopWordsRemovingTransformer.cs (3)
511if (activeOutput(pair.Key)) 514if (_languageColumns[pair.Key] != -1) 515active[_languageColumns[pair.Key]] = true;
Text\TextFeaturizingEstimator.cs (1)
607srcTaggedCols.Select(kvp => (kvp.Value, kvp.Key)))), ref view);
Microsoft.NET.Build.Containers (5)
ImageConfig.cs (4)
251if (property.Key is { } propertyName 270if (property.Key is { } propertyName && property.Value is JsonValue propertyValue) 318envVarJson.Add($"{envVar.Key}={envVar.Value}"); 328container.Add(label.Key, label.Value);
src\sdk\src\Common\VSHostObject.cs (1)
116taskItem.SetMetadata(kvp.Key, kvp.Value);
Microsoft.NET.Build.Extensions.Tasks (3)
src\sdk\src\Tasks\Common\ConflictResolution\PackageOverrideResolver.cs (3)
70if (existingPackageOverride.OverriddenPackages.TryGetValue(newOverride.Key, out OverrideVersion? existingOverrideVersion)) 74existingPackageOverride.OverriddenPackages[newOverride.Key] = newOverride.Value; 79existingPackageOverride.OverriddenPackages[newOverride.Key] = newOverride.Value;
Microsoft.NET.Build.Tasks (50)
_generated\10\WorkloadSetJsonSerializerContext.DictionaryStringString.g.cs (1)
59writer.WriteString(entry.Key, entry.Value);
_generated\11\WorkloadSetJsonSerializerContext.IDictionaryStringString.g.cs (1)
59writer.WriteString(entry.Key, entry.Value);
_generated\19\InstallStateJsonSerializerContext.DictionaryStringString.g.cs (1)
59writer.WriteString(entry.Key, entry.Value);
DependencyContextBuilder.cs (2)
497.Select(runtimeDict => _runtimeGraph.ExpandRuntime(runtimeDict.Key)) 618name: runtimePack.Key,
FrameworkPackages\FrameworkPackages.cs (1)
101var candidateFrameworks = FrameworkPackagesByFramework.Where(pair => pair.Value.ContainsKey(frameworkKey)).Select(pair => pair.Key);
GenerateRuntimeConfigurationFiles.cs (2)
301runtimeOptions.RawOptions.Add(runtimeOption.Key, runtimeOption.Value); 483json[rawOption.Key] = rawOption.Value?.DeepClone();
GetAssemblyAttributes.cs (1)
53var item = new TaskItem(kv.Key);
GetPackagesToPrune.cs (4)
223AddPackagesToPrune(packagesToPrune, packagesForFrameworkReference.Select(kvp => (kvp.Key, kvp.Value)), log); 231var item = new TaskItem(p.Key); 260.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); 285?.ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
LockFileLookup.cs (4)
90return string.Equals(x.Key, y.Key, StringComparison.OrdinalIgnoreCase) && 97if (obj.Key != null) 99hashCode ^= StringComparer.OrdinalIgnoreCase.GetHashCode(obj.Key);
NugetContentAssetPreprocessor.cs (2)
67foreach (var pair in values.OrderBy(v => v.Key)) 69streamWriter.Write(pair.Key);
ParseTargetManifests.cs (2)
51string packageName = storeEntry.Key.Id; 52string packageVersion = storeEntry.Key.Version.ToNormalizedString();
ProjectContext.cs (2)
293if (packagesToBeFiltered.TryGetValue(entry.Key, out librarySet)) 300exclusionList.Add(entry.Key);
ResolveAppHosts.cs (1)
225var item = new TaskItem(packageInformation.Key);
ResolvePackageDependencies.cs (1)
396item.SetMetadata(property.Key, property.Value);
src\sdk\src\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\SdkDirectoryWorkloadManifestProvider.cs (5)
408var manifestSpecifier = new ManifestSpecifier(kvp.Key, kvp.Value.Version, kvp.Value.FeatureBand); 429var manifestSpecifier = new ManifestSpecifier(kvp.Key, kvp.Value.Version, kvp.Value.FeatureBand); 463_knownManifestIdsAndOrder.TryGetValue(kvp.Key, out var order)) 469.ThenBy(kvp => kvp.Key, StringComparer.OrdinalIgnoreCase) 575var manifestSpecifier = new ManifestSpecifier(manifestEntry.Key, manifestEntry.Value.Version, manifestEntry.Value.FeatureBand);
src\sdk\src\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\WorkloadResolver.cs (11)
148if (_manifests.TryGetValue(dependency.Key, out var t)) 153throw new WorkloadManifestCompositionException(Strings.ManifestDependencyVersionTooLow, dependency.Key, resolvedDependency.Version, dependency.Value, manifest.Id, manifest.ManifestPath); 158throw new WorkloadManifestCompositionException(Strings.ManifestDependencyMissing, dependency.Key, manifest.Id, manifest.ManifestPath); 171if (!_workloads.TryAdd(workload.Key, ((WorkloadDefinition)workload.Value, manifest))) 173WorkloadManifest conflictingManifest = _workloads[workload.Key].manifest; 174throw new WorkloadManifestCompositionException(Strings.ConflictingWorkloadDefinition, workload.Key, manifest.Id, manifest.ManifestPath, conflictingManifest.Id, conflictingManifest.ManifestPath); 181if (!_packs.TryAdd(pack.Key, (pack.Value, manifest))) 183WorkloadManifest conflictingManifest = _packs[pack.Key].manifest; 184throw new WorkloadManifestCompositionException(Strings.ConflictingWorkloadPack, pack.Key, manifest.Id, manifest.ManifestPath, conflictingManifest.Id, conflictingManifest.ManifestPath); 397throw new Exception($"Workload not found: {workloadId}. Known workloads: {string.Join(" ", _workloads.Select(workload => workload.Key.ToString()))}"); 642overlayResolver._manifests.TryAdd(manifest.Key, manifest.Value);
src\sdk\src\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\WorkloadSet.cs (6)
45throw new FormatException(string.Format(Strings.InvalidVersionForWorkload, manifest.Key, manifestVersionString)); 57return (id: new ManifestId(manifest.Key), manifestVersion, manifestFeatureBand); 86if (workloadSet.ManifestVersions.ContainsKey(kvp.Key)) 88throw new InvalidOperationException($"Workload set files in {path} defined the same manifest ({kvp.Key}) multiple times"); 90workloadSet.ManifestVersions.Add(kvp.Key, kvp.Value); 112var dictionary = ManifestVersions.ToDictionary(kvp => kvp.Key.ToString(), kvp => kvp.Value.Version + "/" + kvp.Value.FeatureBand, StringComparer.OrdinalIgnoreCase);
src\sdk\src\Tasks\Common\ConflictResolution\PackageOverrideResolver.cs (3)
70if (existingPackageOverride.OverriddenPackages.TryGetValue(newOverride.Key, out OverrideVersion? existingOverrideVersion)) 74existingPackageOverride.OverriddenPackages[newOverride.Key] = newOverride.Value; 79existingPackageOverride.OverriddenPackages[newOverride.Key] = newOverride.Value;
Microsoft.NET.HostModel (16)
ComHost\ComHost.cs (3)
49if (!ResourceUpdater.IsIntResource((IntPtr)typeLibrary.Key)) 51throw new InvalidTypeLibraryIdException(typeLibrary.Value, typeLibrary.Key); 60updater.AddResource(tlbFileBytes, "TYPELIB", (IntPtr)typeLibrary.Key);
ComHost\RegFreeComManifest.cs (1)
92new XAttribute("resourceid", typeLibrary.Key),
src\runtime\src\coreclr\tools\Common\Compiler\Win32Resources\ResourceData.cs (12)
138return _resTypeHeadID.SelectMany(typeIdPair => SelectResType(typeIdPair.Key, typeIdPair.Value)) 139.Concat(_resTypeHeadName.SelectMany(typeNamePair => SelectResType(typeNamePair.Key, typeNamePair.Value))); 143return resType.NameHeadID.SelectMany(nameIdPair => SelectResName(type, nameIdPair.Key, nameIdPair.Value)) 145SelectResName(type, nameNamePair.Key, nameNamePair.Value))); 150return resType.Languages.Select((lang) => (name, type, lang.Key, lang.Value.DataEntry)); 206resTypes.Add(new Tuple<ResType, ObjectDataBuilder.Reservation>(res.Value, IMAGE_RESOURCE_DIRECTORY_ENTRY.Write(ref dataBuilder, res.Key, nameTable))); 210resTypes.Add(new Tuple<ResType, ObjectDataBuilder.Reservation>(res.Value, IMAGE_RESOURCE_DIRECTORY_ENTRY.Write(ref dataBuilder, res.Key))); 220resNames.Add(new Tuple<ResName, ObjectDataBuilder.Reservation>(res.Value, IMAGE_RESOURCE_DIRECTORY_ENTRY.Write(ref dataBuilder, res.Key, nameTable))); 224resNames.Add(new Tuple<ResName, ObjectDataBuilder.Reservation>(res.Value, IMAGE_RESOURCE_DIRECTORY_ENTRY.Write(ref dataBuilder, res.Key))); 234resLanguages.Add(new Tuple<ResLanguage, ObjectDataBuilder.Reservation>(res.Value, IMAGE_RESOURCE_DIRECTORY_ENTRY.Write(ref dataBuilder, res.Key))); 247dataBuilder.EmitUShort(checked((ushort)name.Key.Length)); 248foreach (char c in name.Key)
Microsoft.NET.Sdk.BlazorWebAssembly.Tasks (5)
src\sdk\src\StaticWebAssetsSdk\Tasks\Data\StaticWebAsset.cs (5)
269if (!groups.TryGetValue((SourceId, requirement.Key), out var group)) 1856result.Add(kvp.Key); 2012result[kvp.Key] = kvp.Value; 2051destinationItem.SetMetadata(kvp.Key, kvp.Value ?? ""); 2075$"Label: {PathLabel}, Route: {Path}, Tokens: {string.Join(", ", Tokens.Select(t => $"{t.Key}={t.Value}"))}";
Microsoft.NET.Sdk.Publish.Tasks (6)
MsDeploy\CommonUtility.cs (4)
1713if (x.Key == y.Key) 1719return x.Key - y.Key;
src\sdk\src\Common\VSHostObject.cs (1)
116taskItem.SetMetadata(kvp.Key, kvp.Value);
Tasks\GenerateEnvTransform.cs (1)
77new XElement("environmentVariable", new XAttribute("name", envVariable.Key),
Microsoft.NET.Sdk.StaticWebAssets.Tasks (32)
_generated\22\StaticWebAssetsJsonSerializerContext.DictionaryStringStaticWebAssetNode.g.cs (1)
59writer.WritePropertyName(entry.Key);
_generated\23\StaticWebAssetsJsonSerializerContext.DictionaryStringStaticWebAsset.g.cs (1)
59writer.WritePropertyName(entry.Key);
_generated\36\DefineStaticWebAssetsSerializerContext.DictionaryStringCopyCandidate.g.cs (1)
61writer.WritePropertyName(entry.Key);
_generated\37\DefineStaticWebAssetsSerializerContext.DictionaryStringStaticWebAsset.g.cs (1)
61writer.WritePropertyName(entry.Key);
_generated\46\ImportMapSerializerContext.DictionaryStringDictionaryStringString.g.cs (1)
59writer.WritePropertyName(entry.Key);
_generated\47\ImportMapSerializerContext.DictionaryStringString.g.cs (1)
59writer.WriteString(entry.Key, entry.Value);
ComputeReferenceStaticWebAssetItems.cs (1)
62var targetPath = kvp.Key;
ComputeStaticWebAssetsForCurrentProject.cs (1)
37var targetPath = kvp.Key;
Data\StaticWebAsset.cs (5)
269if (!groups.TryGetValue((SourceId, requirement.Key), out var group)) 1856result.Add(kvp.Key); 2012result[kvp.Key] = kvp.Value; 2051destinationItem.SetMetadata(kvp.Key, kvp.Value ?? ""); 2075$"Label: {PathLabel}, Route: {Path}, Tokens: {string.Join(", ", Tokens.Select(t => $"{t.Key}={t.Value}"))}";
Data\StaticWebAssetEndpoint.cs (3)
471result.Add(kvp.Key); 542result[kvp.Key] = kvp.Value; 567destinationItem.SetMetadata(kvp.Key, kvp.Value ?? "");
DefineStaticWebAssetEndpoints.cs (1)
217properties[i++] = new StaticWebAssetEndpointProperty { Name = value.Key, Value = value.Value };
DefineStaticWebAssets.Cache.cs (2)
217var hash = kvp.Key; 244var hash = kvp.Key;
DefineStaticWebAssets.cs (1)
127var hash = kvp.Key;
FilterStaticWebAssetEndpoints.cs (1)
73assetFiles.Remove(asset.Key);
GenerateStaticWebAssetsDevelopmentManifest.cs (1)
310ContentRoots = contentRootIndex.OrderBy(kvp => kvp.Value).Select(kvp => kvp.Key).ToArray(),
GenerateStaticWebAssetsManifest.cs (1)
67if (!StaticWebAsset.ValidateAssetGroup(group.Key, group.Value, out var reason, groupSet))
JSModules\ApplyJsModules.cs (3)
62if (RazorComponents.Any(rc => string.Equals(rc.ItemSpec, kvp.Key, StringComparison.OrdinalIgnoreCase))) 64var component = kvp.Key; 77var view = kvp.Key;
MergeStaticWebAssets.cs (1)
42Log.LogMessage(MessageImportance.Normal, $"Merging '{group.Count}' assets for {kvp.Key}.");
ScopedCss\ApplyCssScopes.cs (3)
65if (RazorComponents.Any(rc => string.Equals(rc.ItemSpec, kvp.Key, StringComparison.OrdinalIgnoreCase))) 67var component = kvp.Key; 80var view = kvp.Key;
UpdatePackageStaticWebAssets.cs (1)
137kvp.Key, endpoint.Route, oldAssetFile, info.NewIdentity);
UpdateStaticWebAssetEndpoints.cs (1)
63var route = kvp.Key;
Microsoft.NET.Sdk.WorkloadManifestReader (25)
_generated\0\WorkloadSetJsonSerializerContext.DictionaryStringString.g.cs (1)
59writer.WriteString(entry.Key, entry.Value);
_generated\1\WorkloadSetJsonSerializerContext.IDictionaryStringString.g.cs (1)
59writer.WriteString(entry.Key, entry.Value);
_generated\9\InstallStateJsonSerializerContext.DictionaryStringString.g.cs (1)
59writer.WriteString(entry.Key, entry.Value);
SdkDirectoryWorkloadManifestProvider.cs (5)
408var manifestSpecifier = new ManifestSpecifier(kvp.Key, kvp.Value.Version, kvp.Value.FeatureBand); 429var manifestSpecifier = new ManifestSpecifier(kvp.Key, kvp.Value.Version, kvp.Value.FeatureBand); 463_knownManifestIdsAndOrder.TryGetValue(kvp.Key, out var order)) 469.ThenBy(kvp => kvp.Key, StringComparer.OrdinalIgnoreCase) 575var manifestSpecifier = new ManifestSpecifier(manifestEntry.Key, manifestEntry.Value.Version, manifestEntry.Value.FeatureBand);
WorkloadResolver.cs (11)
148if (_manifests.TryGetValue(dependency.Key, out var t)) 153throw new WorkloadManifestCompositionException(Strings.ManifestDependencyVersionTooLow, dependency.Key, resolvedDependency.Version, dependency.Value, manifest.Id, manifest.ManifestPath); 158throw new WorkloadManifestCompositionException(Strings.ManifestDependencyMissing, dependency.Key, manifest.Id, manifest.ManifestPath); 171if (!_workloads.TryAdd(workload.Key, ((WorkloadDefinition)workload.Value, manifest))) 173WorkloadManifest conflictingManifest = _workloads[workload.Key].manifest; 174throw new WorkloadManifestCompositionException(Strings.ConflictingWorkloadDefinition, workload.Key, manifest.Id, manifest.ManifestPath, conflictingManifest.Id, conflictingManifest.ManifestPath); 181if (!_packs.TryAdd(pack.Key, (pack.Value, manifest))) 183WorkloadManifest conflictingManifest = _packs[pack.Key].manifest; 184throw new WorkloadManifestCompositionException(Strings.ConflictingWorkloadPack, pack.Key, manifest.Id, manifest.ManifestPath, conflictingManifest.Id, conflictingManifest.ManifestPath); 397throw new Exception($"Workload not found: {workloadId}. Known workloads: {string.Join(" ", _workloads.Select(workload => workload.Key.ToString()))}"); 642overlayResolver._manifests.TryAdd(manifest.Key, manifest.Value);
WorkloadSet.cs (6)
45throw new FormatException(string.Format(Strings.InvalidVersionForWorkload, manifest.Key, manifestVersionString)); 57return (id: new ManifestId(manifest.Key), manifestVersion, manifestFeatureBand); 86if (workloadSet.ManifestVersions.ContainsKey(kvp.Key)) 88throw new InvalidOperationException($"Workload set files in {path} defined the same manifest ({kvp.Key}) multiple times"); 90workloadSet.ManifestVersions.Add(kvp.Key, kvp.Value); 112var dictionary = ManifestVersions.ToDictionary(kvp => kvp.Key.ToString(), kvp => kvp.Value.Version + "/" + kvp.Value.FeatureBand, StringComparer.OrdinalIgnoreCase);
Microsoft.NET.StringTools (5)
WeakStringCache.Concurrent.cs (2)
149if (!entry.Value.IsUsed && _weakHandlesByHashCode.TryRemove(entry.Key, out StringWeakHandle? removedHandle)) 155if (!removedHandle.IsUsed || !_weakHandlesByHashCode.TryAdd(entry.Key, removedHandle))
WeakStringCacheInterner.cs (3)
151.OrderByDescending(kv => kv.Value * kv.Key.Length) 154.Select(kv => string.Format(CultureInfo.InvariantCulture, "({1} instances x each {2} chars)\n{0}", kv.Key, kv.Value, kv.Key.Length));
Microsoft.TemplateEngine.Abstractions (1)
Parameters\ParameterSetData.cs (1)
40: this(templateInfo, inputParameters?.ToDictionary(p => p.Key, p => (object?)p.Value))
Microsoft.TemplateEngine.Cli (43)
Alias\AliasModel.cs (1)
17CommandAliases = new Dictionary<string, IReadOnlyList<string>>(commandAliases.ToDictionary(x => x.Key, x => x.Value), StringComparer.OrdinalIgnoreCase);
Alias\AliasRegistry.cs (4)
158commandAliases[kvp.Key] = arr; 183if (string.Equals(prop.Key, propertyName, StringComparison.OrdinalIgnoreCase)) 203result[property.Key] = new List<string>() { property.Value.GetValue<string>() }; 215result[property.Key] = values;
ChoiceTemplateParameter.cs (2)
31_choices = parameter.Choices.ToDictionary(kvp => kvp.Key, kvp => kvp.Value, StringComparer.OrdinalIgnoreCase); 37_choices = choiceTemplateParameter.Choices.ToDictionary(kvp => kvp.Key, kvp => kvp.Value, StringComparer.OrdinalIgnoreCase);
CliTemplateParameter.cs (1)
477displayValue.Append(Indent + choiceInfo.Key.PadRight(longestChoiceLength + Indent.Length));
Commands\create\CombinedChoiceTemplateParameter.cs (4)
21if (!_combinedParameters.ContainsKey(choice.Key)) 23_combinedParameters[choice.Key] = choice.Value; 43if (!_combinedParameters.ContainsKey(choice.Key)) 45_combinedParameters[choice.Key] = choice.Value;
Commands\create\InvalidTemplateOptionResult.cs (3)
140validChoices[choice.Key] = choice.Value; 157foreach (KeyValuePair<string, ParameterChoice> choiceInfo in possibleValues.OrderBy(x => x.Key, StringComparer.Ordinal)) 160text.Indent(1).Append(choiceInfo.Key.PadRight(longestChoiceLength));
Commands\create\TemplateCommand.cs (2)
99if (template.BaselineInfo.Any(b => !string.IsNullOrWhiteSpace(b.Key))) 103BaselineOption.FromAmongCaseInsensitive(template.BaselineInfo.Select(b => b.Key).Where(b => !string.IsNullOrWhiteSpace(b)).ToArray());
Commands\create\TemplateCommandArgs.cs (3)
47_templateOptions[opt.Key] = result; 75return _templateOptions.Select(o => (o.Key, GetValue(o.Key, o.Value)))
Commands\InvalidTemplateParametersException.cs (1)
27stringBuilder.AppendLine().Append(error.Key.Name.Indent(1));
HostSpecificTemplateData.cs (10)
52symbolProperties[symbolProperty.Key] = ""; 57symbolProperties[symbolProperty.Key] = kind switch 67symbolsInfo[symbolInfo.Key] = symbolProperties; 114hiddenNames.Add(paramInfo.Key); 133parametersToAlwaysShow.Add(paramInfo.Key); 151map.Add(paramInfo.Key, longNameOverride); 169map.Add(paramInfo.Key, shortNameOverride); 199if (string.Equals(kvp.Key, key, StringComparison.OrdinalIgnoreCase)) 225writer.WritePropertyName(symbol.Key); 229writer.WriteString(prop.Key, prop.Value);
JExtensions.cs (1)
276if (string.Equals(kvp.Key, key, StringComparison.OrdinalIgnoreCase))
PostActionProcessors\ChmodPostActionProcessor.cs (4)
50Arguments = $"-c \"chmod {entry.Key} {file}\"" 55Reporter.Error.WriteLine(LocalizableStrings.UnableToSetPermissions, entry.Key, file); 65Reporter.Error.WriteLine(LocalizableStrings.UnableToSetPermissions, entry.Key, file); 71Reporter.Error.WriteLine(LocalizableStrings.UnableToSetPermissions, entry.Key, file);
TemplateGroup.cs (1)
117baselines.Add(baseline.Key);
TemplatePackageCoordinator.cs (1)
374IReadOnlyList<UninstallResult> uninstallResults = await providerSourcesToUninstall.Key.UninstallAsync(providerSourcesToUninstall.Value, cancellationToken).ConfigureAwait(false);
TemplatePackageDisplay.cs (1)
251Reporter.Output.WriteLine($"{detail.Key}: {GetFormattedValue(detail.Value)}".Indent(level: 3));
TemplateResolution\TemplateGroupMatchInfo.cs (1)
274validChoices[choice.Key] = choice.Value;
TemplateSearch\CliHostSearchCacheData.cs (3)
28var keys = new HashSet<string>(cacheObject.Select(p => p.Key), StringComparer.OrdinalIgnoreCase); 40cliData[data.Key] = new HostSpecificTemplateData(data.Value as JsonObject); 44Reporter.Verbose.WriteLine($"Error deserializing the cli host specific template data for template {data.Key}, details:{ex}");
Microsoft.TemplateEngine.Core (7)
Expressions\ScopeBuilder.cs (2)
56trie.AddToken(processor.Encoding.GetBytes(string.Format(processor.Config.VariableFormatString, variable.Key))); 58symbolKeys.Add(variable.Key);
Util\EncodingConfig.cs (1)
61string formattedKey = string.Format(config.VariableFormatString, item.Key);
Util\Orchestrator.cs (2)
99processorList.Add(new KeyValuePair<IPathMatcher, IProcessor>(runSpec.Key, processor)); 255IProcessor runner = (fileGlobProcessors.FirstOrDefault(x => x.Key.IsMatch(sourceRel)).Value ?? fallback)
VariableCollection.cs (2)
104if (_parent?.ContainsKey(item.Key) ?? false) 168public bool Remove(KeyValuePair<string, object> item) => Remove(item.Key);
Microsoft.TemplateEngine.Edge (36)
_generated\11\SettingsStoreJsonSerializerContext.DictionaryStringHashSetGuid.g.cs (1)
59writer.WritePropertyName(entry.Key);
_generated\12\SettingsStoreJsonSerializerContext.DictionaryStringString.g.cs (1)
59writer.WriteString(entry.Key, entry.Value);
_generated\2\GlobalSettingsJsonSerializerContext.IReadOnlyDictionaryStringString.g.cs (1)
59writer.WriteString(entry.Key, entry.Value);
_generated\31\TemplateCacheJsonSerializerContext.DictionaryStringDateTime.g.cs (1)
59writer.WriteString(entry.Key, entry.Value);
_generated\32\TemplateCacheJsonSerializerContext.IReadOnlyDictionaryStringIBaselineInfo.g.cs (1)
59writer.WritePropertyName(entry.Key);
_generated\33\TemplateCacheJsonSerializerContext.IReadOnlyDictionaryStringParameterChoice.g.cs (1)
59writer.WritePropertyName(entry.Key);
_generated\34\TemplateCacheJsonSerializerContext.IReadOnlyDictionaryStringString.g.cs (1)
59writer.WriteString(entry.Key, entry.Value);
Installers\NuGet\NuGetManagedTemplatePackage.cs (1)
70Details = details?.ToDictionary(kvp => kvp.Key, kvp => kvp.Value) ?? throw new ArgumentNullException(nameof(details));
Settings\ComponentManager.cs (2)
44Type interfaceType = Type.GetType(bucket.Key); 53if (Guid.TryParse(entry.Key, out Guid componentId))
Settings\SettingsStore.cs (2)
29ComponentGuidToAssemblyQualifiedName[entry.Key] = entry.Value.GetValue<string>(); 58ComponentTypeToGuidList[entry.Key] = set;
Settings\TemplateCache.cs (2)
101mountPointInfo.Add(entry.Key, entry.Value.GetValue<DateTime>()); 194identityToTemplates.Key,
Settings\TemplateInfo.cs (3)
173tags[tag.Key] = new CacheTag(null, null, new Dictionary<string, ParameterChoice> { { tag.Value, new ParameterChoice(null, null) } }, tag.Value); 273if (localization.Choices.TryGetValue(templateChoice.Key, out ParameterChoiceLocalizationModel locModel)) 277localizedChoices.Add(templateChoice.Key, localizedChoice);
Settings\TemplateInfoReader.cs (3)
68baselineInfo.Add(item.Key, baseline); 99tags.Add(item.Key, item.Value?.GetValue<string>() ?? string.Empty); 172cdPair.Key,
Settings\TemplatePackageManager.cs (2)
102foreach (KeyValuePair<ITemplatePackageProvider, Task<IReadOnlyList<ITemplatePackage>>> source in _cachedSources.OrderBy((p) => (p.Key.Factory as IPrioritizedComponent)?.Priority ?? 0)) 110_logger.LogError(LocalizableStrings.TemplatePackageManager_Error_FailedToGetTemplatePackages, source.Key.Factory.DisplayName, ex.Message);
src\sdk\src\TemplateEngine\Shared\JExtensions.cs (7)
305result[property.Key] = property.Value.GetValue<string>(); 323result[property.Key] = property.Value; 342result[property.Key] = property.Value.ToJsonString(); 526if (string.Equals(kvp.Key, key, StringComparison.OrdinalIgnoreCase)) 624&& target.TryGetPropertyValue(property.Key, out JsonNode? targetNode) 631&& target.TryGetPropertyValue(property.Key, out targetNode) 643target[property.Key] = property.Value != null
Template\InputDataSet.cs (1)
44: this(templateInfo, inputParameters.ToDictionary(p => p.Key, p => (object?)p.Value))
Template\InputDataSetExtensions.cs (1)
25new InputParameterData(p.Key, p.Value, DataSource.User, InputDataStateUtil.GetInputDataState(p.Value)))
Template\ParameterSetBuilder.cs (2)
77.ToDictionary(k => k.Key, k => k.Value.Value); 202variables.ToDictionary(p => p.Key, p => p.Value.Value!);
TemplateConstraintManager.cs (3)
47constraintsToInitialize = _templateConstrains.Where(kvp => uniqueConstraints.Contains(kvp.Key)).Select(kvp => (kvp.Key, kvp.Value)); 51constraintsToInitialize = _templateConstrains.Select(kvp => (kvp.Key, kvp.Value));
Microsoft.TemplateEngine.Orchestrator.RunnableProjects (43)
ConfigModel\ExtendedFileSource.cs (2)
66Rename = jObject.Get<JsonObject>(nameof(Rename))?.ToStringDictionary().ToDictionary(x => x.Key, x => x.Value) ?? RenameDefaults, 80Rename = entry.Get<JsonObject>(nameof(Rename))?.ToStringDictionary().ToDictionary(x => x.Key, x => x.Value) ?? RenameDefaults,
ConfigModel\ParameterSymbol.cs (1)
183if (locModel.Choices.TryGetValue(choice.Key, out ParameterChoiceLocalizationModel? locChoiceModel))
ConfigModel\PostActionModel.cs (1)
123args.Add(argInfo.Key, argInfo.Value?.ToString() ?? string.Empty);
ConfigModel\TemplateConfigModel.cs (16)
104if (!symbols.ContainsKey(tagInfo.Key)) 106symbols[tagInfo.Key] = ParameterSymbol.FromDeprecatedConfigTag(tagInfo.Key, tagInfo.Value); 115if (string.IsNullOrWhiteSpace(prop.Key)) 123baseline.DefaultOverrides.TryGetValue(prop.Key, out defaultOverride); 126BaseSymbol? modelForSymbol = SymbolModelConverter.GetModelForObject(prop.Key, obj, logger, defaultOverride); 131if (string.Equals(prop.Key, NameSymbolName, StringComparison.Ordinal) 132&& symbols.TryGetValue(prop.Key, out BaseSymbol existingSymbol) 137symbols[prop.Key] = new ParameterSymbol(modelForParameterSymbol, existingParameterSymbol.Forms); 142symbols[prop.Key] = modelForSymbol; 170string globName = globConfigKeyValue.Key; 373_forms[kvp.Key] = kvp.Value; 532formMap[builtInForm.Key] = builtInForm.Value.Create(); 548formMap[form.Key] = ValueFormRegistry.GetForm(form.Key, o); 567allBaselines[property.Key] = baseline;
FileRenameGenerator.cs (1)
105IOperationProvider replacementOperation = new Replacement(replacement.Key.TokenConfig(), replacement.Value, null, true);
LocalizationModelDeserializer.cs (1)
32.Select(p => p.Value?.GetValueKind() == JsonValueKind.String ? (p.Key, p.Value.GetValue<string>()) : throw new Exception(LocalizableStrings.Authoring_InvalidJsonElementInLocalizationFile))
ParameterBasedVariableCollection.cs (2)
46switch (source.Key) 62collections[source.Key] = variablesForSource;
PostAction.cs (2)
87processedArgs[arg.Key] = model.ApplyFileRenamesToArgs.Contains(arg.Key, StringComparer.OrdinalIgnoreCase)
RunnableProjectConfig.cs (3)
412string newGuid = map.Key.ToString(format.ToString()); 543Dictionary<string, string> fileRenamesFromSource = source.Rename.ToDictionary(x => x.Key, x => x.Value); 562fileRenamesFromSource[property.Key] = property.Value;
RunnableProjectConfig.ITemplate.cs (1)
94tags[tag.Key] = new CacheTag(null, null, new Dictionary<string, ParameterChoice> { { tag.Value, new ParameterChoice(null, null) } }, tag.Value);
RunnableProjectGenerator.cs (1)
510tags[tag.Key] = new CacheTag(null, null, new Dictionary<string, ParameterChoice> { { tag.Value, new ParameterChoice(null, null) } }, tag.Value);
ScannedTemplateInfo.cs (2)
33IReadOnlyDictionary<string, ILocalizationLocator> IScanTemplateInfo.Localizations => _localizations.ToDictionary(l => l.Key.Name, l => (ILocalizationLocator)l.Value); 35public IReadOnlyDictionary<string, string> HostConfigFiles => _hostConfigFiles.ToDictionary(f => f.Key, f => f.Value.FullPath);
src\sdk\src\TemplateEngine\Shared\JExtensions.cs (7)
305result[property.Key] = property.Value.GetValue<string>(); 323result[property.Key] = property.Value; 342result[property.Key] = property.Value.ToJsonString(); 526if (string.Equals(kvp.Key, key, StringComparison.OrdinalIgnoreCase)) 624&& target.TryGetPropertyValue(property.Key, out JsonNode? targetNode) 631&& target.TryGetPropertyValue(property.Key, out targetNode) 643target[property.Key] = property.Value != null
Validation\MandatoryValidationFactory.cs (3)
50ps.Choices.Where(c => !c.Key.IsValidMultiValueParameterValue()) 51.Select(c => $"{{{c.Key}}}"))), 55.Where(p => p.Choices.Any(c => !c.Key.IsValidMultiValueParameterValue()))),
Microsoft.TemplateEngine.Utils (27)
DictionaryExtensions.cs (4)
40cloneDict.Add(entry.Key, entry.Value); 63if (conflictingKeysResolution == ConflictingKeysResolution.Overwrite || !dict.ContainsKey(pair.Key)) 65dict[pair.Key] = pair.Value; 69throw new ArgumentException(string.Format(LocalizableStrings.DictionaryExtensions_Error_KeyExists, pair.Key));
DirectedGraph.cs (6)
49inDegreeLookup[depPair.Key] = depPair.Value?.Count ?? 0; 52Queue<T> noDependenciesQueue = new(inDegreeLookup.Where(kp => kp.Value == 0).Select(kp => kp.Key)); 110return _dependenciesMap.Where(p => dependentVertices.Contains(p.Key)) 111.ToDictionary(p => p.Key, p => new HashSet<T>(p.Value.Where(dependentVertices.Contains))); 154_ = dependentsMap[dependency].Add(keyValuePair.Key); 164.ToDictionary(kp => kp.Key, kp => kp.Value == null ? new() : new HashSet<T>(kp.Value));
InMemoryFileSystem.cs (8)
202if (rx.IsMatch(entry.Key)) 235if (rx.IsMatch(current.Current.Key)) 279if (rx.IsMatch(entry.Key)) 316if (rx.IsMatch(entry.Key)) 362if (rx.IsMatch(entry.Key)) 372if (rx.IsMatch(entry.Key)) 404if (rx.IsMatch(current.Current.Key)) 411if (rx.IsMatch(entry.Key))
ListExtensions.cs (1)
39allGrouped.Add(new Grouping<TKey?, TElement>(entry.Key.Val, entry.Value));
ParameterSetDataExtensions.cs (1)
21new ParameterData(p.Key, p.Value, DataSource.User))
src\sdk\src\TemplateEngine\Shared\JExtensions.cs (7)
305result[property.Key] = property.Value.GetValue<string>(); 323result[property.Key] = property.Value; 342result[property.Key] = property.Value.ToJsonString(); 526if (string.Equals(kvp.Key, key, StringComparison.OrdinalIgnoreCase)) 624&& target.TryGetPropertyValue(property.Key, out JsonNode? targetNode) 631&& target.TryGetPropertyValue(property.Key, out targetNode) 643target[property.Key] = property.Value != null
Microsoft.TemplateSearch.Common (33)
Providers\NuGetMetadataSearchProvider.cs (2)
243_ = message.AppendLine($" {header.Key}: {string.Join(", ", header.Value)}"); 247_ = message.AppendLine($" {header.Key}: {string.Join(", ", header.Value)}");
src\sdk\src\TemplateEngine\Shared\JExtensions.cs (7)
305result[property.Key] = property.Value.GetValue<string>(); 323result[property.Key] = property.Value; 342result[property.Key] = property.Value.ToJsonString(); 526if (string.Equals(kvp.Key, key, StringComparison.OrdinalIgnoreCase)) 624&& target.TryGetPropertyValue(property.Key, out JsonNode? targetNode) 631&& target.TryGetPropertyValue(property.Key, out targetNode) 643target[property.Key] = property.Value != null
TemplateDiscoveryMetadata\BlobStorageTemplateInfo.cs (12)
189baselineInfo.Add(item.Key, baseline); 230tags.Add(item.Key, item.Value?.ToString() ?? string.Empty); 243tags[item.Key] = item.Value.ToString(); 244legacyTags[item.Key] = new BlobLegacyCacheTag( 262choicesAndDescriptions[cdPair.Key] = new ParameterChoice(null, cdPair.Value?.ToString() ?? string.Empty); 263legacyChoices[cdPair.Key] = cdPair.Value?.ToString() ?? string.Empty; 266new BlobTemplateParameter(item.Key, "choice") 270legacyTags[item.Key] = new BlobLegacyCacheTag( 276tags[item.Key] = tagObj.ToString("defaultValue") ?? string.Empty; 292templateParameters.Add(new BlobTemplateParameter(item.Key, dataType)); 293legacyParams[item.Key] = new BlobLegacyCacheParameter( 370cdPair.Key,
TemplateDiscoveryMetadata\LegacySearchCacheReader.cs (6)
34if (discoveryMetadata.AdditionalData.TryGetValue(reader.Key, out object? legacyData)) 39data[reader.Key] = dict[template.Identity]; 50packageData.Add(new TemplatePackageSearchData(new PackInfo(package.Key, package.Value.Version, package.Value.TotalDownloads, package.Value.Owners, package.Value.Reserved), templateData)); 162string packName = packEntry.Key; 232JsonNode? dataNode = JExtensions.GetPropertyCaseInsensitive(additionalDataObject, dataReadInfo.Key); 239workingAdditionalData[dataReadInfo.Key] = dataReadInfo.Value(dataObject);
TemplateSearchCache\TemplatePackageSearchData.Json.cs (1)
137writer.WritePropertyName(item.Key);
TemplateSearchCache\TemplateSearchCache.Json.cs (2)
81JsonNode? dataNode = JExtensions.GetPropertyCaseInsensitive(cacheObject, dataReadInfo.Key); 90additionalData[dataReadInfo.Key] = dataReadInfo.Value(dataObject);
TemplateSearchCache\TemplateSearchData.Json.cs (3)
117writer.WritePropertyName(tag.Key); 156writer.WritePropertyName(choice.Key); 198writer.WritePropertyName(item.Key);
Microsoft.TestPlatform.CommunicationUtilities (14)
_generated\63\TestPlatformJsonContext.DictionaryStringHashSetString.g.cs (1)
59writer.WritePropertyName(entry.Key);
_generated\64\TestPlatformJsonContext.DictionaryStringIEnumerableString.g.cs (1)
59writer.WritePropertyName(entry.Key);
_generated\66\TestPlatformJsonContext.DictionaryStringString.g.cs (1)
59writer.WriteString(entry.Key, entry.Value);
_generated\73\TestPlatformJsonContext.IDictionaryStringString.g.cs (1)
59writer.WriteString(entry.Key, entry.Value);
_generated\82\TestPlatformJsonContext.KeyValuePairTestPropertyObject.g.cs (1)
60Getter = static obj => ((global::System.Collections.Generic.KeyValuePair<global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProperty, object>)obj).Key,
Json\Jsonite\Jsonite.cs (1)
1084WriteString(keyValue.Key);
Serialization\DiscoveryCriteriaFactory.cs (1)
32criteria.AdapterSourceMap.Add(adapterSources.Key, adapterSources.Value);
Serialization\ObjectConverter.cs (1)
124writer.WritePropertyName(kvp.Key);
Serialization\TestCaseConverterV2.cs (1)
94StjSafe.Serialize(writer, property.Key, options);
Serialization\TestObjectBaseConverter.cs (2)
109StjSafe.Serialize(writer, property.Key, options); 169writer.WriteString("Key", kvp.Key);
Serialization\TestObjectConverter.cs (1)
78StjSafe.Serialize(writer, kvp.Key, options);
Serialization\TestResultConverterV2.cs (1)
139StjSafe.Serialize(writer, property.Key, options);
Serialization\TestRunStatisticsConverter.cs (1)
58writer.WriteNumber(kvp.Key.ToString(), kvp.Value);
Microsoft.TestPlatform.CrossPlatEngine (36)
AttachmentsProcessing\DataCollectorAttachmentsProcessorsFactory.cs (1)
142EqtTrace.Info($"DataCollectorAttachmentsProcessorsFactory: Valid data collector attachment processor found: '{attachementProcessor.Key}'");
Client\Parallel\DiscoveryDataAggregator.cs (9)
60metrics.Key.Contains(TelemetryDataConstants.TotalTestsByAdapter)); 63metrics.Key.Contains(TelemetryDataConstants.TimeTakenToDiscoverTestsByAnAdapter)); 139if (metric.Key.Contains(TelemetryDataConstants.TimeTakenToDiscoverTestsByAnAdapter) 140|| metric.Key.Contains(TelemetryDataConstants.TimeTakenInSecByAllAdapters) 141|| metric.Key.Contains(TelemetryDataConstants.TotalTestsDiscovered) 142|| metric.Key.Contains(TelemetryDataConstants.TotalTestsByAdapter) 143|| metric.Key.Contains(TelemetryDataConstants.TimeTakenToLoadAdaptersInSec)) 148metric.Key, 171.Select(source => source.Key)
Client\Parallel\ParallelProxyDiscoveryManager.cs (1)
69.ToDictionary(pair => pair.Key, pair => pair.Value);
Client\Parallel\ParallelProxyExecutionManager.cs (1)
88.ToDictionary(pair => pair.Key, pair => pair.Value);
Client\Parallel\ParallelRunDataAggregator.cs (9)
84if (!testOutcomeMap.TryGetValue(kvp.Key, out long currentCount)) 89testOutcomeMap[kvp.Key] = currentCount + kvp.Value; 112metrics.Key.Contains(TelemetryDataConstants.TotalTestsRanByAdapter)); 115metrics.Key.Contains(TelemetryDataConstants.TimeTakenToRunTestsByAnAdapter)); 197if (metric.Key.Contains(TelemetryDataConstants.TimeTakenToRunTestsByAnAdapter) || metric.Key.Contains(TelemetryDataConstants.TimeTakenByAllAdaptersInSec) || (metric.Key.Contains(TelemetryDataConstants.TotalTestsRun) || metric.Key.Contains(TelemetryDataConstants.TotalTestsRanByAdapter))) 202metric.Key,
Client\ProxyExecutionManagerWithDataCollection.cs (4)
167if (testProcessStartInfo.EnvironmentVariables.ContainsKey(envVariable.Key)) 169testProcessStartInfo.EnvironmentVariables[envVariable.Key] = envVariable.Value; 173testProcessStartInfo.EnvironmentVariables.Add(envVariable.Key, envVariable.Value); 192testProcessStartInfo.EnvironmentVariables[kvp.Key] = kvp.Value;
Client\ProxyOperationManagerWithDataCollection.cs (1)
96testProcessStartInfo.EnvironmentVariables[kvp.Key] = kvp.Value;
DataCollection\InProcDataCollectionExtensionManager.cs (2)
302var testProperty = TestProperty.Register(id: keyValuePair.Key, label: keyValuePair.Key, category: string.Empty, description: string.Empty, valueType: typeof(string), validateValueCallback: null, attributes: TestPropertyAttributes.None, owner: typeof(TestCase));
DataCollection\ProxyDataCollectionManager.cs (1)
163_requestData.MetricsCollection.Add(metric.Key, metric.Value);
Discovery\DiscovererEnumerator.cs (1)
105LoadTestsFromAnExtension(kvp.Key, kvp.Value, settings, testCaseFilter, logger);
Discovery\DiscoveryManager.cs (1)
118verifiedExtensionSourceMap.Add(kvp.Key, kvp.Value);
EventHandlers\PathConverter.cs (2)
154discoveryCriteria.AdapterSourceMap[adapter.Key] = updatedPaths; 163testRunCriteriaWithSources.AdapterSourceMap[adapter.Key] = UpdatePaths(adapter.Value, updateDirection)!);
Execution\RunTestsWithSources.cs (3)
146verifiedExtensionSourceMap.Add(kvp.Key, kvp.Value); 159kvp.Key, 183var executorUriExtensionTuple = new Tuple<Uri, string>(executorUri, kvp.Key);
Microsoft.TestPlatform.Filter.Source (1)
FastFilter.cs (1)
91if (!TryGetPropertyValue(kvp.Key, propertyValueProvider, out var singleValue, out var multiValues))
Microsoft.TestPlatform.PlatformAbstractions (2)
common\System\ProcessHelper.cs (2)
111process.StartInfo.AddEnvironmentVariable(kvp.Key, kvp.Value); 120process.StartInfo.AddEnvironmentVariable(kvp.Key, kvp.Value);
Microsoft.TestPlatform.TestHostRuntimeProvider (4)
Hosting\DefaultTestHostManager.cs (1)
480var extensionsString = string.Join("\n", conflictingExtensions.Select(kv => $" {kv.Key} : {kv.Value}"));
Hosting\DotnetTestHostManager.cs (3)
771if (string.Equals(environmentVariable.Key, name, StringComparison.OrdinalIgnoreCase)) 946.Where(kvp => kvp.Key.StartsWith("DOTNET_", StringComparison.OrdinalIgnoreCase)) 947.Select(kvp => $"{kvp.Key}={kvp.Value}")
Microsoft.TestPlatform.VsTestConsole.TranslationLayer (2)
VsTestConsoleProcessManager.cs (2)
155if (envVariable.Key != null) 160info.EnvironmentVariables[envVariable.Key] = envVariable.Value?.ToString();
Microsoft.VisualStudio.TestPlatform.Client (4)
Discovery\DiscoveryRequest.cs (2)
296RequestData.MetricsCollection.Add(metric.Key, metric.Value); 424discoveryCompletePayload.Metrics[kvp.Key] = kvp.Value;
Execution\TestRunRequest.cs (2)
449_requestData.MetricsCollection.Add(metric.Key, metric.Value); 600testRunCompletePayload.TestRunCompleteArgs.Metrics[kvp.Key] = kvp.Value;
Microsoft.VisualStudio.TestPlatform.Common (32)
DataCollection\DataCollectionEnvironmentVariable.cs (3)
41ValidateArg.NotNullOrEmpty(variable.Key, nameof(variable.Key)); 55return _variable.Key;
DataCollection\DataCollectionManager.cs (6)
708if (dataCollectorEnvironmentVariables.TryGetValue(namevaluepair.Key, out var alreadyRequestedVariable)) 722namevaluepair.Key, 739_dataCollectionTelemetryManager.RecordEnvironmentVariableConflict(dataCollectionWrapper, namevaluepair.Key, namevaluepair.Value, alreadyRequestedVariable.Value); 744EqtTrace.Verbose("DataCollectionManager.AddCollectionEnvironmentVariables: Adding Environment variable '{0}' value '{1}'", namevaluepair.Key, namevaluepair.Value); 747namevaluepair.Key, 750_dataCollectionTelemetryManager.RecordEnvironmentVariableAddition(dataCollectionWrapper, namevaluepair.Key, namevaluepair.Value);
DataCollection\DataCollectionTelemetryManager.cs (2)
76dataCollectorInformation.TestExecutionEnvironmentVariables.Any(pair => pair.Key.StartsWith(ClrIeInstrumentationMethodConfigurationPrefix32Variable, StringComparison.Ordinal)) && 77dataCollectorInformation.TestExecutionEnvironmentVariables.Any(pair => pair.Key.StartsWith(ClrIeInstrumentationMethodConfigurationPrefix64Variable, StringComparison.Ordinal)))
ExtensionFramework\Utilities\TestExtensions.cs (11)
127.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); 139if (!result.ContainsKey(kvp.Key)) 141result.Add(kvp.Key, kvp.Value); 148result[kvp.Key] = MergeSets(result[kvp.Key], kvp.Value); 198if (existingExtensions.ContainsKey(extension.Key)) 202extension.Key); 206existingExtensions.Add(extension.Key, extension.Value); 433extension.Key); 440extensions.Add(extension.Key, extension.Value); 509jsonObject.Add(kvp.Key, jsonArray);
SettingsProvider\SettingsProviderExtensionManager.cs (1)
154EqtTrace.Error("SettingsProviderExtensionManager: LoadAndInitialize: Exception occurred while loading extension {0}: {1}", settingsProvider.Key, ex);
src\vstest\src\Microsoft.TestPlatform.Filter.Source\FastFilter.cs (3)
91if (!TryGetPropertyValue(kvp.Key, propertyValueProvider, out var singleValue, out var multiValues)) 292_filterDictionaryBuilder.ToImmutableDictionary(kvp => kvp.Key, kvp => (ISet<string>)_filterDictionaryBuilder[kvp.Key].ToImmutable()),
Utilities\SimpleJSON.cs (6)
134public string Current { get { return _enumerator.Current.Key; } } 881string key = _dict.ElementAt(aIndex).Key; 917_dict.Remove(item.Key); 926_dict.Remove(item.Key); 945node.Add(n.Key, n.Value.Clone()); 984aSB.Append('\"').Append(Escape(k.Key)).Append('\"');
Microsoft.VisualStudio.TestPlatform.ObjectModel (47)
Nuget.Frameworks\FrameworkNameProvider.cs (25)
126value = reverse.Where(p => StringComparer.OrdinalIgnoreCase.Equals(p.Key, key)).Select(s => s.Key).Single(); 298foreach (var optional in GetOptionalFrameworks(pair.Key)) 321profileNumber = pair.Key; 697if (!_shortNameRewrites.ContainsKey(mapping.Key)) 699_shortNameRewrites.Add(mapping.Key, mapping.Value); 711if (!_fullNameRewrites.ContainsKey(mapping.Key)) 713_fullNameRewrites.Add(mapping.Key, mapping.Value); 748subSets.Add(mapping.Key); 764var profile1 = profileMapping.Mapping.Key; 802remaining.Push(pair.Key); 852if (!_identifierSynonyms.ContainsKey(pair.Key)) 854_identifierSynonyms.Add(pair.Key, pair.Value); 867var longName = pair.Key; 871_identifierSynonyms.Add(pair.Value, pair.Key); 887_profilesToShortName.Add(profileMapping.Mapping.Value, profileMapping.Mapping.Key); 888_profileShortToLong.Add(profileMapping.Mapping.Key, profileMapping.Mapping.Value); 900if (!_portableFrameworks.TryGetValue(pair.Key, out HashSet<NuGetFramework>? frameworks)) 903_portableFrameworks.Add(pair.Key, frameworks); 921if (!_portableOptionalFrameworks.TryGetValue(pair.Key, out HashSet<NuGetFramework>? frameworks)) 924_portableOptionalFrameworks.Add(pair.Key, frameworks); 941if (!_portableCompatibilityMappings.TryGetValue(mapping.Key, out HashSet<FrameworkRange>? entries)) 944_portableCompatibilityMappings.Add(mapping.Key, entries); 1114string.Format(NumberFormatInfo.InvariantInfo, "Profile{0}", pair.Key)); 1126.SelectMany(p => p.Value.Select(subset => new { Superset = p.Key, Subset = subset }))
Nuget.Frameworks\FrameworkReducer.cs (5)
365.Select(pair => pair.Key); 402if (!scores.ContainsKey(pair.Key)) 404scores.Add(pair.Key, 1); 408scores[pair.Key]++; 416reduced = scores.GroupBy(pair => pair.Value).OrderByDescending(g => g.Key).First().Select(e => e.Key);
Nuget.Frameworks\HashCodeCombiner.cs (1)
175int keyHash = pair.Key.GetHashCode();
TestObject.cs (9)
48property.Key.Id, 49property.Key.Label, 50property.Key.Category, 51property.Key.Description, 52property.Key.GetValueType(), 54property.Key.Attributes, 59SetPropertyValue(property.Key, property.Value, CultureInfo.InvariantCulture); 82_store.TryRemove(kvp.Key, out _); 86_store.TryAdd(kvp.Key, value);
TestProperty\TestProperty.cs (6)
280result = propertyTypePair.Key; 323if (propertyTypePair.Key.ValueType == valueType.AssemblyQualifiedName 324|| propertyTypePair.Key.ValueType == valueType.FullName 325|| propertyTypePair.Key._valueType == valueType) 329result = propertyTypePair.Key; 339propertyTypePair.Key.ValueType);
Trait.cs (1)
27: this(data.Key, data.Value)
Mono.Cecil (11)
Mono.Cecil.Metadata\Buffers.cs (6)
370 var @string = entry.Key; 374 if (previous.EndsWith (@string, StringComparison.Ordinal) && !IsLowSurrogateChar (entry.Key [0])) { 376 string_offsets [index] = (uint) (position - (Encoding.UTF8.GetByteCount (entry.Key) + 1)); 382 previous = entry.Key; 412 var x = xPair.Key; 413 var y = yPair.Key;
Mono.Cecil\WindowsRuntimeProjections.cs (5)
439 foreach (var customAttribute in redirectedInterfacePair.Key.CustomAttributes) 442 redirectedInterfacePair.Key.CustomAttributes.Clear (); 446 if (TypeReferenceEqualityComparer.AreEqual (@override.DeclaringType, redirectedInterfacePair.Key.InterfaceType)) { 489 @override.DeclaringType = redirectedInterfacePair.Key.InterfaceType; 495 redirectedInterfacePair.Key.CustomAttributes.Add (customAttribute);
MSBuild (42)
OutOfProcTaskAppDomainWrapperBase.cs (2)
386PropertyInfo paramInfo = wrappedTask.GetType().GetProperty(param.Key, BindingFlags.Instance | BindingFlags.Public); 396[param.Key, param.Value.ToString(), taskName]);
OutOfProcTaskHostNode.cs (18)
553targetOutputsPerProject[i].Add(output.Key, output.Value); 1437if (_pendingCallbackRequests.TryRemove(kvp.Key, out TaskCompletionSource<INodePacket> tcs)) 1447if (contextKvp.Value.PendingCallbackRequests.TryRemove(reqKvp.Key, out TaskCompletionSource<INodePacket> ctxTcs)) 1664string oldValue = variable.Value.Key; 1671environment.TryGetValue(variable.Key, out environmentValue); 1689LogMessageFromResource(MessageImportance.Low, "ModifyingTaskHostEnvironmentVariable", variable.Key, newValue, environmentValue ?? String.Empty); 1692updatedEnvironment[variable.Key] = newValue; 1696updatedEnvironment.Remove(variable.Key); 1732string newValue = variable.Value.Key; 1738environment.TryGetValue(variable.Key, out environmentValue); 1746updatedEnvironment[variable.Key] = newValue; 1750updatedEnvironment.Remove(variable.Key); 1787if (!environment.TryGetValue(variable.Key, out newValue)) 1789s_mismatchedEnvironmentValues[variable.Key] = new KeyValuePair<string, string>(null, oldValue); 1795s_mismatchedEnvironmentValues[variable.Key] = new KeyValuePair<string, string>(newValue, oldValue); 1804if (!_savedEnvironment.TryGetValue(variable.Key, out oldValue)) 1806s_mismatchedEnvironmentValues[variable.Key] = new KeyValuePair<string, string>(newValue, null); 1812s_mismatchedEnvironmentValues[variable.Key] = new KeyValuePair<string, string>(newValue, oldValue);
src\msbuild\src\Shared\LogMessagePacketBase.cs (1)
300_sinkId = nodeBuildEvent.Value.Key;
src\msbuild\src\Shared\NodeEndpointOutOfProcBase.cs (6)
452$"Handshake failed. Received {result.Value} from host for {component.Key} but expected {component.Value}. Probably the host is a different MSBuild build."); 582if (component.Key == nameof(HandshakeComponents.Options)) 588else if (component.Key == nameof(HandshakeComponents.Salt)) 598isAllowedMismatch = _versionHandshakeGroup.Contains(component.Key) && component.Value == Handshake.NetTaskHostHandshakeVersion; 603CommunicationsUtilities.Trace($"Handshake for NET Host. Child host {handshakePart} for {component.Key}."); 608$"Handshake failed. Received {handshakePart} from host for {component.Key} but expected {component.Value}. Probably the host is a different MSBuild build.");
src\msbuild\src\Shared\TaskHostBuildResponse.cs (2)
70dict[entry.Key] = (ITaskItem[]?)entry.Value?.WrappedParameter ?? []; 101dict[entry.Key] = new TaskParameter(entry.Value);
src\msbuild\src\Shared\TaskHostConfiguration.cs (1)
237_taskParameters[parameter.Key] = new TaskParameter(parameter.Value);
src\msbuild\src\Shared\TaskHostTaskComplete.cs (1)
129_taskOutputParameters[parameter.Key] = new TaskParameter(parameter.Value);
src\msbuild\src\Shared\TaskParameter.cs (6)
800.Where(metadatum => string.IsNullOrEmpty(destinationItem.GetMetadata(metadatum.Key))); 816string value = destinationItem.GetMetadata(entry.Key); 820destinationItem.SetMetadata(entry.Key, entry.Value); 848clonedMetadata.Add(metadatum.Key, EscapingUtilities.UnescapeAll(metadatum.Value)); 946var unescaped = new KeyValuePair<string, string>(kvp.Key, EscapingUtilities.UnescapeAll(kvp.Value)); 955SetMetadata(kvp.Key, kvp.Value);
src\msbuild\src\Shared\TypeLoader.cs (1)
550if (typeName.Length == 0 || IsPartialTypeNameMatch(desiredTypeInAssembly.Key, typeName))
XMake.cs (4)
1937nodeResultKvp.Key.ProjectInstance.FullPath.Equals(entryPoint.ProjectFile) && 1938nodeResultKvp.Key.ProjectInstance.GlobalProperties.Count == entryPoint.GlobalProperties.Count && 1939nodeResultKvp.Key.ProjectInstance.GlobalProperties.All(propertyKvp => entryPoint.GlobalProperties.TryGetValue(propertyKvp.Key, out string entryValue) &&
NuGet.Build.Tasks (5)
GetGlobalPropertyValueTask.cs (1)
38var dictionaryWithOrdinal = globalProperties.ToDictionary(i => i.Key, i => i.Value, StringComparer.OrdinalIgnoreCase);
StaticGraphRestoreTaskBase.cs (4)
252yield return string.Join(";", options.Select(i => $"{i.Key}={i.Value}")); 271yield return string.Join(";", globalProperties.Select(i => $"{i.Key}={i.Value}")); 329newGlobalProperties[item.Key] = item.Value; 387writer.Write(option.Key);
NuGet.Build.Tasks.Console (2)
MSBuildStaticGraphRestore.cs (2)
758var targetAlias = string.IsNullOrEmpty(projectInnerNode.Key) ? string.Empty : projectInnerNode.Key;
NuGet.Build.Tasks.Pack (5)
PackTaskLogic.cs (5)
397foreach (var key in frameworkToAliases.Where(e => e.Value.Count <= 1).Select(e => e.Key).ToList()) 427t.Key, t.Value.Select( 477NuGetFramework.Parse(e.Key), 887string.Join(", ", duplicates.Value) + " => " + duplicates.Key, 900PackCommandRunner.AddDependencyGroups(pair.Value, pair.Key, packageBuilder);
NuGet.CommandLine.XPlat (6)
Commands\ConfigCommands\ConfigRunners.cs (1)
250setting += $" {attribute.Key}=\"{attribute.Value}\"";
Commands\Package\Update\PackageUpdateCommandRunner.cs (1)
729var package = new PackageWithVersionRange { Id = kvp.Key, VersionRange = kvp.Value.version };
Commands\PackageReferenceCommands\ListPackage\ListPackageCommandRunner.cs (1)
439packageMetadata => packageMetadataById[packageMetadata.Key] = packageMetadata.Value,
src\nuget-client\build\Shared\HashCodeCombiner.cs (1)
175int keyHash = pair.Key.GetHashCode();
Utility\MSBuildAPIUtility.cs (2)
942e => e.Key.Equals(CollectPackageReferences, StringComparison.OrdinalIgnoreCase) 947e => e.Key.Equals(CollectCentralPackageVersions, StringComparison.OrdinalIgnoreCase)
NuGet.Commands (45)
CommandRunners\PackCommandRunner.cs (3)
515if (factory.GetProjectProperties().ContainsKey(property.Key)) 518string.Format(CultureInfo.CurrentCulture, Strings.Warning_DuplicatePropertyKey, property.Key), 521factory.GetProjectProperties()[property.Key] = property.Value;
PackCommand\Logging\PackageSpecificWarningProperties.cs (1)
41string packageId = packageNoWarnProperty.Key;
RestoreCommand\CompatibilityChecker.cs (1)
216compile.Key,
RestoreCommand\DependencyGraphResolver.cs (3)
274await _logger.LogAsync(RestoreLogMessage.CreateWarning(NuGetLogCode.NU1502, string.Format(CultureInfo.CurrentCulture, Strings.Log_UnknownCompatibilityProfile, profile.Key))); 653if (nodesById.TryGetValue(versionConflict.Key, out GraphNode<RemoteResolveResult>? selected)) 1107evicteesToRemove.Add(evictee.Key);
RestoreCommand\Diagnostics\UnresolvedMessages.cs (4)
122sourceInfo.Select(e => e.Key.Name) 240sourceInfo.Key.Name, 247sourceInfo.Key.Name); 274.ThenBy(e => e.Key.Source, StringComparer.OrdinalIgnoreCase)
RestoreCommand\Logging\TransitiveNoWarnUtils.cs (12)
402var id = pair.Key; 445var code = codePair.Key; 450var libraryId = libraryPair.Key; 462var code = codePair.Key; 467var libraryId = libraryPair.Key; 547var code = codePair.Key; 552var libraryId = libraryPair.Key; 595var code = codePair.Key; 600var libraryId = libraryPair.Key; 785if (otherPackages.TryGetValue(pair.Key, out var otherCodes)) 790packages.Add(pair.Key, intersect); 845if (!package.TryGetValue(pair.Key, out var codes))
RestoreCommand\RestoreCommand.cs (5)
1213string.Format(CultureInfo.CurrentCulture, Strings.Error_RestorePruningDirectPackageReference, prunedPackage.Key), 1214prunedPackage.Key, 1250if (dependency.Name.Equals(prunedPackage.Key, StringComparison.OrdinalIgnoreCase)) 2142var message = string.Format(CultureInfo.CurrentCulture, Strings.Log_UnknownCompatibilityProfile, profile.Key); 2306var message = string.Format(CultureInfo.CurrentCulture, Strings.Log_UnknownCompatibilityProfile, profile.Key);
RestoreCommand\RestoreSummary.cs (1)
182pair.Key));
RestoreCommand\RestoreTargetGraph.cs (1)
196conflicts.Select(p => new ResolverConflict(p.Key, p.Value)),
RestoreCommand\Utility\AuditUtility.cs (3)
273foreach ((PackageIdentity package, PackageAuditInfo auditInfo) in packagesWithKnownVulnerabilities.OrderBy(p => p.Key.Id)) 277foreach (var kvp2 in auditInfo.GraphsPerVulnerability.OrderBy(v => v.Key.Url.OriginalString)) 279PackageVulnerabilityInfo vulnerability = kvp2.Key;
RestoreCommand\Utility\BuildAssetsUtils.cs (5)
632var lockContentFiles = new List<LockFileContentFile>(pkg.Key.ContentFiles.Count); 633foreach (var contentFile in pkg.Key.ContentFiles.NoAllocEnumerate()) 646var tuple = ValueTuple.Create(item1: pkg.Key, item2: e, item3: GetPathWithMacros(pkg.Value.GetAbsolutePath(e), repositoryRoot, request.EnvironmentVariableReader)); 699foreach (LockFileItem lockFileItem in pkg.Key.Build.WithExtension(extension)) 722foreach (var e in pkg.Key.BuildMultiTargeting.WithExtension(extension))
RestoreCommand\Utility\LockFileUtils.cs (1)
1001emptyItem.Properties.Add(pair.Key, pair.Value);
RestoreCommand\Utility\MSBuildRestoreUtility.cs (2)
663TargetFrameworkInformation targetFrameworkInformation = spec.TargetFrameworks.Single(e => e.TargetAlias.Equals(frameworkPair.Key, StringComparison.Ordinal)); 839if (isPruningEnabled[frameworkInfo.Key])
RestoreCommand\Utility\PackageSpecFactory.cs (2)
228var targetAlias = string.IsNullOrEmpty(projectInnerNode.Key) ? string.Empty : projectInnerNode.Key;
src\nuget-client\build\Shared\HashCodeCombiner.cs (1)
175int keyHash = pair.Key.GetHashCode();
NuGet.Configuration (32)
PackageSourceMapping\SearchTree.cs (1)
27Add(patternsPerSource.Key, namespaceId);
Settings\Items\AddItem.cs (4)
26!string.Equals(a.Key, ConfigurationConstants.KeyAttribute, StringComparison.OrdinalIgnoreCase) && 27!string.Equals(a.Key, ConfigurationConstants.ValueAttribute, StringComparison.OrdinalIgnoreCase) 28).ToDictionary(a => a.Key, a => a.Value)); 64AddAttribute(attribute.Key, attribute.Value);
Settings\Items\AuthorItem.cs (1)
56element.SetAttributeValue(attr.Key, attr.Value);
Settings\Items\CredentialsItem.cs (2)
209newSetting.AddAttribute(attr.Key, attr.Value); 234element.SetAttributeValue(attr.Key, attr.Value);
Settings\Items\FileClientCertItem.cs (1)
150element.SetAttributeValue(attr.Key, attr.Value);
Settings\Items\OwnersItem.cs (1)
80element.SetAttributeValue(attr.Key, attr.Value);
Settings\Items\PackageSourceMappingSourceItem.cs (1)
141element.SetAttributeValue(attr.Key, attr.Value);
Settings\Items\RepositoryItem.cs (1)
125element.SetAttributeValue(attr.Key, attr.Value);
Settings\Items\StoreClientCertItem.cs (1)
226element.SetAttributeValue(attr.Key, attr.Value);
Settings\Items\UnknownItem.cs (2)
158element.SetAttributeValue(attr.Key, attr.Value); 222AddOrUpdateAttribute(attribute.Key, attribute.Value);
Settings\NuGetConfiguration.cs (2)
159sectionsContainer.Add(section.Key, new VirtualSettingSection(section.Value)); 183return Sections.OrderedEquals(nugetConfiguration.Sections, s => s.Key, StringComparer.Ordinal);
Settings\SettingElement.cs (6)
83if (IsAttributeValid(attribute.Key, attribute.Value)) 85MutableAttributes.Add(attribute.Key, attribute.Value); 89throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, Resources.Error_InvalidAttribute, attribute.Key, attribute.Value)); 124element.SetAttributeValue(attr.Key, attr.Value); 274var attribute = element.Attribute(attributeValues.Key); 288var attribute = element.Attribute(attributeValues.Key);
Settings\SettingItem.cs (7)
65var otherAttributes = setting.Attributes.ToDictionary(a => a.Key, a => a.Value); 69if (otherAttributes.TryGetValue(attribute.Key, out var otherValue)) 71otherAttributes.Remove(attribute.Key); 85xElement.SetAttributeValue(attribute.Key, value); 89AddOrUpdateAttribute(attribute.Key, value); 97xElement.SetAttributeValue(attribute.Key, attribute.Value); 101AddOrUpdateAttribute(attribute.Key, attribute.Value);
Settings\SettingsGroup.cs (1)
66element.SetAttributeValue(attr.Key, attr.Value);
src\nuget-client\build\Shared\HashCodeCombiner.cs (1)
175int keyHash = pair.Key.GetHashCode();
NuGet.Credentials (1)
CredentialService.cs (1)
180&& entry.Key.EndsWith(ending, StringComparison.Ordinal))
NuGet.DependencyResolver.Core (2)
GraphModel\GraphOperations.cs (1)
91DowngradedFrom = p.Key,
src\nuget-client\build\Shared\HashCodeCombiner.cs (1)
175int keyHash = pair.Key.GetHashCode();
NuGet.Frameworks (31)
FrameworkNameProvider.cs (25)
129if (StringComparer.OrdinalIgnoreCase.Equals(item.Key, key)) 131value = item.Key; 305foreach (var optional in GetOptionalFrameworks(pair.Key)) 328profileNumber = pair.Key; 709if (!_shortNameRewrites.ContainsKey(mapping.Key)) 711_shortNameRewrites.Add(mapping.Key, mapping.Value); 723if (!_fullNameRewrites.ContainsKey(mapping.Key)) 725_fullNameRewrites.Add(mapping.Key, mapping.Value); 760subSets.Add(mapping.Key); 776var profile1 = profileMapping.Mapping.Key; 814remaining.Push(pair.Key); 864if (!_identifierSynonyms.ContainsKey(pair.Key)) 866_identifierSynonyms.Add(pair.Key, pair.Value); 879var longName = pair.Key; 883_identifierSynonyms.Add(pair.Value, pair.Key); 899_profilesToShortName.Add(profileMapping.Mapping.Value, profileMapping.Mapping.Key); 900_profileShortToLong.Add(profileMapping.Mapping.Key, profileMapping.Mapping.Value); 912if (!_portableFrameworks.TryGetValue(pair.Key, out HashSet<NuGetFramework>? frameworks)) 915_portableFrameworks.Add(pair.Key, frameworks); 933if (!_portableOptionalFrameworks.TryGetValue(pair.Key, out HashSet<NuGetFramework>? frameworks)) 936_portableOptionalFrameworks.Add(pair.Key, frameworks); 953if (!_portableCompatibilityMappings.TryGetValue(mapping.Key, out HashSet<FrameworkRange>? entries)) 956_portableCompatibilityMappings.Add(mapping.Key, entries); 1126string.Format(NumberFormatInfo.InvariantInfo, "Profile{0}", pair.Key)); 1138.SelectMany(p => p.Value.Select(subset => new { Superset = p.Key, Subset = subset }))
FrameworkReducer.cs (5)
365.Select(pair => pair.Key); 402if (!scores.ContainsKey(pair.Key)) 404scores.Add(pair.Key, 1); 408scores[pair.Key]++; 416reduced = scores.GroupBy(pair => pair.Value).OrderByDescending(g => g.Key).First().Select(e => e.Key);
src\nuget-client\build\Shared\HashCodeCombiner.cs (1)
175int keyHash = pair.Key.GetHashCode();
NuGet.LibraryModel (1)
src\nuget-client\build\Shared\HashCodeCombiner.cs (1)
175int keyHash = pair.Key.GetHashCode();
NuGet.PackageManagement (9)
Audit\AuditChecker.cs (1)
251foreach ((PackageIdentity package, PackageAuditInfo auditInfo) in packagesWithKnownVulnerabilities.OrderBy(p => p.Key.Id))
IDE\PackageRestoreManager.cs (1)
263return new PackageRestoreData(p.Key, p.Value, isMissing: true);
NuGetPackageManager.cs (2)
2085source = pair.Key; 2100pair.Key.PackageSource.Source,
src\nuget-client\build\Shared\HashCodeCombiner.cs (1)
175int keyHash = pair.Key.GetHashCode();
Utility\PackagesConfigLockFileUtility.cs (4)
129bool allContentHashesMatch = comparisonResult.MatchedDependencies.All(pair => pair.Key.ContentHash == pair.Value.ContentHash); 137foreach (var difference in comparisonResult.MatchedDependencies.Where(kvp => kvp.Key.ContentHash != kvp.Value.ContentHash)) 139var message = string.Format(CultureInfo.CurrentCulture, Strings.Error_PackageValidationFailed, difference.Key.Id + "." + difference.Key.ResolvedVersion);
NuGet.Packaging (45)
ContentModel\ContentItemCollection.cs (9)
169if (itemGroup.Properties.ContainsKey(criteriaProperty.Key)) 178if (!itemGroup.Properties.TryGetValue(criteriaProperty.Key, out itemProperty)) 184if (!definition.PropertyDefinitions.TryGetValue(criteriaProperty.Key, out propertyDefinition)) 213var bestGroupValue = bestGroup.Properties[criteriaProperty.Key]; 214var itemGroupValue = itemGroup.Properties[criteriaProperty.Key]; 215var propertyDefinition = definition.PropertyDefinitions[criteriaProperty.Key]; 384hashCode ^= property.Key.GetHashCode(StringComparison.Ordinal); 462if (!y._properties.TryGetValue(xProperty.Key, out yValue)) 474if (!x._properties.TryGetValue(yProperty.Key, out xValue))
ContentModel\ContentQueryDefinition.cs (1)
109Defaults = defaults.ToDictionary(p => p.Key, p => p.Value);
ContentModel\Infrastructure\Parser.cs (2)
21_defaults = pattern.Defaults.ToDictionary(p => p.Key, p => p.Value); 100item.Add(pair.Key, pair.Value);
Core\NuspecCoreReaderBase.cs (2)
168if (!metadataValues.ContainsKey(pair.Key)) 170metadataValues.Add(pair.Key, pair.Value);
NuspecReader.cs (1)
258foreach ((var framework, var items) in groups.OrderBy(e => e.Key, NuGetFrameworkSorter.Instance))
PackageReaderBase.cs (1)
446foreach ((var framework, var items) in groups.OrderBy(e => e.Key, NuGetFrameworkSorter.Instance))
Rules\ReferencesInNuspecMatchRefAssetsRule.cs (3)
64var subfolder = nuspecReferences.Where(t => missingSubfolderInFiles.Contains(t.Key)); 67missingReferences.Add(new MissingReference("ref", item.Key, item.Value.ToArray())); 119missingReferences.Add(new MissingReference("ref", item.Key, refs));
RuntimeModel\JsonRuntimeFormat.cs (8)
111.OrderBy(pair => pair.Key, StringComparer.Ordinal) 127.OrderBy(pair => pair.Key, StringComparer.Ordinal) 169var name = json.Key; 181var framework = NuGetFramework.Parse(property.Key); 199var name = json.Key; 204if (property.Key == "#import") 226json.Key, 232return new RuntimePackageDependency(json.Key, VersionRange.Parse(json.Value.Value<string>()!));
RuntimeModel\RuntimeDependencySet.cs (1)
57&& Dependencies.OrderedEquals(other.Dependencies, p => p.Key, StringComparer.OrdinalIgnoreCase);
RuntimeModel\RuntimeDescription.cs (1)
71&& RuntimeDependencySets.OrderedEquals(other.RuntimeDependencySets, p => p.Key, StringComparer.OrdinalIgnoreCase);
RuntimeModel\RuntimeGraph.cs (10)
102clone[pair.Key] = cloneFunc(pair.Value); 129runtimes[pair.Key] = pair.Value; 136if (runtimes.TryGetValue(pair.Key, out RuntimeDescription? leftRuntime)) 139runtimes[pair.Key] = RuntimeDescription.Merge(leftRuntime, pair.Value); 143runtimes[pair.Key] = pair.Value; 152supports[compatProfile.Key] = compatProfile.Value; 160supports[compatProfile.Key] = compatProfile.Value; 263Runtimes.SelectMany(e => e.Value.RuntimeDependencySets.Select(f => f.Key)), 311return Runtimes.OrderedEquals(other.Runtimes, pair => pair.Key, StringComparer.Ordinal) 312&& Supports.OrderedEquals(other.Supports, pair => pair.Key, StringComparer.Ordinal);
Signing\Content\KeyPairFileReader.cs (2)
54if (entries.ContainsKey(property.Key)) 60entries.Add(property.Key, property.Value);
Signing\Content\SignatureContent.cs (2)
151if (property.Key.EndsWith("-Hash", StringComparison.Ordinal)) 155if (property.Key == $"{hashAlgorithmOid}-Hash")
Signing\Verification\SignatureTrustAndValidityVerificationProvider.cs (1)
268if (string.Equals(allowUntrustedRoot.Key, signingCertificateFingerprint, StringComparison.Ordinal))
src\nuget-client\build\Shared\HashCodeCombiner.cs (1)
175int keyHash = pair.Key.GetHashCode();
NuGet.ProjectModel (11)
JsonUtility.cs (1)
117items.Add(readItem(child.Key, child.Value));
LockFile\LockFileFormat.cs (2)
520foreach (var property in item.Properties.OrderBy(x => x.Key, StringComparer.Ordinal)) 522writer.WritePropertyName(property.Key);
LockFile\LockFileItem.cs (1)
68return _properties.OrderedEquals(other._properties, pair => pair.Key, StringComparer.Ordinal);
PackageSpecOperations.cs (2)
180if (!string.Equals(kvp.Key, dependency.Id, StringComparison.OrdinalIgnoreCase)) 182result.Add(kvp.Key, kvp.Value);
PackageSpecReferenceDependencyProvider.cs (1)
379.Where(item => !dependencyNamesSet.Contains(item.Key))
PackageSpecWriter.cs (2)
612foreach (var dependency in packagesToPrune.OrderBy(dep => dep.Key, StringComparer.OrdinalIgnoreCase)) 614writer.WriteNameValue(name: dependency.Key, value: dependency.Value.VersionRange.OriginalString ?? dependency.Value.VersionRange.ToNormalizedString());
ProjectLockFile\PackagesLockFileUtilities.cs (1)
123var projectRuntimesKeys = project.RuntimeGraph.Runtimes.Select(r => r.Key).Where(k => k != null);
src\nuget-client\build\Shared\HashCodeCombiner.cs (1)
175int keyHash = pair.Key.GetHashCode();
NuGet.Protocol (14)
Converters\FingerprintsConverter.cs (1)
25dict[fingerprint.Key] = fingerprint.Value?.ToString() ?? string.Empty;
Converters\FingerprintsStjConverter.cs (1)
39writer.WriteString(kvp.Key, kvp.Value);
DependencyInfo\Trim.cs (1)
50if (registrationInfo.Id == allowedVersion.Key)
HttpSource\HttpRequestMessageExtensions.cs (3)
37clone.Headers.TryAddWithoutValidation(header.Key, header.Value); 44clonedOptions.Add(option.Key, option.Value); 66Headers.TryAddWithoutValidation(header.Key, header.Value);
HttpSource\HttpRetryHandler.cs (2)
136requestMessage.Headers.TryAddWithoutValidation(header.Key, header.Value); 190newContent.Headers.TryAddWithoutValidation(header.Key, header.Value);
LegacyFeed\MetadataResourceV2Feed.cs (2)
54results.Add(new KeyValuePair<string, NuGetVersion?>(pair.Key, null)); 61results.Add(new KeyValuePair<string, NuGetVersion?>(pair.Key, latestVersion));
LegacyFeed\V2FeedPackageInfo.cs (1)
314return results.Select(pair => new PackageDependencyGroup(pair.Key, pair.Value)).ToList();
LocalRepositories\LocalMetadataResource.cs (2)
59results.Add(new KeyValuePair<string, NuGetVersion?>(pair.Key, null)); 66results.Add(new KeyValuePair<string, NuGetVersion?>(pair.Key, latestVersion));
src\nuget-client\build\Shared\HashCodeCombiner.cs (1)
175int keyHash = pair.Key.GetHashCode();
NuGet.Resolver (2)
PackageResolver.cs (1)
293dependencyByPackageId.Add(item.Key, VersionRange.Combine(item.Value));
src\nuget-client\build\Shared\HashCodeCombiner.cs (1)
175int keyHash = pair.Key.GetHashCode();
NuGet.Versioning (1)
src\nuget-client\build\Shared\HashCodeCombiner.cs (1)
175int keyHash = pair.Key.GetHashCode();
PresentationBuildTasks (1)
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\XmlCompatibilityReader.cs (1)
136keysToUpdate.Add(pair.Key);
PresentationCore (19)
MS\Internal\FontCache\FontFaceLayoutInfo.cs (1)
711return ContainsKey(item.Key);
MS\Internal\FontFace\PhysicalFontFamily.cs (1)
47XmlLanguage language = XmlLanguage.GetLanguage(pair.Key.Name);
System\Windows\Media\CharacterMetricsDictionary.cs (9)
86item.Key, 107return item.Value != null && item.Value.Equals(GetValue(item.Key)); 158return item.Value != null && RemoveValue(item.Key, item.Value); 189typedArray[index++] = new SC.DictionaryEntry(item.Key, item.Value); 205array.SetValue(new SC.DictionaryEntry(item.Key, item.Value), index++); 465result[i++] = pair.Key; 558return new SC.DictionaryEntry(entry.Key, entry.Value); 584return new SC.DictionaryEntry(entry.Key, entry.Value); 592return GetCurrentEntry().Key;
System\Windows\Media\CultureSpecificStringDictionary.cs (6)
82Add(item.Key, item.Value); 158typedArray[index++] = new SC.DictionaryEntry(item.Key, item.Value); 174array.SetValue(new SC.DictionaryEntry(item.Key, item.Value), index++); 392if (entry.Key == null) 403return new SC.DictionaryEntry(entry.Key, entry.Value); 411return GetCurrentEntry().Key;
System\Windows\Media\GlyphTypeface.cs (2)
390adjustedLanguageFaceNames[XmlLanguage.GetLanguage(pair.Key.IetfLanguageTag)] = pair.Value; 1804return ContainsKey(item.Key);
PresentationFramework (47)
MS\Internal\Annotations\Storage\StoreAnnotationsMap.cs (1)
172annotations.Add(annotKV.Key, annotKV.Value.Annotation);
MS\Internal\Data\AccessorTable.cs (1)
115_table.Remove(entry.Key);
MS\Internal\Data\CollectionViewGroupInternal.cs (2)
544_nameToGroupMap.Remove(item.Key); 590_nameToGroupMap.Remove(item.Key);
MS\Internal\Globalization\BamlTreeMap.cs (1)
493return pair.Key;
MS\Internal\Globalization\BamlTreeUpdater.cs (3)
48if (!ApplyChangeToBamlTree(item.Key, item.Value, updateMap)) 62ApplyChangeToBamlTree(entry.Key, entry.Value, updateMap); 71BamlLocalizableResourceKey key = item.Key;
MS\Internal\Helper.cs (6)
758if (itemValues[i].Key == dpIndex) 786if (itemValues[j].Key == dpIndex) 811if (itemValues[i].Key == dpIndex) 889if (itemValues[i].Key == dpIndex) 1033if (itemValue.Key == ItemValueStorageField.GlobalIndex) 1040if (itemValue.Key == dpIndices[j])
MS\Internal\Ink\ClipboardProcessor.cs (2)
187InkCanvasClipboardFormat format = pair.Key; 256yield return pair.Key;
MS\Internal\WeakDictionary.cs (4)
267this.Add(item.Key, item.Value); 277if (!_hashTable.ContainsKey(item.Key)) 282if (object.Equals(_hashTable[item.Key], item.Value)) 323return this.Remove(item.Key);
System\Windows\Annotations\LocatorPart.cs (3)
108if (!part._nameValues.TryGetValue(k_v.Key, out otherValue)) 142newPart.NameValuePairs.Add(k_v.Key, k_v.Value); 405res += $"@{AnnotationXmlConstants.Attributes.ItemName}=\"{k_v.Key}\" and @{AnnotationXmlConstants.Attributes.ItemValue}=\"{k_v.Value}\"]";
System\Windows\Annotations\LocatorPartList.cs (1)
171writer.WriteAttributeString(AnnotationXmlConstants.Attributes.ItemName, pair.Key);
System\Windows\Annotations\Storage\XmlStreamStore.cs (1)
853reader.DeclareNamespaceCompatibility(item.Key.ToString(), name.ToString());
System\Windows\Automation\Peers\ItemsControlAutomationPeer.cs (8)
583if (Object.Equals(item, pair.Key)) 643if (Object.Equals(item, pair.Key)) 672cleanUpItemsCollection.Add(dictionaryEntry.Key); 678cleanUpItemsCollection.Add(dictionaryEntry.Key); 683cleanUpItemsCollection.Add(dictionaryEntry.Key); 696cleanUpItemsCollection.Add(keyValuePair.Key); 702cleanUpItemsCollection.Add(keyValuePair.Key); 707cleanUpItemsCollection.Add(keyValuePair.Key);
System\Windows\Diagnostics\ResourceDictionaryDiagnostics.cs (2)
509if (kvp.Key.Item == null || !kvp.Value.TryGetTarget(out dict)) 515toRemove.Add(kvp.Key);
System\Windows\Documents\DocumentSequence.cs (1)
900notificationList.Add(ienum.Current.Key);
System\Windows\Documents\FixedDocument.cs (1)
1223completedRequests.Add(ienum.Current.Key);
System\Windows\Documents\WinRTSpellerInterop.cs (1)
519string ietfLanguageTag = items.Key;
System\Windows\Markup\Baml2006\Baml2006ReaderFrame.cs (1)
72prefix = pair.Key;
System\Windows\Markup\Localizer\BamlLocalizationDictionary.cs (2)
310DictionaryEntry entry = new(pair.Key, pair.Value); 392newDictionary.Add(pair.Key, resourceCopy);
System\Windows\Markup\Primitives\MarkupWriter.cs (1)
1429yield return new Mapping(mapping.Key, mapping.Value);
System\Windows\Markup\XamlTypeMapper.cs (1)
313newDict.Add(kvp.Key, kvp.Value);
System\Windows\Shell\WindowChromeWorker.cs (1)
342if (handlePair.Key == message)
System\Windows\VisualStateManager.cs (3)
383currentAnimations.Remove(pair.Key); 384newStateAnimations.Remove(pair.Key); 403currentAnimations.Remove(pair.Key);
ReachFramework (2)
MS\Internal\Printing\MostFrequentlyUsedCache.cs (1)
68minUseCountKey = pair.Key;
PrintConfig\PrintSchemaShim.cs (1)
1163setter(pair.Key);
RepoTasks (3)
BatchHelixWorkItems.cs (3)
95foreach (var group in eligibleGroups.OrderBy(pair => pair.Key, StringComparer.OrdinalIgnoreCase)) 149var batchedWorkItem = new TaskItem($"batch_{batchNumber}--{group.Key}"); 197batchedWorkItem.SetMetadata("TargetFrameworkMoniker", group.Key);
Roslyn.Diagnostics.Analyzers (57)
src\b310f676f7308b7f\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (1)
241foreach (var (symbol, write) in SymbolsWriteBuilder.SelectAsArray(kvp => !kvp.Value, kvp => kvp.Key))
src\roslyn\src\Compilers\Core\Portable\Collections\SmallDictionary.cs (1)
57this.Add(kv.Key, kv.Value);
src\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (1)
740var oldPrefix = kv.Key;
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\ConcurrentSet.cs (2)
125public T Current => _kvpEnumerator.Current.Key; 157yield return kvp.Key;
src\roslyn\src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (2)
833result.Add(entry.Key, createMembers(entry.Value)); 878dictionary.Add(entry.Key, namedTypes);
src\roslyn\src\Dependencies\Collections\Extensions\KeyValuePairExtensions.cs (1)
17key = keyValuePair.Key;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (2)
185return TryGetValue(pair.Key, out var value) 240result[item.Key] = item.Value;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Enumerator.cs (2)
49readonly DictionaryEntry IDictionaryEnumerator.Entry => new(Current.Key, Current.Value); 51readonly object IDictionaryEnumerator.Key => Current.Key;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+KeyCollection+Enumerator.cs (1)
25public readonly TKey Current => _enumerator.Current.Key;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueBuilder.cs (6)
119=> Add(item.Key, item.Value); 127Add(pair.Key, pair.Value); 148return TryGetValue(item.Key, out var value) 192GetOrCreateMutableDictionary().Remove(item.Key); 213if (KeyComparer.Equals(pair.Key, equalKey)) 215actualKey = pair.Key;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (10)
210Add(pair.Key, pair.Value); 218Add(pair.Key, pair.Value); 271=> Add(keyValuePair.Key, keyValuePair.Value); 275ref var value = ref FindValue(keyValuePair.Key); 286ref var value = ref FindValue(keyValuePair.Key); 289Remove(keyValuePair.Key); 1234return new DictionaryEntry(_current.Key, _current.Value); 1237return new KeyValuePair<TKey, TValue>(_current.Key, _current.Value); 1261return new DictionaryEntry(_current.Key, _current.Value); 1274return _current.Key;
src\roslyn\src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
650dictionary.Add(pair.Key, pair.Value.ToImmutableAndFree());
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\SymbolNamesWithValueOption.cs (7)
139wildcardNamesBuilder.ToImmutableDictionaryAndFree(x => x.Key, x => x.Value.ToImmutableDictionaryAndFree(), wildcardNamesBuilder.Comparer)); 311names.FirstOrDefault(kvp => symbolDeclarationId.StartsWith(kvp.Key, StringComparison.Ordinal)) is var prefixedFirstMatchOrDefault && 312!string.IsNullOrWhiteSpace(prefixedFirstMatchOrDefault.Key)) 321value.FirstOrDefault(kvp => symbolDeclarationId.StartsWith(kvp.Key, StringComparison.Ordinal)) is var unprefixedFirstMatchOrDefault && 322!string.IsNullOrWhiteSpace(unprefixedFirstMatchOrDefault.Key)) 331allKindsValue.FirstOrDefault(kvp => symbol.Name.StartsWith(kvp.Key, StringComparison.Ordinal)) is var partialFirstMatchOrDefault && 332!string.IsNullOrWhiteSpace(partialFirstMatchOrDefault.Key))
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledConcurrentDictionary.cs (1)
81var added = instance.TryAdd(kvp.Key, kvp.Value);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledConcurrentSet.cs (2)
122yield return kvp.Key; 152public T Current => _kvpEnumerator.Current.Key;
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledDictionary.cs (1)
81instance.Add(kvp.Key, kvp.Value);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (2)
77foreach (var kvp in ruleset.SpecificDiagnosticOptions.OrderBy(kvp => kvp.Key)) 79var id = kvp.Key;
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\SmallDictionary.cs (1)
59this.Add(kv.Key, kv.Value);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageResult.cs (4)
48=> SymbolWritesMap.SelectAsArray(kvp => !kvp.Value, kvp => kvp.Key); 59if (kvp.Key.write == null && Equals(kvp.Key.symbol, parameter)) 76if (Equals(kvp.Key.symbol, symbol))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser.cs (2)
97where kvp.Key.Trim().StartsWith("dotnet_naming_rule.", StringComparison.Ordinal) 98let nameSplit = kvp.Key.Split('.')
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BidirectionalMap.cs (1)
25backwardMap: ImmutableDictionary.CreateRange(valueComparer, pairs.Select(static p => KeyValuePair.Create(p.Value, p.Key))))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IDictionaryExtensions.cs (2)
253if (predicate(entry.Key, entry.Value, arg)) 255keysToRemove.Add(entry.Key);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\INamedTypeSymbolExtensions.cs (3)
612comparer.Equals(member.Name, kvp.Key.Name) && 613SignatureComparer.Instance.HaveSameSignature(member, kvp.Key, caseSensitive)); 617result.Remove(match.Key);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (1)
246predicate: kvp => safeImportsToAdd.Contains(kvp.Key),
Roslyn.Diagnostics.CSharp.Analyzers (10)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\MemberDeclarationSyntaxExtensions.cs (1)
23return dictionary.ToDictionary(kvp => kvp.Key, kvp => kvp.Value.AsImmutable());
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaRewriter.cs (7)
56if (pair.Key.Item1.RawKind != 0) 58_trailingTriviaMap.Add(pair.Key.Item1, trailingTrivia); 61if (pair.Key.Item2.RawKind != 0) 63_leadingTriviaMap.Add(pair.Key.Item2, leadingTrivia); 73if (pair.Key.Item1.RawKind == 0) 75return (default(SyntaxTriviaList), GetLeadingTriviaAtBeginningOfTree(pair.Key, pair.Value, cancellationToken)); 89var text = pair.Value.GetTextChanges(GetTextSpan(pair.Key)).Single().NewText ?? "";
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\AttributeGenerator.cs (1)
92NameEquals(IdentifierName(argument.Key)),
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ExpressionGenerator.cs (1)
291if (constant.Key.Equals(value))
rzc (1)
ConcurrentLruCache.cs (1)
51UnsafeAdd(kvp.Key, kvp.Value);
ScenarioTests.Common.Tests (1)
ScenarioTestTypes.cs (1)
231workItem.Key(workItem.Value);
sdk-tasks (10)
_generated\1\SdkTasksJsonSerializerContext.DictionaryStringMetadataEntry.g.cs (1)
59writer.WritePropertyName(entry.Key);
CalculateTemplateVersions.cs (3)
77var brandName = System.Version.Parse(g.Key).Major >= 5 ? 78$"Microsoft .NET {g.Key} Templates" : 79$"Microsoft .NET Core {g.Key} Templates";
GetRuntimePackRids.cs (1)
23string [] runtimeIdentifiers = runtimeJsonRoot["runtimes"]!.AsObject().Select(p => p.Key).ToArray();
PublishMutationUtilities.cs (5)
24if (targetLibrary.Key == null) 28version = targetLibrary.Key.Substring(targetLibrary.Key.IndexOf('/') + 1); 30targetObj.Remove(targetLibrary.Key); 41librariesObj.Remove(library.Key);
SelectTests (8)
Program.cs (7)
825.ThenBy(g => g.Key, StringComparer.Ordinal) 834$"⚠️ {top.Value.Count} of the {tests.Count} selected test projects come from a single change — {CauseGroupDescriptor(top.Key)}."); 846var direct = members.Where(m => m.Value.Kind is CauseKind.Convention or CauseKind.PathRule).Select(m => m.Key).OrderBy(p => p, StringComparer.Ordinal).ToList(); 847var graph = members.Where(m => m.Value.Kind is CauseKind.Layer1Graph).OrderBy(m => m.Key, StringComparer.Ordinal).ToList(); 848var other = members.Where(m => m.Value.Kind is not (CauseKind.Convention or CauseKind.PathRule or CauseKind.Layer1Graph)).Select(m => m.Key).OrderBy(p => p, StringComparer.Ordinal).ToList(); 909return $"`{member.Key}` ({hops} hops)"; 913return $"`{member.Key}`";
TestSelector.cs (1)
331causes.ToDictionary(kv => kv.Key, kv => (IReadOnlyList<Cause>)kv.Value, StringComparer.Ordinal);
Shared (1)
LogBuffering\SerializedLogRecordFactory.cs (1)
32string key = attributes[i].Key;
Shared.Tests (6)
Generated\361d1da7f942c932\TestTypesContext.DictionaryStringInt32.g.cs (1)
59writer.WriteNumber(entry.Key, entry.Value);
Generated\361d1da7f942c932\TestTypesContext.DictionaryStringSimplePoco.g.cs (1)
59writer.WritePropertyName(entry.Key);
Generated\361d1da7f942c932\TestTypesContext.StructDictionaryStringInt32.g.cs (1)
53writer.WriteNumber(entry.Key, entry.Value);
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\TestTypesContext.DerivedDictionary.g.cs (1)
59writer.WriteNumber(entry.Key, entry.Value);
JsonSchemaExporter\SchemaTestHelpers.cs (1)
38.SelectMany(d => d.Errors!.Select(error => $"Path:${d.InstanceLocation} {error.Key}:{error.Value}"));
JsonSchemaExporter\TestTypes.cs (1)
1172private readonly IReadOnlyDictionary<TKey, TValue> _dictionary = values.ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
Stress.TelemetryService (1)
TelemetryStresser.cs (1)
176point.Attributes.Add(new KeyValue { Key = attribute.Key, Value = new AnyValue { StringValue = attribute.Value } });
System.Collections (34)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\Generic\DebugViewDictionaryItem.cs (1)
22Key = keyValue.Key;
System\Collections\Generic\OrderedDictionary.cs (21)
297SetAt(index, tpair.Key, tpair.Value); 347set => SetAt(index, value.Key, value.Value); 515Add(pair.Key, pair.Value); 522Add(pair.Key, pair.Value); 1172ArgumentNullException.ThrowIfNull(item.Key, nameof(item)); 1174int index = IndexOf(item.Key); 1188void IList<KeyValuePair<TKey, TValue>>.Insert(int index, KeyValuePair<TKey, TValue> item) => Insert(index, item.Key, item.Value); 1191void ICollection<KeyValuePair<TKey, TValue>>.Add(KeyValuePair<TKey, TValue> item) => Add(item.Key, item.Value); 1196ArgumentNullException.ThrowIfNull(item.Key, nameof(item)); 1199TryGetValue(item.Key, out TValue? value) && 1223if (TryGetValue(item.Key, out TValue? value, out int index) && EqualityComparer<TValue>.Default.Equals(value, item.Value)) 1334Add(pair.Key, pair.Value); 1341TryGetValue(pair.Key, out TValue? v) && 1363Insert(index, pair.Key, pair.Value); 1414new DictionaryEntry(Current.Key, Current.Value) : 1418readonly DictionaryEntry IDictionaryEnumerator.Entry => new(Current.Key, Current.Value); 1421readonly object IDictionaryEnumerator.Key => Current.Key; 1572get => _dictionary.GetAt(index).Key; 1579get => _dictionary.GetAt(index).Key; 1584TKey IReadOnlyList<TKey>.this[int index] => _dictionary.GetAt(index).Key; 1644public TKey Current => _enumerator.Current.Key;
System\Collections\Generic\SortedDictionary.cs (9)
131node.Item = new KeyValuePair<TKey, TValue>(node.Item.Key, value); 466return new DictionaryEntry(Current.Key, Current.Value); 482return Current.Key; 508return new DictionaryEntry(Current.Key, Current.Value); 545_dictionary._set.InOrderTreeWalk(delegate (TreeSet<KeyValuePair<TKey, TValue>>.Node node) { array[index++] = node.Item.Key; return true; }); 578_dictionary._set.InOrderTreeWalk(delegate (TreeSet<KeyValuePair<TKey, TValue>>.Node node) { objects[index++] = node.Item.Key; return true; }); 650return _dictEnum.Current.Key; 847return keyComparer.Compare(x.Key, y.Key);
System\Collections\Generic\SortedList.cs (3)
191Add(keyValuePair.Key, keyValuePair.Value); 196int index = IndexOfKey(keyValuePair.Key); 206int index = IndexOfKey(keyValuePair.Key);
System.Collections.Concurrent (1)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\Generic\DebugViewDictionaryItem.cs (1)
22Key = keyValue.Key;
System.Collections.Immutable (59)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\Generic\DebugViewDictionaryItem.cs (1)
22Key = keyValue.Key;
System\Collections\Frozen\FrozenDictionary.cs (6)
57d[pair.Key] = pair.Value; 141newDictionary[pair.Key] = pair.Value; 429pairs[index++] = new KeyValuePair<TKey, TValue>(item.Key, item.Value); 436dictEntryArray[index++] = new DictionaryEntry(item.Key, item.Value); 450objects[index++] = new KeyValuePair<TKey, TValue>(item.Key, item.Value); 603TryGetValue(item.Key, out TValue? value) &&
System\Collections\Frozen\Int32\Int32FrozenDictionary.cs (1)
35hashCodes[i] = entries[i].Key;
System\Collections\Frozen\Integer\DenseIntegralFrozenDictionary.cs (6)
56int min = int.CreateTruncating((TKeyUnderlying)(object)e.Current.Key); 60int key = int.CreateTruncating((TKeyUnderlying)(object)e.Current.Key); 85int index = int.CreateTruncating((TKeyUnderlying)(object)entry.Key); 86keys[index] = entry.Key; 101keys[i] = entry.Key; 105optionalValues[int.CreateTruncating((TKeyUnderlying)(object)entry.Key) - min] = new(entry.Value, hasValue: true);
System\Collections\Frozen\KeysAndValuesFrozenDictionary.cs (2)
32hashCodes[i] = Comparer.GetHashCode(entries[i].Key); 41_keys[destIndex] = entries[srcIndex].Key;
System\Collections\Immutable\DictionaryEnumerator.cs (2)
21get { return new DictionaryEntry(_inner.Current.Key, _inner.Current.Value); } 26get { return _inner.Current.Key; }
System\Collections\Immutable\ImmutableDictionary_2.Builder.cs (4)
159yield return item.Key; 337array.SetValue(new DictionaryEntry(item.Key, item.Value), arrayIndex++); 597this.Add(item.Key, item.Value); 652return this.Remove(item.Key);
System\Collections\Immutable\ImmutableDictionary_2.Comparers.cs (6)
104&& this.KeyComparer.Equals(x.FirstValue.Key, y.FirstValue.Key) 117return this.KeyComparer.GetHashCode(obj.FirstValue.Key); 130return _keyComparer.Equals(x.Key, y.Key); 142return _keyComparer.GetHashCode(obj.Key);
System\Collections\Immutable\ImmutableDictionary_2.cs (12)
176yield return item.Key; 764array.SetValue(new DictionaryEntry(item.Key, item.Value), arrayIndex++); 890int hashCode = origin.KeyComparer.GetHashCode(keyValuePair.Key); 895return bucket.TryGetValue(keyValuePair.Key, origin.Comparers, out value!) 965Requires.NotNullAllowStructs(pair.Key, nameof(pair.Key)); 966int hashCode = origin.KeyComparer.GetHashCode(pair.Key); 969ImmutableDictionary<TKey, TValue>.HashBucket newBucket = bucket.Add(pair.Key, pair.Value, origin.KeyOnlyComparer, origin.ValueComparer, collisionBehavior, out result); 989Requires.NotNullAllowStructs(pair.Key, nameof(pair.Key)); 990int hashCode = origin.KeyComparer.GetHashCode(pair.Key); 993ImmutableDictionary<TKey, TValue>.HashBucket newBucket = bucket.Add(pair.Key, pair.Value, origin.KeyOnlyComparer, origin.ValueComparer, collisionBehavior, out result);
System\Collections\Immutable\ImmutableDictionary_2.HashBucket.cs (4)
268if (comparers.KeyComparer.Equals(_firstValue.Key, key)) 307if (comparers.KeyComparer.Equals(_firstValue.Key, equalKey)) 309actualKey = _firstValue.Key; 321actualKey = _additionalElements.ItemRef(index).Key;
System\Collections\Immutable\ImmutableSortedDictionary_2.Builder.cs (3)
297newRoot = newRoot.Add(item.Key, item.Value, value, _valueComparer, out mutated); 471this.Add(item.Key, item.Value); 506return this.Remove(item.Key);
System\Collections\Immutable\ImmutableSortedDictionary_2.cs (6)
795? result.SetItem(item.Key, item.Value, _keyComparer, _valueComparer, out replacedExistingValue, out mutated) 796: result.Add(item.Key, item.Value, _keyComparer, _valueComparer, out mutated); 856dictionary[item.Key] = item.Value; 861if (dictionary.TryGetValue(item.Key, out value!)) 865throw new ArgumentException(SR.Format(SR.DuplicateKey, item.Key)); 870dictionary.Add(item.Key, item.Value);
System\Collections\Immutable\ImmutableSortedDictionary_2.Node.cs (6)
136get { return Linq.Enumerable.Select(this, p => p.Key); } 222array.SetValue(new DictionaryEntry(item.Key, item.Value), arrayIndex++); 415Requires.NotNullAllowStructs(pair.Key, nameof(pair.Key)); 419ImmutableSortedDictionary<TKey, TValue>.Node matchingNode = this.Search(pair.Key, keyComparer); 605return new Node(item.Key, item.Value, left, right, true);
System.Collections.NonGeneric (1)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\Generic\DebugViewDictionaryItem.cs (1)
22Key = keyValue.Key;
System.CommandLine (2)
Parsing\ParseOperation.cs (2)
386if (kvp is { Key: Option { Action: { Terminating: false } action }, Value: OptionResult { Implicit: true } } && 449var symbol = kvp.Key;
System.ComponentModel.Annotations (9)
System\ComponentModel\DataAnnotations\UIHintAttribute.cs (2)
152return leftParams.OrderBy(p => p.Key).SequenceEqual(rightParams.OrderBy(p => p.Key));
System\ComponentModel\DataAnnotations\Validator.cs (7)
726var attributes = _store.GetPropertyValidationAttributes(property.Key); 728property.Value, property.Key, attributes, 781var attributes = _store.GetPropertyValidationAttributes(property.Key); 786var validationResult = reqAttr.GetValidationResult(property.Value, property.Key); 1079var attributes = _store.GetPropertyValidationAttributes(property.Key); 1084errors.AddRange(GetValidationErrors(property.Value, property.Key, attributes, breakOnFirstError)); 1095var validationResult = reqAttr.GetValidationResult(property.Value, property.Key);
System.ComponentModel.Composition (9)
Microsoft\Internal\Requires.cs (1)
86if (keyValue.Key is null || keyValue.Value is null)
System\ComponentModel\Composition\ConstraintServices.cs (2)
75Expression metadataItemExpression = CreateMetadataContainsKeyExpression(parameter, requiredMetadataItem.Key); 78body = Expression.AndAlso(body, CreateMetadataOfTypeExpression(parameter, requiredMetadataItem.Key, requiredMetadataItem.Value));
System\ComponentModel\Composition\Hosting\AtomicComposition.cs (3)
249_values![index].Key, _values[index].Value); 269if (_values![index].Key == key) 292if (_values![index].Key == key)
System\ComponentModel\Composition\Primitives\ContractBasedImportDefinition.cs (3)
226if ((metadataItem.Key == null) || (metadataItem.Value == null)) 321string metadataKey = metadataItem.Key; 376sb.Append("\n\t\t").Append(metadataItem.Key).Append("\t(").Append(metadataItem.Value).Append(')');
System.ComponentModel.TypeConverter (7)
System\ComponentModel\CollectibleKeyConcurrentHashtable.cs (1)
120Current = new KeyValuePair<TKey, TValue>(_collectibleEnumerator.Current.Key, value);
System\ComponentModel\ComponentResourceManager.cs (1)
142string key = kvp.Key;
System\ComponentModel\ReflectTypeDescriptionProvider.cs (2)
863if (kvp.Key.Module == module && kvp.Value!.IsPopulated) 865typeList.Add(kvp.Key);
System\ComponentModel\TypeDescriptor.cs (3)
2338Type? nodeType = kvp.Key as Type; 2418Type? nodeType = kvp.Key as Type; 2476Type? nodeType = kvp.Key as Type;
System.Composition.Hosting (1)
System\Composition\Hosting\Core\ExportDescriptorRegistryUpdate.cs (1)
48var resultContract = result.Key;
System.Composition.Runtime (3)
System\Composition\Hosting\Core\CompositionContract.cs (3)
113_metadataConstraints.Select(kv => $"{kv.Key} = {Formatters.Format(kv.Value)}"))); 185if (!second.TryGetValue(firstItem.Key, out object secondValue)) 219result ^= kv.Key.GetHashCode();
System.Composition.TypedParts (7)
System\Composition\Hosting\SinglePartExportDescriptorProvider.cs (3)
30var subsetOfConstraints = contract.MetadataConstraints.Where(c => Metadata.ContainsKey(c.Key)).ToDictionary(c => c.Key, c => Metadata[c.Key]);
System\Composition\TypedParts\ActivationFeatures\PropertyInjectionFeature.cs (1)
85var property = d.Key;
System\Composition\TypedParts\TypedPartExportDescriptorProvider.cs (3)
89var subsettedConstraints = contract.MetadataConstraints.Where(c => export.Metadata.ContainsKey(c.Key)).ToDictionary(c => c.Key, c => export.Metadata[c.Key]);
System.Configuration.ConfigurationManager (1)
System\Configuration\BaseConfigurationRecord.cs (1)
439string configKey = keyValuePair.Key;
System.Console (4)
System\TerminalFormatStrings.cs (4)
168if (entry.Key.Length > MaxKeyFormatLength) 170MaxKeyFormatLength = entry.Key.Length; 172if (entry.Key.Length < MinKeyFormatLength) 174MinKeyFormatLength = entry.Key.Length;
System.Data.Common (7)
src\runtime\src\libraries\Common\src\System\Data\Common\DbConnectionOptions.Common.cs (1)
490string keyname = entry.Key;
System\Data\Common\DbConnectionStringBuilder.cs (1)
326if (!connectionStringBuilder.CurrentValues.TryGetValue(entry.Key, out value) || !entry.Value.Equals(value))
System\Data\Common\DbProviderFactories.cs (1)
96newRow[InvariantNameColumnName] = kvp.Key;
System\Data\Common\ObjectStorage.cs (4)
614tmp.Add(entry.Key, entry.Value); 649return ((x.Key == y.Key) && // same type 660return unchecked(obj.Key.GetHashCode() + obj.Value.ElementName.GetHashCode());
System.Data.Odbc (4)
src\runtime\src\libraries\Common\src\System\Data\Common\DbConnectionOptions.Common.cs (1)
490string keyname = entry.Key;
src\runtime\src\libraries\Common\src\System\Data\ProviderBase\DbConnectionFactory.cs (2)
224newConnectionPoolGroups.Add(entry.Key, entry.Value); 320newConnectionPoolGroups.Add(entry.Key, entry.Value);
src\runtime\src\libraries\Common\src\System\Data\ProviderBase\DbConnectionPoolGroup.cs (1)
261newPoolCollection.TryAdd(entry.Key, entry.Value);
System.Data.OleDb (3)
System\Data\ProviderBase\DbConnectionFactory.cs (2)
386newConnectionPoolGroups.Add(entry.Key, entry.Value); 507newConnectionPoolGroups.Add(entry.Key, entry.Value);
System\Data\ProviderBase\DbConnectionPoolGroup.cs (1)
303newPoolCollection.TryAdd(entry.Key, entry.Value);
System.Diagnostics.DiagnosticSource (55)
src\runtime\src\libraries\Common\src\System\Diagnostics\DiagnosticsHelper.cs (4)
61if (pair.Key == pair1.Key && object.Equals(pair.Value, pair1.Value)) 101if (pair.Key == pair1.Key && object.Equals(pair.Value, pair1.Value))
System\Diagnostics\Activity.cs (18)
443if (key == keyValue.Key) 580if (exceptionTags[i].Key == ExceptionMessageTag) 584else if (exceptionTags[i].Key == ExceptionStackTraceTag) 588else if (exceptionTags[i].Key == ExceptionTypeTag) 1680Remove(value.Key); 1689if (current.Value.Key == value.Key) 1713if (_first.Value.Key == key) 1723if (previous.Next.Value.Key == key) 1813if (current.Value.Key == key) 1832if (_first.Value.Key == key) 1846if (previous.Next.Value.Key == key) 1864Remove(value.Key); 1873if (current.Value.Key == value.Key) 1908yield return new KeyValuePair<string, string?>(current.Value.Key, (string?)current.Value.Value); 1925_stringBuilder.Append(_first.Value.Key); 1933_stringBuilder.Append(current.Value.Key);
System\Diagnostics\ActivityLink.netcoreapp.cs (1)
24hashCode.Add(kvp.Key);
System\Diagnostics\ActivitySource.cs (2)
60tagList.Sort((left, right) => string.Compare(left.Key, right.Key, StringComparison.Ordinal));
System\Diagnostics\ActivityTagsCollection.cs (7)
43if (kvp.Key != null) 45this[kvp.Key] = kvp.Value; 101list.Add(kvp.Key); 158if (item.Key == null) 163int index = FindIndex(item.Key); 166throw new InvalidOperationException(SR.Format(SR.KeyAlreadyExist, item.Key)); 263if (_list[i].Key == key)
System\Diagnostics\DiagLinkedList.cs (2)
176vsb.Append(kvp.Key); 201vsb.Append(kvp.Key);
System\Diagnostics\DistributedContextPropagator.cs (1)
140baggageList.Append(WebUtility.UrlEncode(item.Key)).Append('=').Append(WebUtility.UrlEncode(item.Value)).Append(CommaWithSpace);
System\Diagnostics\DsesFilterAndTransform.cs (2)
528if (eventNameFilter != null && eventNameFilter != evnt.Key) 532var eventName = evnt.Key;
System\Diagnostics\Helpers.cs (2)
33sb.Append(tag.Key).Append('=').Append(tag.Value); 48sb.Append(labels[i].Key).Append('=').Append(labels[i].Value);
System\Diagnostics\Metrics\AggregationManager.cs (2)
512kv.Value.Collect(kv.Key, (LabeledAggregationStatistics labeledAggStats) => 514_collectMeasurement(kv.Key, labeledAggStats, kv.Value);
System\Diagnostics\Metrics\AggregatorStore.cs (4)
401valueFetches[i] = new LabelInstruction(i, labels[i].Key); 456if (instr.LabelName != labels[instr.SourceIndex].Key) 491Span<string> indexedNames = kvName.Key.AsSpan(); 498Span<object?> indexedValues = kvValue.Key.AsSpan();
System\Diagnostics\Metrics\Instrument.cs (2)
76tagList.Sort((left, right) => string.Compare(left.Key, right.Key, StringComparison.Ordinal));
System\Diagnostics\Metrics\Meter.cs (2)
79tagList.Sort((left, right) => string.Compare(left.Key, right.Key, StringComparison.Ordinal));
System\Diagnostics\Metrics\MeterListener.cs (1)
289measurementsCompleted?.Invoke(kvp.Key, kvp.Value);
System\Diagnostics\Metrics\TagList.netcore.cs (4)
286if (item.Key == tags[i].Key && item.Value.Equals(tags[i].Value)) 296if (item.Key == tags[i].Key && tags[i].Value is null)
System\Diagnostics\W3CPropagator.cs (1)
251if (EncodeBaggageKey(item.Key, ref encodedBaggage))
System.Diagnostics.EventLog (1)
System\Diagnostics\Reader\ProviderMetadataCachedInformation.cs (1)
120keyToDelete = kvp.Key;
System.Diagnostics.PerformanceCounter (4)
System\Diagnostics\PerformanceData\CounterSet.cs (1)
236CounterInfo->CounterId = (uint)CounterDef.Key;
System\Diagnostics\PerformanceData\CounterSetInstanceCounterDataSet.cs (3)
137_counters.Add(CounterDef.Key, thisCounterData); 144(uint)CounterDef.Key, 153(uint)Interop.Errors.ERROR_NOT_FOUND => new InvalidOperationException(SR.Format(SR.Perflib_InvalidOperation_CounterRefValue, _instance._counterSet._counterSet, CounterDef.Key, _instance._instName)),
System.Diagnostics.Process (7)
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.ForkAndExecProcess.cs (2)
165dataByteLength = checked(dataByteLength + Encoding.UTF8.GetByteCount(pair.Key) + 1 + Encoding.UTF8.GetByteCount(pair.Value) + 1); 189int keyBytes = Encoding.UTF8.GetBytes(pair.Key, data.Slice(dataOffset));
System\Collections\Specialized\DictionaryWrapper.cs (4)
50public void Add(KeyValuePair<string, string?> item) => Add(item.Key, item.Value); 58return _contents.ContainsKey(item.Key) && _contents[item.Key] == item.Value; 82return Remove(item.Key);
System\Collections\Specialized\StringDictionaryWrapper.cs (1)
57yield return new DictionaryEntry(keyValuePair.Key, keyValuePair.Value);
System.DirectoryServices.AccountManagement (4)
System\DirectoryServices\AccountManagement\AD\ADStoreCtx_LoadStore.cs (2)
1380de.Properties[kvp.Key].Value = propertyValueList.ToArray(); 1392de.Properties[kvp.Key].Value = kvp.Value.Value[0];
System\DirectoryServices\AccountManagement\AD\ADStoreCtx_Query.cs (2)
993query.Append(ExtensionTypeConverter(kvp.Key, o.GetType(), o, kvp.Value.MatchType)); 998query.Append(ExtensionTypeConverter(kvp.Key, type, kvp.Value.Value, kvp.Value.MatchType));
System.Formats.Nrbf (1)
System\Formats\Nrbf\SystemClassWithMembersAndTypesRecord.cs (1)
53string memberName = structEnumerator.Current.Key;
System.Formats.Tar (9)
System\Formats\Tar\TarHeader.cs (6)
150_ea.Add(kvp.Key, kvp.Value); 156int index = extendedAttribute.Key.AsSpan().IndexOfAny('=', '\n'); 159throw new ArgumentException(SR.Format(SR.TarExtAttrDisallowedKeyChar, extendedAttribute.Key, extendedAttribute.Key[index] == '\n' ? "\\n" : extendedAttribute.Key[index])); 163throw new ArgumentException(SR.Format(SR.TarExtAttrDisallowedValueChar, extendedAttribute.Key, "\\n"));
System\Formats\Tar\TarHeader.Read.cs (2)
105_ea.Add(extendedAttribute.Key, extendedAttribute.Value); 107switch (extendedAttribute.Key)
System\Formats\Tar\TarHelpers.Unix.cs (1)
114File.SetUnixFileMode(dir.Key, dir.Value & ~umask);
System.IO.Packaging (5)
System\IO\Packaging\ContentType.cs (1)
194if (contentTypeEnumerator.Current.Key != null)
System\IO\Packaging\Package.cs (1)
1216_partList.Add(keyValue.Key, keyValue.Value);
System\IO\Packaging\PartBasedPackageProperties.cs (2)
775PackageXmlEnum propertyNamespace = PackageXmlStringTable.GetXmlNamespace(entry.Key); 777_xmlWriter.WriteStartElement(PackageXmlStringTable.GetXmlString(entry.Key),
System\IO\Packaging\XmlCompatibilityReader.cs (1)
119keysToUpdate.Add(pair.Key);
System.Linq.AsyncEnumerable (1)
System\Linq\ToDictionaryAsync.cs (1)
40d.Add(element.Key, element.Value);
System.Linq.Expressions (17)
System\Dynamic\ExpandoObject.cs (3)
675TryAddMember(item.Key, item.Value); 705if (!TryGetValueForKey(item.Key, out object? value)) 730return TryDeleteValue(null, -1, item.Key, ignoreCase: false, deleteValue: item.Value);
System\Linq\Expressions\Compiler\BoundConstants.cs (3)
155LocalBuilder local = lc.IL.DeclareLocal(reference.Key.Type); 156EmitConstantFromArray(lc, reference.Key.Value, local.LocalType); 158_cache.Add(reference.Key, local);
System\Linq\Expressions\Compiler\CompilerScope.cs (3)
369if (ShouldCache(refCount.Key, refCount.Value)) 371if (ResolveVariable(refCount.Key) is ElementBoxStorage storage) 374CacheBoxToLocal(storage.Compiler, refCount.Key);
System\Linq\Expressions\Interpreter\InstructionList.cs (1)
127while (hasCookie && cookieEnumerator.Current.Key == i)
System\Linq\Expressions\Interpreter\Utilities.cs (7)
188if (_keysAndValues[i].Key == key) 211if (_keysAndValues[i].Key == key) 234if (keysAndValues[i].Key == key) 260if (_keysAndValues[i].Key != null) 298if (_keysAndValues[i].Key == key) 303else if (_keysAndValues[i].Key == null) 324_dict[_keysAndValues[i].Key] = _keysAndValues[i].Value;
System.Linq.Parallel (3)
System\Linq\Parallel\QueryOperators\PartitionerQueryOperator.cs (1)
225currentKey = (int)current.Key;
System\Linq\Parallel\QueryOperators\Unary\DistinctQueryOperator.cs (1)
262currentElement = currentPair.Key.Value;
System\Linq\Parallel\QueryOperators\Unary\GroupByQueryOperator.cs (1)
701return _keyValues.Key.Value;
System.Net.Http (13)
System\Net\Http\DiagnosticsHandler.cs (1)
122activity.SetTag(methodTag.Key, methodTag.Value);
System\Net\Http\FormUrlEncodedContent.cs (1)
40Encode(ref builder, pair.Key);
System\Net\Http\Headers\HttpHeaders.cs (1)
1476Key = entry.Key,
System\Net\Http\Headers\HttpHeadersNonValidated.cs (1)
103yield return header.Key;
System\Net\Http\Metrics\MetricsHandler.cs (1)
123yield return new Measurement<long>(entry.Value, entry.Key.ToTagList());
System\Net\Http\MultipartContent.cs (4)
320Encoding headerValueEncoding = HeaderEncodingSelector?.Invoke(headerPair.Key, content) ?? HttpRuleParser.DefaultHttpEncoding; 322WriteToStream(stream, headerPair.Key); 364currentLength += headerPair.Key.Length + ColonSpaceLength; 366Encoding headerValueEncoding = HeaderEncodingSelector?.Invoke(headerPair.Key, content) ?? HttpRuleParser.DefaultHttpEncoding;
System\Net\Http\SocketsHttpHandler\Http2Connection.cs (2)
1118int streamId = kvp.Key; 1916int streamId = kvp.Key;
System\Net\Http\SocketsHttpHandler\HttpConnectionPoolManager.cs (1)
528_pools.TryRemove(entry.Key, out _);
System\Net\Http\SocketsHttpHandler\Metrics\SocketsHttpHandlerMetrics.cs (1)
128yield return new Measurement<long>(entry.Value, entry.Key.ToTagList());
System.Net.Http.WinHttpHandler (1)
System\Net\Http\WinHttpHandler.cs (1)
1755_cachedCertificates.TryRemove(kvPair.Key, out _);
System.Net.Mail (1)
System\Net\Mime\MediaTypeMap.cs (1)
742longestExtensionLength = Math.Max(longestExtensionLength, entry.Key.Length);
System.Net.NameResolution (7)
System\Net\Dns.cs (5)
368KeyValuePair<IPAddress, AddressFamily> t => t.Key, 766KeyValuePair<string, AddressFamily> t => GetHostAddressesCore(t.Key, t.Value, activity), 768KeyValuePair<IPAddress, AddressFamily> t => GetHostAddressesCore(t.Key, t.Value, activity), 777KeyValuePair<string, AddressFamily> t => GetHostEntryCore(t.Key, t.Value, activity), 779KeyValuePair<IPAddress, AddressFamily> t => GetHostEntryCore(t.Key, t.Value, activity),
System\Net\NameResolutionTelemetry.cs (2)
133KeyValuePair<string, AddressFamily> t => t.Key, 135KeyValuePair<IPAddress, AddressFamily> t => t.Key.ToString(),
System.Net.NetworkInformation (2)
System\Net\NetworkInformation\NetworkAddressChange.Unix.cs (2)
281NetworkAddressChangedEventHandler handler = subscriber.Key; 323NetworkAvailabilityChangedEventHandler handler = subscriber.Key;
System.Net.Requests (2)
System\Net\HttpWebResponse.cs (2)
205_webHeaderCollection[header.Key] = GetHeaderValueAsString(header.Value); 212_webHeaderCollection[header.Key] = GetHeaderValueAsString(header.Value);
System.Net.Security (5)
System\Net\NegotiateAuthenticationPal.ManagedSpnego.cs (2)
177_optimisticMechanism = CreateMechanismForPackage(packageAndOid.Key); 193bool canFallBackToNextMechanism = packageAndOid.Key != NegotiationInfoClass.NTLM;
System\Net\Security\SslSessionsCache.cs (3)
228s_cachedCreds.TryRemove(toRemoveAttempt[i].Key, out _); 236s_cachedCreds[toRemoveAttempt[i].Key] = cached; 240s_cachedCreds.TryRemove(toRemoveAttempt[i].Key, out _);
System.Net.WebSockets.Client (2)
System\Net\WebSockets\HttpResponseHeadersReadOnlyCollection.cs (2)
25yield return header.Key; 49yield return new KeyValuePair<string, IEnumerable<string>>(header.Key, header.Value);
System.Private.CoreLib (82)
src\runtime\src\libraries\System.Private.CoreLib\src\System\AppContext.AnyOS.cs (3)
49ev.LogAppContextSwitch(kvp.Key, kvp.Value ? 1 : 0); 77switches?.ContainsKey(kvp.Key) != true) 79ev.LogAppContextSwitch(kvp.Key, isEnabled ? 1 : 0);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\SharedArrayPool.cs (3)
222Array.Clear(tlsBuckets.Key); 229SharedArrayPoolThreadLocalArray[] buckets = tlsBuckets.Key; 254SharedArrayPoolThreadLocalArray[] buckets = tlsBuckets.Key;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\Concurrent\ConcurrentDictionary.cs (9)
338if (pair.Key is null) 343if (!TryAddInternal(_tables, pair.Key, null, pair.Value, updateIfExists: false, acquireLock: false, out _)) 419/// The <see cref="KeyValuePair{TKey, TValue}.Key"/> property of <paramref name="item"/> is a null reference. 423if (item.Key is null) 428return TryRemoveInternal(item.Key, out _, matchValue: true, item.Value); 1602void ICollection<KeyValuePair<TKey, TValue>>.Add(KeyValuePair<TKey, TValue> keyValuePair) => ((IDictionary<TKey, TValue>)this).Add(keyValuePair.Key, keyValuePair.Value); 1614TryGetValue(keyValuePair.Key, out TValue? value) && 2296public DictionaryEntry Entry => new DictionaryEntry(_enumerator.Current.Key, _enumerator.Current.Value); 2298public object Key => _enumerator.Current.Key;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\Generic\DebugViewDictionaryItem.cs (1)
22Key = keyValue.Key;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\Generic\Dictionary.cs (12)
171Add(pair.Key, pair.Value); 179Add(pair.Key, pair.Value); 255Add(keyValuePair.Key, keyValuePair.Value); 259ref TValue value = ref FindValue(keyValuePair.Key); 270ref TValue value = ref FindValue(keyValuePair.Key); 273Remove(keyValuePair.Key); 1229if (array[i].Key == null) 1234Add(array[i].Key, array[i].Value); 1934return new DictionaryEntry(_current.Key, _current.Value); 1937return new KeyValuePair<TKey, TValue>(_current.Key, _current.Value); 1961return new DictionaryEntry(_current.Key, _current.Value); 1974return _current.Key;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\Generic\KeyValuePair.cs (2)
47return KeyValuePair.PairToString(Key, Value); 53key = Key;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\ObjectModel\ReadOnlyDictionary.cs (4)
189dictEntryArray[index++] = new DictionaryEntry(item.Key, item.Value); 199objects[index++] = new KeyValuePair<TKey, TValue>(item.Key, item.Value); 227get => new DictionaryEntry(_enumerator.Current.Key, _enumerator.Current.Value); 230public object Key => _enumerator.Current.Key;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\DiagnosticCounter.cs (3)
135return current.Key + ":" + current.Value; 140StringBuilder sb = new StringBuilder().Append(current.Key).Append(':').Append(current.Value); 144sb.Append(',').Append(current.Key).Append(':').Append(current.Value);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\ManifestBuilder.cs (2)
187channelMask[item.Key] = item.Value.Keywords; 375int channel = kvpair.Key;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\EventPayload.cs (1)
66return ContainsKey(entry.Key);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\NameInfo.cs (1)
60return this.Compare(key.Key, key.Value & Statics.EventTagsMask);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Environment.Variables.Unix.cs (1)
70results.Add(keyValuePair.Key, keyValuePair.Value);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Resources\ResourceSet.cs (1)
220if (item.Key is not string s)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\AsyncLocal.cs (37)
155return ReferenceEquals(key, _item0.Key) ? 163return ReferenceEquals(key, _item0.Key) ? 171if (ReferenceEquals(key, _item0.Key)) 206ReferenceEquals(key, _item0.Key) ? new TwoElementAsyncLocalValueMap(newItem, _item1) : 207ReferenceEquals(key, _item1.Key) ? new TwoElementAsyncLocalValueMap(_item0, newItem) : 215ReferenceEquals(key, _item0.Key) ? new OneElementAsyncLocalValueMap(_item1) : 216ReferenceEquals(key, _item1.Key) ? new OneElementAsyncLocalValueMap(_item0) : 223if (ReferenceEquals(key, _item0.Key)) 228else if (ReferenceEquals(key, _item1.Key)) 266ReferenceEquals(key, _item0.Key) ? new ThreeElementAsyncLocalValueMap(newItem, _item1, _item2) : 267ReferenceEquals(key, _item1.Key) ? new ThreeElementAsyncLocalValueMap(_item0, newItem, _item2) : 268ReferenceEquals(key, _item2.Key) ? new ThreeElementAsyncLocalValueMap(_item0, _item1, newItem) : 276ReferenceEquals(key, _item0.Key) ? new TwoElementAsyncLocalValueMap(_item1, _item2) : 277ReferenceEquals(key, _item1.Key) ? new TwoElementAsyncLocalValueMap(_item0, _item2) : 278ReferenceEquals(key, _item2.Key) ? new TwoElementAsyncLocalValueMap(_item0, _item1) : 285if (ReferenceEquals(key, _item0.Key)) 290else if (ReferenceEquals(key, _item1.Key)) 295else if (ReferenceEquals(key, _item2.Key)) 335ReferenceEquals(key, _item0.Key) ? new FourElementAsyncLocalValueMap(newItem, _item1, _item2, _item3) : 336ReferenceEquals(key, _item1.Key) ? new FourElementAsyncLocalValueMap(_item0, newItem, _item2, _item3) : 337ReferenceEquals(key, _item2.Key) ? new FourElementAsyncLocalValueMap(_item0, _item1, newItem, _item3) : 338ReferenceEquals(key, _item3.Key) ? new FourElementAsyncLocalValueMap(_item0, _item1, _item2, newItem) : 346ReferenceEquals(key, _item0.Key) ? new ThreeElementAsyncLocalValueMap(_item1, _item2, _item3) : 347ReferenceEquals(key, _item1.Key) ? new ThreeElementAsyncLocalValueMap(_item0, _item2, _item3) : 348ReferenceEquals(key, _item2.Key) ? new ThreeElementAsyncLocalValueMap(_item0, _item1, _item3) : 349ReferenceEquals(key, _item3.Key) ? new ThreeElementAsyncLocalValueMap(_item0, _item1, _item2) : 356if (ReferenceEquals(key, _item0.Key)) 361else if (ReferenceEquals(key, _item1.Key)) 366else if (ReferenceEquals(key, _item2.Key)) 371else if (ReferenceEquals(key, _item3.Key)) 401if (ReferenceEquals(key, _keyValues[i].Key)) 458many[pair.Key] = pair.Value; 468if (ReferenceEquals(key, pair.Key)) 496map[pair.Key] = pair.Value; 517if (!ReferenceEquals(key, pair.Key)) 530if (!ReferenceEquals(key, pair.Key)) 532map[pair.Key] = pair.Value;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\SynchronizationContext.cs (1)
25=> ThreadPool.QueueUserWorkItem(static s => s.Key(s.Value), new KeyValuePair<SendOrPostCallback, object?>(d, state), preferLocal: false);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskScheduler.cs (1)
493schedulers.Add(item.Key);
System.Private.CoreLib.Generators (1)
NativeRuntimeEventSourceGenerator.cs (1)
44string providerName = kvp.Key;
System.Private.DataContractSerialization (6)
System\Runtime\Serialization\CollectionDataContract.cs (1)
1643return new KeyValue<K, V>(current.Key, current.Value);
System\Runtime\Serialization\DataContractSet.cs (2)
45InternalAdd(pair.Key, pair.Value); 52ProcessedContracts.Add(pair.Key, pair.Value);
System\Runtime\Serialization\Json\JsonXmlDataContract.cs (2)
78if (!xmlNames.Contains(pair.Key)) 80xmlNames.Add(pair.Key);
System\Runtime\Serialization\XmlObjectSerializerReadContext.cs (1)
958xmlAttributes.Add(AddNamespaceDeclaration(prefixNsPair.Key, prefixNsPair.Value));
System.Private.Reflection.Execution (2)
Internal\Reflection\Execution\ExecutionEnvironmentImplementation.MappingTables.cs (2)
508if (TryGetMethodForOriginalLdFtnResult_InvokeMap_Inner(perModuleLookup.Key, forStartAddress: false, canonOriginalLdFtnResult, instantiationArgument, parserOffset, ref declaringTypeHandle, out methodHandle, out genericMethodTypeArgumentHandles)) 532if (TryGetMethodForOriginalLdFtnResult_InvokeMap_Inner(perModuleLookup.Key, forStartAddress: true, methodStartAddress, IntPtr.Zero, parserOffset, ref declaringTypeHandle, out methodHandle, out _))
System.Private.TypeLoader (1)
Internal\Reflection\Execution\AssemblyBinderImplementation.cs (1)
56if (AssemblyNameMatches(refName, group.Key, ref preferredException))
System.Private.Xml (24)
System\Xml\Dom\DocumentSchemaValidator.cs (1)
465defaultPrefix = pair.Key;
System\Xml\Schema\ContentValidator.cs (5)
137XmlQualifiedName name = entry.Key; 149if (list.Allows(wildcard.Key)) 207return name.Key.ToString(); 217return $"{wildcard.Key}:*"; 2202names.Add(element.Key);
System\Xml\Schema\SchemaInfo.cs (4)
307if (!_elementDecls.ContainsKey(entry.Key)) 309_elementDecls.Add(entry.Key, entry.Value); 314if (!_elementDeclsByType.ContainsKey(entry.Key)) 316_elementDeclsByType.Add(entry.Key, entry.Value);
System\Xml\Schema\XmlSchemaValidator.cs (1)
2147defaultPrefix = pair.Key;
System\Xml\Serialization\CodeGenerator.cs (1)
1614(Type, string) key = (item.Value.LocalType, item.Key);
System\Xml\Serialization\Types.cs (2)
1219replaceList.Add(pair.Key, replacedInfo); 1227memberInfos[pair.Key] = pair.Value;
System\Xml\Serialization\XmlSerializerNamespaces.cs (2)
125if (!string.IsNullOrEmpty(nsPair.Key) && nsPair.Value.Namespace == ns) 127prefix = nsPair.Key;
System\Xml\XPath\XPathNavigator.cs (2)
1887if (pair.Key != "xmlns") 1888mngr.AddNamespace(pair.Key, pair.Value);
System\Xml\Xsl\Xslt\XslAstAnalyzer.cs (3)
218AddImportDependencies(import, /*focusDonor:*/pair.Key); 277if (!parentModeFlags.TryGetValue(modeFlag.Key, out modeFlags)) 281parentModeFlags[modeFlag.Key] = modeFlags | modeFlag.Value;
System\Xml\Xsl\Xslt\XsltInput.cs (3)
136if (_scopeManager.LookupNamespace(prefixNamespacePair.Key) == null) 139_scopeManager.AddNsDeclaration(prefixNamespacePair.Key, nsAtomizedValue); 140_ctxInfo!.AddNamespace(prefixNamespacePair.Key, nsAtomizedValue);
System.Reflection.Emit (6)
System\Reflection\Emit\ModuleBuilderImpl.cs (6)
437_pdbBuilder.AddMethodDebugInformation(GetDocument(enumerator.Current.Key), _pdbBuilder.GetOrAddBlob(spBlobBuilder)); 457spBlobBuilder.WriteCompressedInteger(MetadataTokens.GetRowNumber(GetDocument(pair.Key))); 466spBlobBuilder.WriteCompressedInteger(MetadataTokens.GetRowNumber(GetDocument(pair.Key))); 614if (pair.Key is MemberInfo member) 619if (pair.Key is KeyValuePair<MethodInfo, Type[]> pair2) 621pair.Value.WriteInt32(MetadataTokens.GetToken(GetMethodReference(pair2.Key, pair2.Value)));
System.Reflection.Metadata (13)
System\Reflection\Metadata\Ecma335\BlobDictionary.cs (1)
31if (!exists || entry.Key.AsSpan().SequenceEqual(key))
System\Reflection\Metadata\Ecma335\MetadataBuilder.Heaps.cs (8)
557if (prev.EndsWith(entry.Key, StringComparison.Ordinal) && !char.IsLowSurrogate(entry.Key[0])) 560stringVirtualIndexToHeapOffsetMap[entry.Value.GetWriterVirtualIndex()] = position - (Encoding.UTF8.GetByteCount(entry.Key) + 1); 565heapBuilder.WriteUTF8(entry.Key, allowUnpairedSurrogates: false); 569prev = entry.Key; 585string x = xPair.Key; 586string y = yPair.Key; 628var blob = entry.Value.Key;
System\Reflection\Metadata\Internal\NamespaceCache.cs (3)
146namespaceTable.Add(group.Key, group.Value.Freeze()); 182remaps.Add(new KeyValuePair<NamespaceDefinitionHandle, NamespaceDataBuilder>(group.Key, existingRecord)); 195table[tuple.Key] = tuple.Value;
System\Reflection\Metadata\MetadataReader.cs (1)
1471nestedTypesMap.Add(group.Key, group.Value.ToImmutable());
System.Resources.Extensions (4)
src\runtime\src\libraries\Common\src\System\Resources\ResourceWriter.cs (3)
309_resourceList.Add(entry.Key, entry.Value); 317nameHashes[curNameNumber] = FastResourceComparer.HashFunction(item.Key); 319names.Write(item.Key); // key
System\Resources\Extensions\BinaryFormat\Deserializer\Deserializer.cs (1)
367SerializationRecordId incompleteId = pair.Key;
System.Resources.Writer (3)
src\runtime\src\libraries\Common\src\System\Resources\ResourceWriter.cs (3)
309_resourceList.Add(entry.Key, entry.Value); 317nameHashes[curNameNumber] = FastResourceComparer.HashFunction(item.Key); 319names.Write(item.Key); // key
System.Runtime.Serialization.Schema (5)
System\Runtime\Serialization\Schema\CodeExporter.cs (4)
74string dataContractNamespace = pair.Key; 991if (classDataContract.XmlName != pair.Key && !classDataContract.KnownDataContracts.ContainsKey(pair.Key) && !pair.Value.IsBuiltInDataContract) 992classDataContract.KnownDataContracts.Add(pair.Key, pair.Value);
System\Runtime\Serialization\Schema\XsdDataContractImporter.cs (1)
306!TryGetCollectionItemElement(schemas, pair.Key, out XmlSchemaElement? itemElement))
System.Security.Claims (1)
System\Security\Claims\Claim.cs (1)
496writer.Write(kvp.Key);
System.Security.Cryptography.Cose (4)
System\Security\Cryptography\Cose\CoseHeaderMap.cs (3)
139public void Add(KeyValuePair<CoseHeaderLabel, CoseHeaderValue> item) => Add(item.Key, item.Value); 360CoseHeaderLabel label = kvp.Key; 401CoseHeaderLabel label = kvp.Key;
System\Security\Cryptography\Cose\CoseMessage.cs (1)
569if (unprotectedHeaders.ContainsKey(kvp.Key))
System.ServiceModel.Http (1)
System\ServiceModel\Channels\HttpResponseMessageExtensionMethods.cs (1)
72webHeaders[header.Key] = String.Join(",", header.Value);
System.ServiceModel.NetFramingBase (1)
System\ServiceModel\Channels\ConnectionPool.cs (1)
100endpointKeysToRemove.Add(poolEntry.Key);
System.ServiceModel.Primitives (12)
System\ServiceModel\Channels\AddressHeaderCollection.cs (1)
153if (otherHeaders.TryGetValue(pair.Key, out count))
System\ServiceModel\Channels\MessageProperties.cs (7)
483this[property.Key] = property.Value; 879UpdateProperty(pair.Key, pair.Value, true); 894if (pair.Key == null) 900if (!TryGetValue(pair.Key, out value)) 976if (pair.Key == null) 982if (!TryGetValue(pair.Key, out value)) 990Remove(pair.Key);
System\ServiceModel\Channels\ReliableMessagingHelpers.cs (1)
510pair.Key.Abort();
System\ServiceModel\Dispatcher\DataContractSerializerOperationFormatter.cs (3)
353if (multipleHeaderValues[headerDescription.Index].Key == null) 389if (multipleHeaderValues[i].Key != null) 391parameters[i] = multipleHeaderValues[i].Value.ToArray(multipleHeaderValues[i].Key);
System.ServiceModel.Primitives.Tests (1)
ServiceModel\MessageContractTest.4.4.0.cs (1)
163properties[property.Key] = property.Value.ToString();
System.Speech (13)
Internal\SrgsCompiler\BackEnd.cs (1)
853if (kvFirstArc.Key == k)
Internal\Synthesis\TextWriterEngine.cs (1)
301_writer.WriteAttributeString(kp.Key, kp.Value);
Result\RecognizedPhrase.cs (7)
479InsertSemanticValueToDictionary(semanticValue, kv.Key, kv.Value, semanticTag, ref dupItems); 1064if (kv.Key == "_attributes") 1076string keyName = kv.Key; 1079keyName = RemoveTrailingNumber(kv.Key); 1083propertyNode.SetAttribute("confidence", semanticsNode[kv.Key].Confidence.ToString("f", nfo)); 1114if (propertyNode.Attributes[kv.Key] == null) 1116propertyNode.SetAttribute(kv.Key, kv.Value.Value?.ToString());
Result\SemanticValue.cs (4)
48if (!refObj.ContainsKey(kv.Key) || !refObj[kv.Key].Equals(this[kv.Key])) 98return (_dictionary.ContainsKey(item.Key) && _dictionary.ContainsValue(item.Value));
System.Text.Json (27)
System\Text\Json\Nodes\JsonObject.cs (7)
43dictionary.Add(node.Key, node.Value); 101jObject.Add(item.Key, item.Value?.DeepCloneCore()); 110return item.HasValue ? item.Value.Key : string.Empty; 201writer.WritePropertyName(entry.Key); 237if (!otherDict.TryGetValue(item.Key, out JsonNode? jsonNode) || !DeepEquals(item.Value, jsonNode)) 269string propertyName = FindValue(child)!.Value.Key; 360properties[i].PropertyName = item.Key;
System\Text\Json\Nodes\JsonObject.IDictionary.cs (2)
86public void Add(KeyValuePair<string, JsonNode?> property) => Add(property.Key, property.Value); 201bool ICollection<KeyValuePair<string, JsonNode?>>.Remove(KeyValuePair<string, JsonNode?> item) => Remove(item.Key);
System\Text\Json\Nodes\JsonObject.IList.cs (2)
89set => SetAt(index, value.Key, value.Value); 96void IList<KeyValuePair<string, JsonNode?>>.Insert(int index, KeyValuePair<string, JsonNode?> item) => Insert(index, item.Key, item.Value);
System\Text\Json\Schema\JsonSchema.cs (1)
186properties.Add(property.Key, property.Value.ToJsonNode(options));
System\Text\Json\Schema\JsonSchemaExporter.cs (3)
234(required ??= []).Add(typeDiscriminatorPair.Key); 329Required = parentPolymorphicTypeContainsTypesWithoutDiscriminator ? [typeDiscriminator.Value.Key] : null, 345dictRequired = [dictDiscriminator.Key];
System\Text\Json\Serialization\Converters\Collection\DictionaryDefaultConverter.cs (1)
57TKey key = enumerator.Current.Key;
System\Text\Json\Serialization\Converters\Collection\DictionaryOfTKeyTValueConverter.cs (2)
67TKey key = enumerator.Current.Key; 86TKey key = enumerator.Current.Key;
System\Text\Json\Serialization\JsonSerializer.Read.HandleMetadata.cs (2)
479else if (property.Key == "$id") 491else if (property.Key == "$ref")
System\Text\Json\Serialization\JsonSerializer.Read.HandlePropertyName.cs (2)
157newDict[kvp.Key] = kvp.Value; 177newDict[kvp.Key] = kvp.Value;
System\Text\Json\Serialization\JsonSerializerOptionsUpdateHandler.cs (1)
23options.Key.ClearCaches();
System\Text\Json\Serialization\Metadata\ReflectionEmitCachingMemberAccessor.Cache.cs (1)
71_cache.TryRemove(kvp.Key, out _);
System\Text\Json\Serialization\Metadata\ReflectionEmitMemberAccessor.cs (1)
638Type caseType = entry.Key;
System\Text\Json\Serialization\Metadata\ReflectionMemberAccessor.cs (2)
244caseTypes[i] = entry.Key; 247.MakeGenericMethod(typeof(TUnion), entry.Key)
System.Text.Json.SourceGeneration (6)
JsonSourceGenerator.Emitter.cs (1)
2323writer.WriteLine($$"""private static readonly {{JsonEncodedTextTypeRef}} {{name_varName_pair.Value}} = {{JsonEncodedTextTypeRef}}.Encode({{FormatStringLiteral(name_varName_pair.Key)}});""");
JsonSourceGenerator.Parser.cs (5)
446switch (namedArg.Key) 641switch (namedArg.Key) 1092switch (namedArg.Key) 1121if (namedArg.Key == "TypeClassifier" && 1820$"case types {string.Join(", ", kvp.Value.ConvertAll(n => $"'{n}'"))} all serialize as JSON value type '{kvp.Key}'");
System.Text.RegularExpressions (16)
System\Text\RegularExpressions\RegexCharClass.cs (2)
1871return temp.ConvertAll(kvp => kvp.Key).ToArray(); 1995desc.Append(equalsGroup ? @"\p{" : @"\P{").Append(kvp.Key).Append('}');
System\Text\RegularExpressions\RegexCompiler.cs (1)
2012Ldc(kvp.Key);
System\Text\RegularExpressions\RegexPrefixAnalyzer.cs (1)
767results.Add(new RegexFindOptimizations.FixedDistanceSet(null, pair.Value.Set.ToStringClass(), pair.Key + distance));
System\Text\RegularExpressions\RegexWriter.cs (1)
118strings[stringEntry.Value] = stringEntry.Key;
System\Text\RegularExpressions\Symbolic\SparseIntMap.cs (2)
40int entryKey = dense[idx].Key; 69Debug.Assert(_dense[index].Key == key);
System\Text\RegularExpressions\Symbolic\SymbolicRegexMatcher.cs (6)
1318if (matcher.GetState(matcher.GetCoreStateId(nfaState.Key)).StartsWithLineAnchor) 1332if (matcher.GetState(matcher.GetCoreStateId(nfaState.Key)).IsNullableFor(nextCharKind)) 1361foreach (int nextState in GetNextStates(sourceStates.Values[0].Key, mintermId, matcher)) 1377foreach (int nextState in GetNextStates(sourceState.Key, mintermId, matcher)) 1384int coreStateId = matcher.GetCoreStateId(sourceState.Key); 1431flags |= matcher._stateFlagsArray[matcher.GetCoreStateId(nfaState.Key)];
System\Text\RegularExpressions\Symbolic\SymbolicRegexMatcher.Dgml.cs (3)
67writer.WriteLine($" <Link Source=\"{transition.Key.Source}\" Target=\"{transition.Key.Target}\" Label=\"{label}\" Category=\"NonEpsilonTransition\" {info}/>"); 72writer.WriteLine($" <Link Source=\"{transition.Key.Target}\" Target=\"{nfaTarget}\" Category=\"EpsilonTransition\"/>");
System.Text.RegularExpressions.Generator (7)
RegexGenerator.cs (3)
211if (!requiredHelpers.ContainsKey(helper.Key)) 213requiredHelpers.Add(helper.Key, helper.Value); 293foreach (KeyValuePair<string, string[]> helper in requiredHelpers.OrderBy(h => h.Key, StringComparer.Ordinal))
RegexGenerator.Emitter.cs (1)
1698foreach (KeyValuePair<string, string[]> localFunctions in additionalLocalFunctions.OrderBy(k => k.Key))
src\runtime\src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexCharClass.cs (2)
1871return temp.ConvertAll(kvp => kvp.Key).ToArray(); 1995desc.Append(equalsGroup ? @"\p{" : @"\P{").Append(kvp.Key).Append('}');
src\runtime\src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexPrefixAnalyzer.cs (1)
767results.Add(new RegexFindOptimizations.FixedDistanceSet(null, pair.Value.Set.ToStringClass(), pair.Key + distance));
System.Threading.Channels (22)
System\Threading\Channels\AsyncOperation.cs (1)
399t.Key(t.Value);
System\Threading\Channels\BoundedChannel.cs (5)
663lock (state.Key.SyncObj) 668ChannelUtilities.Remove(ref state.Key._blockedReadersHead, blockedReader); 672ChannelUtilities.Remove(ref state.Key._blockedWritersHead, blockedWriter); 676ChannelUtilities.Remove(ref state.Key._waitingReadersHead, waitingReader); 680ChannelUtilities.Remove(ref state.Key._waitingWritersHead, waitingWriter);
System\Threading\Channels\RendezvousChannel.cs (5)
457lock (state.Key.SyncObj) 462ChannelUtilities.Remove(ref state.Key._blockedReadersHead, blockedReader); 466ChannelUtilities.Remove(ref state.Key._blockedWritersHead, blockedWriter); 470ChannelUtilities.Remove(ref state.Key._waitingReadersHead, waitingReader); 474ChannelUtilities.Remove(ref state.Key._waitingWritersHead, waitingWriter);
System\Threading\Channels\SingleConsumerUnboundedChannel.cs (5)
371lock (state.Key.SyncObj) 376if (state.Key._blockedReader == blockedReader) 378state.Key._blockedReader = null; 383if (state.Key._waitingReader == waitingReader) 385state.Key._waitingReader = null;
System\Threading\Channels\UnboundedChannel.cs (3)
320lock (state.Key.SyncObj) 325ChannelUtilities.Remove(ref state.Key._blockedReadersHead, blockedReader); 329ChannelUtilities.Remove(ref state.Key._waitingReadersHead, waitingReader);
System\Threading\Channels\UnboundedPriorityChannel.cs (3)
316lock (state.Key.SyncObj) 321ChannelUtilities.Remove(ref state.Key._blockedReadersHead, blockedReader); 325ChannelUtilities.Remove(ref state.Key._waitingReadersHead, waitingReader);
System.Threading.RateLimiting (1)
System\Threading\RateLimiting\DefaultPartitionedRateLimiter.cs (1)
263_limiters.Remove(rateLimiter.Key);
System.Threading.Tasks.Dataflow (58)
Blocks\ActionBlock.cs (3)
133action(messageWithId.Key); 161task = action(messageWithId.Key); 172Common.StoreDataflowMessageValueIntoExceptionData(caughtException, messageWithId.Key);
Blocks\BatchBlock.cs (18)
790if (sourceAndMessage.Key.ReserveMessage(sourceAndMessage.Value, _owningBatch)) 793var reservedSourceAndMessage = new KeyValuePair<ISourceBlock<T>, KeyValuePair<DataflowMessageHeader, T>>(sourceAndMessage.Key, reservedMessage); 808if (sourceAndMessage.Key.ReserveMessage(sourceAndMessage.Value, _owningBatch)) 811var reservedSourceAndMessage = new KeyValuePair<ISourceBlock<T>, KeyValuePair<DataflowMessageHeader, T>>(sourceAndMessage.Key, reservedMessage); 908var reservedSourceAndMessage = new KeyValuePair<ISourceBlock<T>, KeyValuePair<DataflowMessageHeader, T>>(sourceAndMessage.Key, reservedMessage); 924var reservedSourceAndMessage = new KeyValuePair<ISourceBlock<T>, KeyValuePair<DataflowMessageHeader, T>>(sourceAndMessage.Key, reservedMessage); 996T? consumedValue = sourceAndMessage.Key.ConsumeMessage(sourceAndMessage.Value.Key, _owningBatch, out consumed); 1006var consumedMessage = new KeyValuePair<DataflowMessageHeader, T>(sourceAndMessage.Value.Key, consumedValue!); 1007var consumedSourceAndMessage = new KeyValuePair<ISourceBlock<T>, KeyValuePair<DataflowMessageHeader, T>>(sourceAndMessage.Key, consumedMessage); 1048T? consumedValue = sourceAndMessage.Key.ConsumeMessage(sourceAndMessage.Value.Key, _owningBatch, out consumed); 1051var consumedMessage = new KeyValuePair<DataflowMessageHeader, T>(sourceAndMessage.Value.Key, consumedValue!); 1052var consumedSourceAndMessage = new KeyValuePair<ISourceBlock<T>, KeyValuePair<DataflowMessageHeader, T>>(sourceAndMessage.Key, consumedMessage); 1068if (sourceAndMessage.Key != null) _messages.Enqueue(sourceAndMessage.Value.Value); 1093ISourceBlock<T> source = sourceAndMessage.Key; 1095if (source != null && message.Key.IsValid) 1097try { source.ReleaseReservation(message.Key, _owningBatch); }
Blocks\BroadcastBlock.cs (1)
350T? consumedValue = sourceAndMessage.Key.ConsumeMessage(sourceAndMessage.Value, this, out consumed);
Blocks\BufferBlock.cs (1)
353T? consumedValue = sourceAndMessage.Key.ConsumeMessage(sourceAndMessage.Value, this, out consumed);
Blocks\JoinBlock.cs (12)
524Debug.Assert(_nonGreedy!.ConsumedMessage.Key, "A message must have been consumed by this point."); 554return _nonGreedy!.ConsumedMessage.Key; 620if (next.Key.ReserveMessage(next.Value, this)) 642Debug.Assert(_nonGreedy!.ReservedMessage.Key != null, "This target must have a reserved message"); 645T? consumedValue = _nonGreedy.ReservedMessage.Key.ConsumeMessage(_nonGreedy.ReservedMessage.Value, this, out consumed); 668Debug.Assert(!_nonGreedy.ConsumedMessage.Key, "There must be no other consumed message"); 706T? consumedValue = next.Key.ConsumeMessage(next.Value, this, out consumed); 731_nonGreedy!.ConsumedMessage.Key ? 1 : 0; 756if (_nonGreedy != null && _nonGreedy.ReservedMessage.Key != null) 759try { _nonGreedy.ReservedMessage.Key.ReleaseReservation(_nonGreedy.ReservedMessage.Value, this); } 779Debug.Assert(_nonGreedy == null || _nonGreedy.ReservedMessage.Key == null, 938private int InputCountForDebugger { get { return _messages != null ? _messages.Count : _nonGreedy!.ConsumedMessage.Key ? 1 : 0; } }
Blocks\TransformBlock.cs (4)
178outputItem = transform(messageWithId.Key); 232task = transform(messageWithId.Key); 243Common.StoreDataflowMessageValueIntoExceptionData(caughtException, messageWithId.Key); 288Common.StoreDataflowMessageValueIntoExceptionData(aggregate, messageWithId.Key, targetInnerExceptions: true);
Blocks\TransformManyBlock.cs (5)
176IEnumerable<TOutput> outputItems = transformFunction(messageWithId.Key); 202task = function(messageWithId.Key); 213Common.StoreDataflowMessageValueIntoExceptionData(caughtException, messageWithId.Key); 277Common.StoreDataflowMessageValueIntoExceptionData(exc, messageWithId.Key); 287Common.StoreDataflowMessageValueIntoExceptionData(aggregate, messageWithId.Key, targetInnerExceptions: true);
Blocks\TransformManyBlock.netstandard21.cs (2)
59IAsyncEnumerable<TOutput> outputItems = transformFunction(messageWithId.Key); 71Common.StoreDataflowMessageValueIntoExceptionData(exc, messageWithId.Key);
Internal\Common.cs (3)
519Debug.Assert(sourceAndMessage.Key != null, "Postponed messages must have an associated source."); 520if (sourceAndMessage.Key.ReserveMessage(sourceAndMessage.Value, target)) 522sourceAndMessage.Key.ReleaseReservation(sourceAndMessage.Value, target);
Internal\QueuedMap.cs (5)
80_freeIndex = _storage[_freeIndex].Key; 126int newHeadIndex = _storage[_headIndex].Key; 143for (int idx = _freeIndex; idx != TERMINATOR_INDEX; idx = _storage[idx].Key) 146_storage[index] = new KeyValuePair<int, T>(_storage[index].Key, item); 198if (popped) _mapKeyToIndex.Remove(item.Key);
Internal\ReorderingBuffer.cs (1)
171if (nextOutputItemWithValidity.Key) _outputAction(_owningSource, nextOutputItemWithValidity.Value);
Internal\TargetCore.cs (3)
484Common.StoreDataflowMessageValueIntoExceptionData(exc, messageWithId.Key); 671TInput? consumedValue = element.Key.ConsumeMessage(element.Value, _owningTarget, out consumed); 856internal IEnumerable<TInput> InputQueue { get { return _target._messages.Select(static kvp => kvp.Key).ToList(); } }
System.Threading.Tasks.Parallel (1)
System\Threading\Tasks\Parallel.cs (1)
2643long index = kvp.Key;
System.Windows.Forms (12)
misc\CollectionHelper.cs (4)
38if (kvp.Key is not null) 40dictionaryTarget[index++] = new DictionaryEntry(kvp.Key, kvp.Value); 55if (kvp.Key is not null) 57objects[index++] = new DictionaryEntry(kvp.Key, kvp.Value);
System\Windows\Forms\ComponentModel\COM2Interop\ComNativeDescriptor.cs (2)
198disposeKeys.Add(entry.Key); 309key = entry.Key;
System\Windows\Forms\Components\ErrorProvider\ErrorProvider.cs (1)
500SetError(entry.Key, entry.Value);
System\Windows\Forms\Controls\ComboBox\ComboBox.ACNativeWindow.cs (1)
112toRemove.Add(acNativeWindowByHandle.Key);
System\Windows\Forms\Controls\ListView\ListViewItem.ListViewItemDetailsAccessibleObject.cs (1)
170return keyValuePair.Key;
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\SingleSelectRootGridEntry.cs (1)
271categoryGridEntries.Add(new CategoryGridEntry(OwnerGrid, this, entry.Key, entry.Value));
System\Windows\Forms\Controls\ToolStrips\ToolStripControlHost.StubSite.cs (1)
89return item.Key;
System\Windows\Forms\DataBinding\BindingContext.cs (1)
327cleanupList.Add(de.Key);
System.Windows.Forms.Design (8)
System\ComponentModel\Design\ComponentDesigner.cs (2)
678PropertyDescriptor? newInnerProp = (PropertyDescriptor?)properties[de.Key]; 683properties[de.Key] = inheritedPropDesc;
System\ComponentModel\Design\DesignerHost.Site.cs (1)
58return de.Key;
System\ComponentModel\Design\Serialization\CodeDomComponentSerializationService.CodeDomSerializationStore.ComponentListCodeDomSerializer.cs (1)
189PropertyDescriptor? prop = props[stateEntry.Key];
System\ComponentModel\Design\Serialization\ResourceCodeDomSerializer.SerializationResourceManager.cs (2)
293metaData.TryAdd(item.Key, item.Value); 486resxWriter.AddMetadata(de.Key, de.Value);
System\Resources\Tools\StronglyTypedResourceBuilder.cs (2)
870string key = entry.Key; 931errors.Add(entry.Key);
System.Xaml (37)
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\XmlCompatibilityReader.cs (1)
136keysToUpdate.Add(pair.Key);
System\Xaml\Context\ObjectWriterContext.cs (4)
1000if (allNamesAndValues.Exists(pair => pair.Key == nameValuePair.Key)) 1135if (allNamesAndValues.Exists(pair => pair.Key == nameValuePair.Key))
System\Xaml\Context\XamlCommonFrame.cs (2)
61Namespaces.Add(ns.Key, ns.Value); 82_namespaceDeclarations.Add(new NamespaceDeclaration(kvp.Value, kvp.Key));
System\Xaml\Context\XamlParserContext.cs (2)
114if (keys.Add(kvp.Key)) 116yield return new NamespaceDeclaration(kvp.Value, kvp.Key);
System\Xaml\InfosetObjects\XamlXmlReader.cs (1)
213xmlnsDictionary[ns.Key] = ns.Value;
System\Xaml\MS\Impl\XmlNsInfo.cs (1)
235string clrNsUri = ClrNamespaceUriParser.GetUri(clrToXmlNs.Key, assemblyName);
System\Xaml\NameScope.cs (6)
133if (item.Value != this[item.Key]) 138return Remove(item.Key); 143if (item.Key is null) 153Add(item.Key, item.Value); 158if (item.Key is null) 163return ContainsKey(item.Key);
System\Xaml\Runtime\ClrObjectRuntime.cs (1)
764yield return new DictionaryEntry(enumerator.Current.Key, enumerator.Current.Value);
System\Xaml\Schema\TypeReflector.cs (5)
673getter = candidates[0].Key; 1006string name = nameAndSetterList.Key; 1033string name = nameAndGetterList.Key; 1049string name = nameAndAdderList.Key; 1199listOfNulls.Add(pair.Key);
System\Xaml\Schema\XamlTypeInvoker.cs (1)
191if (contentType.CanAssignTo(pair.Key))
System\Xaml\XamlObjectReader.cs (6)
908throw new InvalidOperationException(SR.Format(SR.AttachedPropertyOnTypeConvertedOrStringProperty, property.Name, value.ToString(), props[0].Key.ToString())); 912throw new InvalidOperationException(SR.Format(SR.AttachedPropertyOnDictionaryKey, value.ToString(), props[0].Key.ToString())); 1875XamlType owningType = context.GetXamlType(ap.Key.DeclaringType); 1881XamlMember attachedProperty = owningType.GetAttachableMember(ap.Key.MemberName); 1885throw new XamlObjectReaderException(SR.Format(SR.ObjectReaderAttachedPropertyNotFound, owningType, ap.Key.MemberName)); 2554new NamespaceDeclaration(pair.Key, pair.Value)));
System\Xaml\XamlSchemaContext.cs (4)
118result.Add(ns.Key); 237if (!prefixDict.TryGetValue(nsToPrefix.Key, out existingPrefix)) 239existingPrefix = TryAdd(prefixDict, nsToPrefix.Key, preferredPrefix); 247existingPrefix = TryUpdate(prefixDict, nsToPrefix.Key, preferredPrefix, existingPrefix);
System\Xaml\XamlXmlWriter.cs (3)
537output.WriteAttributeString("xmlns", pair.Key, null, pair.Value); 775return string.Compare(x.Key, y.Key, false, TypeConverterHelper.InvariantEnglishUS);
TypeScriptApiCompat (2)
AtsCompatibilityComparer.cs (1)
15foreach (var (packageName, baseline) in baselineSet.Surfaces.OrderBy(static pair => pair.Key, StringComparer.Ordinal))
AtsSurfaceParser.cs (1)
114static pair => pair.Key,
UnitTests.Common (1)
TestTypes.cs (1)
308workItem.Key(workItem.Value);
vbc (4)
src\roslyn\src\Compilers\Shared\BuildProtocol.cs (1)
378WriteLengthPrefixedString(writer, pair.Key);
src\roslyn\src\Compilers\Shared\BuildServerConnection.cs (3)
480foreach (var kvp in environmentVariables.OrderBy(kvp => kvp.Key, StringComparer.OrdinalIgnoreCase)) 482envBlock.Append(kvp.Key); 647startInfo.EnvironmentVariables[kvp.Key] = kvp.Value;
VBCSCompiler (4)
src\roslyn\src\Compilers\Shared\BuildProtocol.cs (1)
378WriteLengthPrefixedString(writer, pair.Key);
src\roslyn\src\Compilers\Shared\BuildServerConnection.cs (3)
480foreach (var kvp in environmentVariables.OrderBy(kvp => kvp.Key, StringComparer.OrdinalIgnoreCase)) 482envBlock.Append(kvp.Key); 647startInfo.EnvironmentVariables[kvp.Key] = kvp.Value;
vstest.console (8)
Processors\EnableBlameArgumentProcessor.cs (5)
219?.Where(p => BlameParameterNames.CrashDumpKeys.Contains(p.Key)) 220.ToDictionary(p => p.Key, p => p.Value, StringComparer.OrdinalIgnoreCase) 235?.Where(p => BlameParameterNames.HangDumpKeys.Contains(p.Key)) 236.ToDictionary(p => p.Key, p => p.Value, StringComparer.OrdinalIgnoreCase) 349var attribute = xmlDocument.CreateAttribute(entry.Key);
Processors\Utilities\LoggerUtilities.cs (1)
63var node = xmlDocument.CreateElement(entry.Key);
Publisher\TextFileTelemetryPublisher.cs (1)
70var telemetryData = string.Join(";", metrics.Select(x => x.Key + "=" + x.Value));
TestPlatformHelpers\TestRequestManager.cs (1)
500$"{TelemetryDataConstants.LegacySettingPrefix}.{ciData.Key}",
vstest.console.arm64 (8)
src\vstest\src\vstest.console\Processors\EnableBlameArgumentProcessor.cs (5)
219?.Where(p => BlameParameterNames.CrashDumpKeys.Contains(p.Key)) 220.ToDictionary(p => p.Key, p => p.Value, StringComparer.OrdinalIgnoreCase) 235?.Where(p => BlameParameterNames.HangDumpKeys.Contains(p.Key)) 236.ToDictionary(p => p.Key, p => p.Value, StringComparer.OrdinalIgnoreCase) 349var attribute = xmlDocument.CreateAttribute(entry.Key);
src\vstest\src\vstest.console\Processors\Utilities\LoggerUtilities.cs (1)
63var node = xmlDocument.CreateElement(entry.Key);
src\vstest\src\vstest.console\Publisher\TextFileTelemetryPublisher.cs (1)
70var telemetryData = string.Join(";", metrics.Select(x => x.Key + "=" + x.Value));
src\vstest\src\vstest.console\TestPlatformHelpers\TestRequestManager.cs (1)
500$"{TelemetryDataConstants.LegacySettingPrefix}.{ciData.Key}",
WindowsFormsIntegration (2)
System\Windows\Integration\PropertyMap.cs (2)
171Apply(entry.Key); 279Add(entry.Key, entry.Value);