6217 references to Key
AnalyzerRunner (18)
CodeRefactoringRunner.cs (1)
156pair => pair.Key,
DiagnosticAnalyzerRunner.cs (16)
126var sumOfDocumentAverages = documentPerformance.Where(x => x.Key.ProjectId == projectId).Sum(x => x.Value.EditsPerSecond); 127double documentCount = documentPerformance.Where(x => x.Key.ProjectId == projectId).Count(); 134var slowestFiles = documentPerformance.OrderBy(pair => pair.Value.EditsPerSecond).GroupBy(pair => pair.Key.ProjectId); 141var document = solution.GetDocument(pair.Key); 235pair => pair.Key, 295.ToLookup(analyzers => analyzers.Key, analyzers => analyzers.Value) 356if (projectDiagnosticBuilder.TryGetValue(task.Key, out var previousResult)) 360result.AnalyzerTelemetryInfo[pair.Key].ExecutionTime += pair.Value.ExecutionTime; 364projectDiagnosticBuilder[task.Key] = result; 419if (!telemetryInfoDictionary.TryGetValue(pair.Key, out var telemetry)) 421telemetryInfoDictionary.Add(pair.Key, pair.Value); 430foreach (var pair in telemetryInfoDictionary.OrderBy(x => x.Key.GetType().Name, StringComparer.OrdinalIgnoreCase)) 432WriteTelemetry(pair.Key.GetType().Name, pair.Value); 436var longestAnalyzerName = telemetryInfoDictionary.Select(x => x.Key.GetType().Name.Length).Max(); 437foreach (var pair in telemetryInfoDictionary.OrderBy(x => x.Key.GetType().Name, StringComparer.OrdinalIgnoreCase)) 439WriteExecutionTimes(pair.Key.GetType().Name, longestAnalyzerName, pair.Value);
Program.cs (1)
170Console.WriteLine($" {pair.Value.severity} {pair.Key}: {pair.Value.count} instances ({pair.Value.description})");
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.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 (20)
Components\Controls\Chart\ChartBase.cs (2)
168foreach (var trace in traces.OrderBy(kvp => kvp.Key)) 276var percentileValue = CalculatePercentile(percentileValues.Key, currentBucketCounts!, explicitBounds!);
Components\Controls\Chart\MetricTable.razor.cs (1)
123var previousMetric = newMetrics.LastOrDefault(dt => dt.Key < xValue).Value;
Otlp\Model\OtlpApplication.cs (3)
321if (!string.Equals(x[i].Key, y[i].Key, StringComparisons.OtlpAttribute)) 339hashCode.Add(StringComparers.OtlpAttribute.GetHashCode(obj[i].Key));
Otlp\Model\OtlpApplicationView.cs (4)
37Array.Sort(properties, (p1, p2) => string.Compare(p1.Key, p2.Key, StringComparisons.OtlpAttribute)); 52props.Add(new OtlpDisplayField { DisplayName = kv.Key, Key = $"unknown-{kv.Key}", Value = kv.Value });
Otlp\Model\OtlpHelpers.cs (4)
248if (values[i].Key == name) 336if (values[i].Key == name) 379if (values[i].Key == name) 398sb.Append(CultureInfo.InvariantCulture, $"{kv.Key}: ");
Otlp\Model\OtlpInstrument.cs (4)
68var keys = KnownAttributeValues.Keys.Union(durableAttributes.Select(a => a.Key)).Distinct(); 136hashcode.Add(pair.Key); 149return string.Compare(x.Key, y.Key, StringComparison.Ordinal);
Otlp\Storage\TelemetryRepository.cs (2)
108if (kvp.Key.EqualsCompositeName(compositeName)) 364_logPropertyKeys.Add((applicationView.Application, kvp.Key));
Aspire.Dashboard.Components.Tests (9)
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)
52scope.Attributes.Add(new KeyValue { Key = attribute.Key, Value = new AnyValue { StringValue = attribute.Value } }); 115point.Attributes.Add(new KeyValue { Key = attribute.Key, Value = new AnyValue { StringValue = attribute.Value } }); 140e.Attributes.Add(new KeyValue { Key = attribute.Key, Value = new AnyValue { StringValue = attribute.Value } }); 170span.Attributes.Add(new KeyValue { Key = attribute.Key, Value = new AnyValue { StringValue = attribute.Value } }); 193logRecord.Attributes.Add(new KeyValue { Key = attribute.Key, Value = new AnyValue { StringValue = attribute.Value } }); 214resource.Attributes.Add(new KeyValue { Key = attribute.Key, Value = new AnyValue { StringValue = attribute.Value } });
Aspire.Dashboard.Tests (89)
Integration\FrontendBrowserTokenAuthTests.cs (1)
268return list?.SingleOrDefault(kvp => kvp.Key == key).Value;
Integration\ResponseCompressionTests.cs (2)
32Assert.DoesNotContain(response.Content.Headers, h => h.Key == "Content-Encoding"); 54Assert.Contains(response.Content.Headers, h => h.Key == "Content-Encoding" && h.Value.Contains("br"));
Integration\StartupTests.cs (2)
595return list?.SingleOrDefault(kvp => kvp.Key == key).Value; 677return list?.SingleOrDefault(kvp => kvp.Key == key).Value;
Model\ResourceViewModelTests.cs (3)
102viewModel.Properties.OrderBy(p => p.Key), 105Assert.Equal("Property1", p.Key); 115Assert.Equal("Property2", p.Key);
TelemetryRepositoryTests\LogTests.cs (10)
84Assert.Equal("Log", p.Key); 676Assert.Equal("Key0", p.Key); 681Assert.Equal("Key1", p.Key); 686Assert.Equal("Key2", p.Key); 691Assert.Equal("Key3", p.Key); 696Assert.Equal("Key4", p.Key); 896Assert.Equal("Log", p.Key); 919Assert.Equal("Log", p.Key); 992Assert.Equal("key-1", p.Key); 1003Assert.Equal("key-2", p.Key);
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)
580Assert.Equal("key1", a.Key); 658Assert.Equal("key2", a.Key); 669Assert.Equal("key1", a.Key); 683Assert.Equal("key2", a.Key); 694Assert.Equal("key1", a.Key); 827Assert.Equal("Key0", p.Key); 832Assert.Equal("Key1", p.Key); 837Assert.Equal("Key2", p.Key); 842Assert.Equal("Key3", p.Key); 847Assert.Equal("Key4", p.Key); 1489Assert.Equal("prop1", p.Key); 1498Assert.Equal("prop1", p.Key); 1503Assert.Equal("prop2", p.Key); 1525Assert.Equal("prop1", p.Key); 1535Assert.Equal("prop1", p.Key); 1540Assert.Equal("prop2", p.Key); 1550Assert.Equal("prop1", p.Key); 1555Assert.Equal("prop2", p.Key);
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)
52scope.Attributes.Add(new KeyValue { Key = attribute.Key, Value = new AnyValue { StringValue = attribute.Value } }); 115point.Attributes.Add(new KeyValue { Key = attribute.Key, Value = new AnyValue { StringValue = attribute.Value } }); 140e.Attributes.Add(new KeyValue { Key = attribute.Key, Value = new AnyValue { StringValue = attribute.Value } }); 170span.Attributes.Add(new KeyValue { Key = attribute.Key, Value = new AnyValue { StringValue = attribute.Value } }); 193logRecord.Attributes.Add(new KeyValue { Key = attribute.Key, Value = new AnyValue { StringValue = attribute.Value } }); 214resource.Attributes.Add(new KeyValue { Key = attribute.Key, Value = new AnyValue { StringValue = attribute.Value } });
Aspire.Elastic.Clients.Elasticsearch.Tests (2)
AspireElasticClientExtensionsTest.cs (2)
63Assert.Contains(healthCheckReport.Entries, x => x.Key == healthCheckName); 166Assert.Contains(activity.Tags, kvp => kvp.Key == "db.system" && kvp.Value == "elasticsearch");
Aspire.EndToEnd.Tests (4)
tests\Shared\WorkloadTesting\AspireProject.cs (2)
173AppHostProcess.StartInfo.Environment[item.Key] = item.Value; 174_testOutput.WriteLine($"\t[{item.Key}] = {item.Value}");
tests\Shared\WorkloadTesting\ToolCommand.cs (2)
249_testOutput.WriteLine($"{_msgPrefix}\t[{item.Key}] = {item.Value}"); 250psi.Environment[item.Key] = item.Value;
Aspire.Hosting (7)
ApplicationModel\ResourceLoggerService.cs (1)
32value((logger.Key, logger.Value));
ApplicationModel\ResourceNotificationService.cs (2)
399var (resource, resourceId) = state.Key; 403versionsSeen[state.Key] = snapshot.Version;
Devcontainers\DevcontainerSettingsWriter.cs (1)
96let forwardedPort = props.Key
ProjectResourceBuilderExtensions.cs (1)
474context.EnvironmentVariables.TryAdd(envVar.Key, value);
src\Shared\SecretsStore.cs (2)
56contents[secret.Key] = secret.Value; 91.ToDictionary(i => i.Key, i => i.Value, StringComparer.OrdinalIgnoreCase);
Aspire.Hosting.Analyzers (2)
AppHostAnalyzer.DetectInvalidModelNames.cs (2)
22var modelTypes = operation.Key.ModelTypes; 23var token = operation.Key.ModelNameToken;
Aspire.Hosting.Azure (3)
AzureProvisioningResource.cs (2)
119if (distinctInfrastructureParametersLookup.ContainsKey(aspireParameter.Key)) 125var parameter = new ProvisioningParameter(aspireParameter.Key, typeof(string)) { IsSecure = isSecure };
Provisioning\Provisioners\BicepProvisioner.cs (1)
68resource.Outputs[item.Key] = item.Value?.Prop("value").ToString();
Aspire.Hosting.Azure.AppContainers (3)
AzureContainerAppsInfrastructure.cs (3)
493var secretName = kv.Key.Replace("_", "-").ToLowerInvariant(); 520SecretType.None => new ContainerAppEnvironmentVariable { Name = kv.Key, Value = argValue }, 521SecretType.Normal or SecretType.KeyVault => new ContainerAppEnvironmentVariable { Name = kv.Key, SecretRef = (string)val },
Aspire.Hosting.Azure.ServiceBus (1)
ServiceBusRule.cs (1)
59rule.CorrelationFilter.ApplicationProperties[property.Key] = property.Value;
Aspire.Hosting.Azure.Sql (4)
AzureSqlExtensions.cs (4)
170if (!azureDatabases.TryGetValue(database.Key, out var existingDb)) 172throw new InvalidOperationException($"Could not find a {nameof(AzureSqlDatabaseResource)} with name {database.Key}."); 175var innerDb = sqlContainer.AddDatabase(database.Key, database.Value); 264var bicepIdentifier = Infrastructure.NormalizeBicepIdentifier(databaseNames.Key);
Aspire.Hosting.Elasticsearch.Tests (6)
AddElasticsearchTests.cs (6)
60Assert.Equal("discovery.type", env.Key); 65Assert.Equal("xpack.security.enabled", env.Key); 70Assert.Equal("ELASTIC_PASSWORD", env.Key); 121Assert.Equal("discovery.type", env.Key); 126Assert.Equal("xpack.security.enabled", env.Key); 131Assert.Equal("ELASTIC_PASSWORD", env.Key);
Aspire.Hosting.Kafka.Tests (2)
AddKafkaTests.cs (2)
127Assert.Contains(config, kvp => kvp.Key == "KAFKA_LOG_DIRS" && kvp.Value == "/var/lib/kafka/data"); 145Assert.Contains(config, kvp => kvp.Key == "KAFKA_LOG_DIRS" && kvp.Value == "/var/lib/kafka/data");
Aspire.Hosting.Milvus.Tests (2)
AddMilvusTests.cs (2)
111Assert.Contains(config, kvp => kvp.Key == "ConnectionStrings__my-milvus" && kvp.Value == "Endpoint=http://localhost:19530;Key=root:pass"); 122Assert.Contains(containerConfig, kvp => kvp.Key == "ConnectionStrings__my-milvus" && kvp.Value == "Endpoint=http://my-milvus:19530;Key=root:pass");
Aspire.Hosting.MongoDB.Tests (5)
AddMongoDBTests.cs (5)
154Assert.Equal("ME_CONFIG_MONGODB_SERVER", e.Key); 159Assert.Equal("ME_CONFIG_MONGODB_PORT", e.Key); 164Assert.Equal("ME_CONFIG_BASICAUTH", e.Key); 169Assert.Equal("ME_CONFIG_MONGODB_ADMINUSERNAME", e.Key); 174Assert.Equal("ME_CONFIG_MONGODB_ADMINPASSWORD", e.Key);
Aspire.Hosting.MySql.Tests (2)
AddMySqlTests.cs (2)
68Assert.Equal("MYSQL_ROOT_PASSWORD", env.Key); 107Assert.Equal("MYSQL_ROOT_PASSWORD", env.Key);
Aspire.Hosting.Oracle.Tests (3)
AddOracleTests.cs (3)
67Assert.Equal("ORACLE_PWD", env.Key); 106Assert.Equal("ORACLE_PWD", env.Key); 188Assert.Equal("ORACLE_PWD", env.Key);
Aspire.Hosting.PostgreSQL.Tests (12)
AddPostgresTests.cs (12)
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); 222Assert.Equal("POSTGRES_HOST_AUTH_METHOD", env.Key); 227Assert.Equal("POSTGRES_INITDB_ARGS", env.Key); 232Assert.Equal("POSTGRES_USER", env.Key); 237Assert.Equal("POSTGRES_PASSWORD", env.Key);
Aspire.Hosting.Qdrant.Tests (6)
AddQdrantTests.cs (6)
72Assert.Equal("QDRANT__SERVICE__API_KEY", env.Key); 144Assert.Equal("QDRANT__SERVICE__API_KEY", env.Key); 185Assert.Contains(config, kvp => kvp.Key == "ConnectionStrings__my-qdrant" && kvp.Value == "Endpoint=http://localhost:6334;Key=pass"); 186Assert.Contains(config, kvp => kvp.Key == "ConnectionStrings__my-qdrant_http" && kvp.Value == "Endpoint=http://localhost:6333;Key=pass"); 197Assert.Contains(containerConfig, kvp => kvp.Key == "ConnectionStrings__my-qdrant" && kvp.Value == "Endpoint=http://my-qdrant:6334;Key=pass"); 198Assert.Contains(containerConfig, kvp => kvp.Key == "ConnectionStrings__my-qdrant_http" && kvp.Value == "Endpoint=http://my-qdrant:6333;Key=pass");
Aspire.Hosting.SqlServer.Tests (2)
AddSqlServerTests.cs (2)
68Assert.Equal("ACCEPT_EULA", env.Key); 73Assert.Equal("MSSQL_SA_PASSWORD", env.Key);
Aspire.Hosting.Testing (5)
DistributedApplicationEntryPointInvoker.cs (5)
184if (value.Key == "DistributedApplicationBuilderConstructing") 190if (value.Key == "DistributedApplicationBuilderConstructed") 195if (value.Key == "DistributedApplicationBuilding") 200if (value.Key == "DistributedApplicationBuilt") 277if (value.Key == "DistributedApplicationBuilderConstructing")
Aspire.Hosting.Testing.Tests (3)
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 (56)
Dashboard\DashboardResourceTests.cs (19)
112Assert.Equal("ASPNETCORE_ENVIRONMENT", e.Key); 117Assert.Equal("ASPNETCORE_URLS", e.Key); 122Assert.Equal("DOTNET_RESOURCE_SERVICE_ENDPOINT_URL", e.Key); 127Assert.Equal("DOTNET_DASHBOARD_OTLP_ENDPOINT_URL", e.Key); 132Assert.Equal("DASHBOARD__FRONTEND__AUTHMODE", e.Key); 137Assert.Equal("DASHBOARD__RESOURCESERVICECLIENT__AUTHMODE", e.Key); 142Assert.Equal("DASHBOARD__OTLP__AUTHMODE", e.Key); 147Assert.Equal("LOGGING__CONSOLE__FORMATTERNAME", e.Key); 213Assert.Equal("BrowserToken", config.Single(e => e.Key == DashboardConfigNames.DashboardFrontendAuthModeName.EnvVarName).Value); 214Assert.Equal("TestBrowserToken!", config.Single(e => e.Key == DashboardConfigNames.DashboardFrontendBrowserTokenName.EnvVarName).Value); 216Assert.Equal("ApiKey", config.Single(e => e.Key == DashboardConfigNames.DashboardOtlpAuthModeName.EnvVarName).Value); 217Assert.Equal("TestOtlpApiKey!", config.Single(e => e.Key == DashboardConfigNames.DashboardOtlpPrimaryApiKeyName.EnvVarName).Value); 248Assert.Equal("Unsecured", config.Single(e => e.Key == DashboardConfigNames.DashboardFrontendAuthModeName.EnvVarName).Value); 249Assert.Equal("Unsecured", config.Single(e => e.Key == DashboardConfigNames.DashboardOtlpAuthModeName.EnvVarName).Value); 280Assert.Equal("http://localhost:5000", config.Single(e => e.Key == DashboardConfigNames.ResourceServiceUrlName.EnvVarName).Value); 322Assert.Equal(expectedAllowedOrigins, config.Single(e => e.Key == DashboardConfigNames.DashboardOtlpCorsAllowedOriginsKeyName.EnvVarName).Value); 323Assert.Equal("*", config.Single(e => e.Key == DashboardConfigNames.DashboardOtlpCorsAllowedHeadersKeyName.EnvVarName).Value); 359Assert.DoesNotContain(config, e => e.Key == DashboardConfigNames.DashboardOtlpCorsAllowedOriginsKeyName.EnvVarName); 360Assert.DoesNotContain(config, e => e.Key == DashboardConfigNames.DashboardOtlpCorsAllowedHeadersKeyName.EnvVarName);
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);
ProjectResourceTests.cs (17)
83Assert.Equal("OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EXCEPTION_LOG_ATTRIBUTES", env.Key); 88Assert.Equal("OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EVENT_LOG_ATTRIBUTES", env.Key); 93Assert.Equal("OTEL_DOTNET_EXPERIMENTAL_OTLP_RETRY", env.Key); 98Assert.Equal("OTEL_DOTNET_EXPERIMENTAL_ASPNETCORE_DISABLE_URL_QUERY_REDACTION", env.Key); 103Assert.Equal("OTEL_DOTNET_EXPERIMENTAL_HTTPCLIENT_DISABLE_URL_QUERY_REDACTION", env.Key); 108Assert.Equal("OTEL_EXPORTER_OTLP_ENDPOINT", env.Key); 113Assert.Equal("OTEL_EXPORTER_OTLP_PROTOCOL", env.Key); 118Assert.Equal("OTEL_RESOURCE_ATTRIBUTES", env.Key); 123Assert.Equal("OTEL_SERVICE_NAME", env.Key); 128Assert.Equal("OTEL_EXPORTER_OTLP_HEADERS", env.Key); 135Assert.Equal("OTEL_BLRP_SCHEDULE_DELAY", env.Key); 140Assert.Equal("OTEL_BSP_SCHEDULE_DELAY", env.Key); 145Assert.Equal("OTEL_METRIC_EXPORT_INTERVAL", env.Key); 150Assert.Equal("OTEL_TRACES_SAMPLER", env.Key); 155Assert.Equal("OTEL_METRICS_EXEMPLAR_FILTER", env.Key); 160Assert.Equal("DOTNET_SYSTEM_CONSOLE_ALLOW_ANSI_COLOR_REDIRECTION", env.Key); 165Assert.Equal("LOGGING__CONSOLE__FORMATTERNAME", env.Key);
ResourceExtensionsTests.cs (8)
181Assert.Equal("discovery.type", env.Key); 186Assert.Equal("xpack.security.enabled", env.Key); 191Assert.Equal("ELASTIC_PASSWORD", env.Key); 214Assert.Equal("discovery.type", env.Key); 219Assert.Equal("xpack.security.enabled", env.Key); 224Assert.Equal("ELASTIC_PASSWORD", env.Key); 247Assert.Equal("discovery.type", env.Key); 252Assert.Equal("xpack.security.enabled", env.Key);
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);
WithEnvironmentTests.cs (3)
233Assert.Equal("TARGET_PORT", pair.Key); 257Assert.Single(runConfig, kvp => kvp.Key == envVarName && kvp.Value == sourceCon); 263Assert.Single(publishConfig, kvp => kvp.Key == envVarName && kvp.Value == "{sourceService.connectionString}");
WithReferenceTests.cs (1)
300Assert.Contains(config, kvp => kvp.Key == "services__petstore__default__0" && kvp.Value == "https://petstore.swagger.io/");
Aspire.Microsoft.Data.SqlClient (2)
src\Vendoring\OpenTelemetry.Instrumentation.SqlClient\Shared\DiagnosticSourceInstrumentation\DiagnosticSourceListener.cs (2)
42this.handler.OnEventWritten(value.Key, value.Value); 46this.logUnknownException?.Invoke(this.handler?.SourceName, value.Key, ex);
Aspire.Microsoft.EntityFrameworkCore.SqlServer (2)
src\Vendoring\OpenTelemetry.Instrumentation.SqlClient\Shared\DiagnosticSourceInstrumentation\DiagnosticSourceListener.cs (2)
42this.handler.OnEventWritten(value.Key, value.Value); 46this.logUnknownException?.Invoke(this.handler?.SourceName, value.Key, ex);
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.v3.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)
175Assert.Contains(healthCheckReport.Entries, x => x.Key == healthCheckName); 231Assert.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 (3)
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)
140Assert.Equal("exception.type", errorEvent[0].Key); 143Assert.Equal("exception.message", errorEvent[1].Key); 146Assert.Equal("exception.stacktrace", errorEvent[2].Key); 186Assert.Equal("exception.type", errorEvent[0].Key); 189Assert.Equal("exception.message", errorEvent[1].Key); 192Assert.Equal("exception.stacktrace", errorEvent[2].Key); 195Assert.Equal("exception.innerexception", errorEvent[3].Key);
Aspire.RabbitMQ.Client.v7.Tests (7)
tests\Aspire.RabbitMQ.Client.Tests\AspireRabbitMQLoggingTests.cs (7)
140Assert.Equal("exception.type", errorEvent[0].Key); 143Assert.Equal("exception.message", errorEvent[1].Key); 146Assert.Equal("exception.stacktrace", errorEvent[2].Key); 186Assert.Equal("exception.type", errorEvent[0].Key); 189Assert.Equal("exception.message", errorEvent[1].Key); 192Assert.Equal("exception.stacktrace", errorEvent[2].Key); 195Assert.Equal("exception.innerexception", errorEvent[3].Key);
Aspire.StackExchange.Redis (2)
src\Vendoring\OpenTelemetry.Instrumentation.StackExchangeRedis\StackExchangeRedisConnectionInstrumentation.cs (2)
123this.Cache.TryRemove((entry.Key.TraceId, entry.Key.SpanId), out _);
Aspire.StackExchange.Redis.DistributedCaching.Tests (3)
DistributedCacheConformanceTests.cs (3)
73Assert.Contains(activity.Tags, kvp => kvp.Key == "db.system" && kvp.Value == "redis"); 78Assert.Contains(activity.Tags, kvp => kvp.Key == "db.system" && kvp.Value == "redis"); 83Assert.Contains(activity.Tags, kvp => kvp.Key == "db.system" && kvp.Value == "redis");
Aspire.StackExchange.Redis.OutputCaching.Tests (3)
OutputCacheConformanceTests.cs (3)
73Assert.Contains(activity.Tags, kvp => kvp.Key == "db.system" && kvp.Value == "redis"); 78Assert.Contains(activity.Tags, kvp => kvp.Key == "db.system" && kvp.Value == "redis"); 83Assert.Contains(activity.Tags, kvp => kvp.Key == "db.system" && kvp.Value == "redis");
Aspire.StackExchange.Redis.Tests (1)
AspireRedisExtensionsTests.cs (1)
295Assert.Contains(activity.Tags, kvp => kvp.Key == "db.system" && kvp.Value == "redis");
Aspire.Workload.Tests (4)
tests\Shared\WorkloadTesting\AspireProject.cs (2)
173AppHostProcess.StartInfo.Environment[item.Key] = item.Value; 174_testOutput.WriteLine($"\t[{item.Key}] = {item.Value}");
tests\Shared\WorkloadTesting\ToolCommand.cs (2)
249_testOutput.WriteLine($"{_msgPrefix}\t[{item.Key}] = {item.Value}"); 250psi.Environment[item.Key] = item.Value;
AuthSamples.FunctionalTests (4)
HttpClientExtensions.cs (3)
36var element = Assert.IsAssignableFrom<IHtmlInputElement>(form[kvp.Key]); 54if (!submision.Headers.TryAddWithoutValidation(header.Key, header.Value)) 56submision.Content.Headers.TryAddWithoutValidation(header.Key, header.Value);
TestAssert.cs (1)
99htmlResponse.Header(header.Key, value);
AzureAppServicesHostingStartupSample (1)
Startup.cs (1)
42await context.Response.WriteAsync(header.Key + ": " + header.Value + Environment.NewLine);
AzureAppServicesSample (1)
Startup.cs (1)
53await context.Response.WriteAsync(header.Key + ": " + header.Value + Environment.NewLine);
BasicWebSite (4)
src\Mvc\test\WebSites\Common\TestResponseGenerator.cs (4)
31.Where(kvp => kvp.Key != "link" && kvp.Key != "link_action" && kvp.Key != "link_controller") 32.ToDictionary(kvp => kvp.Key.Substring("link_".Length), kvp => (object)kvp.Value[0]);
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);
BuildBoss (3)
SolutionCheckerUtil.cs (1)
57solutionMap.Add(pair.Key, pair.Value.ProjectData);
StructuredLoggerCheckerUtil.cs (2)
37if (doubleWrites.Any(doubleWrite => Path.GetFileName(doubleWrite.Key) != "Microsoft.VisualStudio.Text.Internal.dll")) 41textWriter.WriteLine($"Multiple writes to {doubleWrite.Key}");
BuildValidator (1)
Program.cs (1)
395var (key, value) = (entry.Key, entry.Value); // TODO: use Deconstruct in .NET Core
Client.ClientBase.IntegrationTests (1)
ClientBaseTestHelpers.cs (1)
21string headerFullName = keyValue.Key;
ConfigurationSchemaGenerator (2)
ConfigSchemaEmitter.cs (2)
749obj.OrderBy(p => p.Key, StringComparer.Ordinal) : 754writer.WritePropertyName(pair.Key);
CookiePolicySample (1)
Startup.cs (1)
108await response.WriteAsync($" - {cookie.Key} = {cookie.Value} <br>\r\n");
DefaultBuilder.SampleApp (1)
Startup.cs (1)
25await context.Response.WriteAsync($"{header.Key}: {header.Value}\r\n");
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)
663invalidNamespaces.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)
960if (!this.GlobalProperties.Any(p => p.Key == "TargetFramework")) 965if (!this.GlobalProperties.Any(p => p.Key == "SdkVersion")) 972var propertyTable = this._resolvedProperties.Where(p => propertyNames.Contains(p.Key)); 980this._resolvedProperties[entry.Key] = entry.Value; 985return 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 (3)
Commands\CreateCommand.cs (1)
216optionsString += $"{Resources.JwtPrint_CustomClaims}: [{string.Join(", ", claims.Select(kvp => $"{kvp.Key}={kvp.Value}"))}]{Environment.NewLine}";
Helpers\DevJwtCliHelpers.cs (1)
201: 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)
Internal\ListCommand.cs (2)
49context.Reporter.Output(Resources.FormatMessage_Secret_Value_Format(secret.Key, secret.Value)); 59jObject[item.Key] = item.Value;
Internal\SecretsStore.cs (2)
78contents[secret.Key] = secret.Value; 99.ToDictionary(i => i.Key, i => i.Value, StringComparer.OrdinalIgnoreCase);
Internal\SetCommand.cs (1)
78context.SecretStore.Set(k.Key, k.Value);
FilesWebSite (1)
Controllers\UploadFilesController.cs (1)
35files.Add(keyValuePair.Key, keyValuePair.Value?.Select(formFile => formFile?.FileName).ToList());
GenerateRulesMissingDocumentation (1)
Program.cs (1)
60string ruleId = ruleById.Key;
GenericHostWebSite (4)
src\Mvc\test\WebSites\Common\TestResponseGenerator.cs (4)
31.Where(kvp => kvp.Key != "link" && kvp.Key != "link_action" && kvp.Key != "link_controller") 32.ToDictionary(kvp => kvp.Key.Substring("link_".Length), kvp => (object)kvp.Value[0]);
GetDocument.Insider (2)
.packages\microsoft.extensions.hostfactoryresolver.sources\10.0.0-preview.2.25107.7\contentFiles\cs\netstandard2.0\HostFactoryResolver.cs (2)
331if (value.Key == "HostBuilding") 336if (value.Key == "HostBuilt")
HeaderPropagationSample (3)
Startup.cs (3)
67await context.Response.WriteAsync($"'/' Got Header '{header.Key}': {string.Join(", ", (string[])header.Value)}\r\n"); 81await context.Response.WriteAsync($"Sent Header '{header.Key}': {string.Join(", ", header.Value)}\r\n"); 93await context.Response.WriteAsync($"'/forwarded' Got Header '{header.Key}': {string.Join(", ", (string[])header.Value)}\r\n");
HealthChecksSample (2)
CustomWriterStartup.cs (2)
48new JProperty(pair.Key, new JObject( 51new JProperty("data", new JObject(pair.Value.Data.Select(p => new JProperty(p.Key, p.Value))))))))));
http2cat (3)
Program.cs (2)
50h2Connection.Logger.LogInformation($"{header.Key}: {header.Value}"); 74h2Connection.Logger.LogInformation($"{header.Key}: {header.Value}");
src\Shared\Http2cat\HPackHeaderWriter.cs (1)
64if (!EncodeHeader(headersEnumerator.Current.Key, headersEnumerator.Current.Value, buffer.Slice(currentLength), out int headerLength))
HttpLogging.Sample (2)
SampleHttpLoggingInterceptor.cs (2)
43logContext.AddParameter(header.Key, "RedactedHeader"); // TODO: Redact header value 51logContext.AddParameter(header.Key, "RedactedHeader"); // TODO: Redact header value
HttpOverridesSample (1)
Startup.cs (1)
23await context.Response.WriteAsync($"{header.Key}: {header.Value}\r\n");
IIS.FunctionalTests (2)
src\Servers\IIS\IIS\test\Common.FunctionalTests\RequestResponseTests.cs (1)
585Assert.DoesNotContain(response.Headers, h => h.Key.Equals("transfer-encoding", StringComparison.InvariantCultureIgnoreCase));
src\Shared\Http2cat\HPackHeaderWriter.cs (1)
64if (!EncodeHeader(headersEnumerator.Current.Key, headersEnumerator.Current.Value, buffer.Slice(currentLength), out int headerLength))
IIS.LongTests (1)
src\Shared\Http2cat\HPackHeaderWriter.cs (1)
64if (!EncodeHeader(headersEnumerator.Current.Key, headersEnumerator.Current.Value, buffer.Slice(currentLength), out int headerLength))
IIS.NewHandler.FunctionalTests (1)
src\Shared\Http2cat\HPackHeaderWriter.cs (1)
64if (!EncodeHeader(headersEnumerator.Current.Key, headersEnumerator.Current.Value, buffer.Slice(currentLength), out int headerLength))
IIS.NewShim.FunctionalTests (1)
src\Shared\Http2cat\HPackHeaderWriter.cs (1)
64if (!EncodeHeader(headersEnumerator.Current.Key, headersEnumerator.Current.Value, buffer.Slice(currentLength), out int headerLength))
IISExpress.FunctionalTests (2)
src\Servers\IIS\IIS\test\Common.FunctionalTests\RequestResponseTests.cs (1)
585Assert.DoesNotContain(response.Headers, h => h.Key.Equals("transfer-encoding", StringComparison.InvariantCultureIgnoreCase));
src\Shared\Http2cat\HPackHeaderWriter.cs (1)
64if (!EncodeHeader(headersEnumerator.Current.Key, headersEnumerator.Current.Value, buffer.Slice(currentLength), out int headerLength))
IISSample (1)
Startup.cs (1)
69await context.Response.WriteAsync(header.Key + ": " + header.Value + Environment.NewLine);
illink (13)
ILLink.RoslynAnalyzer (9)
DataFlow\LValueFlowCaptureProvider.cs (1)
78 var captureId = kvp.Key;
ISymbolExtensions.cs (1)
220 if (namedArgument.Key == "EntryPoint")
RequiresAnalyzerBase.cs (1)
280 var url = requiresAttribute?.NamedArguments.FirstOrDefault (na => na.Key == "Url").Value.Value?.ToString ();
src\tools\illink\src\ILLink.Shared\DataFlow\DefaultValueDictionary.cs (3)
62 if (!Get (kvp.Key).Equals (kvp.Value)) 86 sb.AppendLine().Append ('\t').Append (kvp.Key.ToString ()).Append (" -> ").Append (kvp.Value.ToString ()); 101 var key = kvp.Key;
src\tools\illink\src\ILLink.Shared\DataFlow\DictionaryLattice.cs (1)
31 TKey key = kvp.Key;
TrimAnalysis\ArrayValue.cs (2)
61 if (!otherArr.IndexValues.TryGetValue (kvp.Key, out MultiValue value) || !kvp.Value.Equals (value)) 81 newArray.IndexValues.Add (kvp.Key, kvp.Value.DeepCopy ());
ILLink.Tasks (3)
CreateRuntimeRootDescriptorFile.cs (3)
312 foreach ((var fs, var members) in featureSwitchMembers.Select (kv => (kv.Key, kv.Value))) { 335 AddXmlTypeNode (doc, featureAssemblyNode, type.Key, type.Value); 344 AddXmlTypeNode (doc, assemblyNode, type.Key, type.Value);
InMemory.FunctionalTests (36)
BadHttpRequestTests.cs (1)
334eventProviderName = pair.Key;
Http2\Http2ConnectionTests.cs (5)
2249Assert.False(_receivedHeaders.ContainsKey(header.Key)); 2250Assert.True(_receivedTrailers.ContainsKey(header.Key)); 2251Assert.Equal(header.Value, _receivedTrailers[header.Key]); 6072var headers = requestHeaders.Concat(new[] { new KeyValuePair<string, string>(headerField.Key, headerField.Value) }); 6129foreach (var headerField in requestHeaders.Where(h => h.Key.StartsWith(':')))
Http2\Http2TestBase.cs (12)
164internal Dictionary<string, object> ConnectionTags => _metricsTagsFeature.Tags.ToDictionary(t => t.Key, t => t.Value); 198_receivedHeaders[header.Key] = header.Value.ToString(); 224_receivedHeaders[header.Key] = header.Value.ToString(); 231_receivedTrailers[header.Key] = header.Value.ToString(); 984.GroupBy(g => g.Key) 1354if (header.Key == InternalHeaderNames.Method) 1358else if (header.Key == InternalHeaderNames.Authority) 1360Assert.True(_receivedHeaders.TryGetValue(HeaderNames.Host, out var host), header.Key); 1363else if (header.Key == InternalHeaderNames.Scheme) 1367else if (header.Key == InternalHeaderNames.Path) 1373Assert.True(_receivedHeaders.TryGetValue(header.Key, out var value), header.Key);
Http3\Http3ConnectionTests.cs (2)
375Assert.Equal((long)Http3SettingType.MaxFieldSectionSize, kvp.Key); 387Assert.Equal(Http3SettingType.MaxFieldSectionSize, maxFieldSetting.Key);
Http3\Http3StreamTests.cs (3)
2200var headers = requestHeaders.Concat(new[] { new KeyValuePair<string, string>(headerField.Key, headerField.Value) }); 2235foreach (var headerField in requestHeaders.Where(h => h.Key.StartsWith(':'))) 2801Assert.Equal(Core.Internal.Http3.Http3SettingType.MaxFieldSectionSize, maxFieldSetting.Key);
src\Servers\Kestrel\shared\ConnectionCompletion.cs (2)
28var task = entry.Key.Invoke(entry.Value); 58await entry.Key.Invoke(entry.Value);
src\Servers\Kestrel\shared\HPackHeaderWriter.cs (1)
124var name = headersEnumerator.Current.Key;
src\Servers\Kestrel\shared\Http2HeadersEnumerator.cs (3)
87if (_hasMultipleValues && MoveNextOnStringEnumerator(Current.Key)) 108? SetCurrent(_genericEnumerator.Current.Key, _genericEnumerator.Current.Value, GetKnownRequestHeaderType(_genericEnumerator.Current.Key))
src\Servers\Kestrel\shared\test\Http3\Http3InMemory.cs (4)
96internal Dictionary<string, object> ConnectionTags => MultiplexedConnectionContext.Tags.ToDictionary(t => t.Key, t => t.Value); 714.GroupBy(g => g.Key) 743return _headerHandler.DecodedHeaders.ToDictionary(kvp => kvp.Key, kvp => kvp.Value, _headerHandler.DecodedHeaders.Comparer); 760return _headerHandler.DecodedHeaders.ToDictionary(kvp => kvp.Key, kvp => kvp.Value, _headerHandler.DecodedHeaders.Comparer);
src\Servers\Kestrel\shared\TransportConnection.Generated.cs (3)
79if (kv.Key == key) 97if (MaybeExtra[i].Key == key) 112if (MaybeExtra[i].Key == key)
InProcessWebSite (2)
src\Servers\IIS\IIS\test\testassets\InProcessWebSite\Startup.WebSockets.cs (1)
151context.Response.Headers[headerPair.Key] = headerPair.Value;
src\Servers\IIS\IIS\test\testassets\shared\WebSockets\TestStartup.cs (1)
52if (context.Request.Path.StartsWithSegments(requestDelegate.Key, out var matchedPath, out var remainingPath))
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))
Interop.FunctionalTests (8)
Http2\Http2RequestTests.cs (7)
78Assert.Equal("http", (string)tags.Single(t => t.Key == "network.protocol.name").Value); 79Assert.Equal("2", (string)tags.Single(t => t.Key == "network.protocol.version").Value); 80Assert.Equal("tcp", (string)tags.Single(t => t.Key == "network.transport").Value); 81Assert.Equal("ipv4", (string)tags.Single(t => t.Key == "network.type").Value); 82Assert.Equal("127.0.0.1", (string)tags.Single(t => t.Key == "server.address").Value); 83Assert.Equal(host.GetPort(), (int)tags.Single(t => t.Key == "server.port").Value); 84Assert.Equal("invalid_handshake", (string)tags.Single(t => t.Key == "error.type").Value);
Http3\Http3RequestTests.cs (1)
893requestHeaders.Add(context.Request.Headers.ToDictionary(k => k.Key, k => k.Value, StringComparer.OrdinalIgnoreCase));
InteropTests (1)
src\Shared\Process\ProcessEx.cs (1)
118startInfo.EnvironmentVariables[envVar.Key] = envVar.Value;
InteropWebsite (1)
TestServiceImpl.cs (1)
137var encoding = context.GetHttpContext().Request.Headers.SingleOrDefault(h => string.Equals(h.Key, "grpc-encoding", StringComparison.OrdinalIgnoreCase)).Value.SingleOrDefault();
Microsoft.Analyzers.Extra (3)
CallAnalysis\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)
ApiLifecycle\Json\JsonObject.cs (1)
168keys[i] = new KeyValuePair(property.Key, property.Value);
CallAnalysis\CallAnalyzer.Registrar.cs (3)
70var type = Compilation.GetTypeByMetadataName(pair.Key); 148var type = Compilation.GetTypeByMetadataName(pair.Key); 204var type = Compilation.GetTypeByMetadataName(pair.Key);
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.Arcade.Test.Common (1)
MockEngine.cs (1)
72_output?.WriteLine($"telemetry {eventName}: {properties.Aggregate(string.Empty, (sum, piece) => $"{sum}, {piece.Key} = {piece.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\Shared\RoslynUtils\SymbolExtensions.cs (1)
208if (string.Equals(namedArgument.Key, argumentName, StringComparison.Ordinal))
Microsoft.AspNetCore.App.Analyzers.Test (4)
Http\HeaderDictionaryIndexerAnalyzerTests.cs (2)
187if (mapping.Key is null) 193propertyMapping.Remove(mapping.Key);
RouteEmbeddedLanguage\Infrastructure\MarkupTestFile.cs (2)
175spans = tempSpans.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); 223spans = dictionary.ToDictionary(kvp => kvp.Key, kvp => kvp.Value.ToImmutableArray());
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)
136writer.Write(property.Key ?? string.Empty);
Microsoft.AspNetCore.Authentication.Cookies (1)
CookieAuthenticationHandler.cs (1)
144newProperties.Items[item.Key] = item.Value;
Microsoft.AspNetCore.Authentication.JwtBearer.Tools.Tests (1)
src\Tools\Shared\TestHelpers\TemporaryDirectory.cs (1)
92CreateFile(file.Key, file.Value);
Microsoft.AspNetCore.Authentication.OAuth (1)
OAuthHandler.cs (1)
333parameters.Add(additionalParameter.Key, additionalParameter.Value);
Microsoft.AspNetCore.Authentication.OpenIdConnect (6)
OpenIdConnectHandler.cs (6)
112message = new OpenIdConnectMessage(Request.Query.Select(pair => new KeyValuePair<string, string[]>(pair.Key, pair.Value.ToArray()))); 127message = new OpenIdConnectMessage(form.Select(pair => new KeyValuePair<string, string[]>(pair.Key, pair.Value.ToArray()))); 316var message = new OpenIdConnectMessage(Request.Query.Select(pair => new KeyValuePair<string, string[]>(pair.Key, pair.Value.ToArray()))); 455message.Parameters.Add(additionalParameter.Key, additionalParameter.Value); 639authorizationResponse = new OpenIdConnectMessage(Request.Query.Select(pair => new KeyValuePair<string, string[]>(pair.Key, pair.Value.ToArray()))); 666authorizationResponse = new OpenIdConnectMessage(form.Select(pair => new KeyValuePair<string, string[]>(pair.Key, pair.Value.ToArray())));
Microsoft.AspNetCore.Authentication.Test (10)
CookieTests.cs (1)
1897xml.Add(result.Ticket.Properties.Items.Select(extra => new XElement("extra", new XAttribute("type", extra.Key), new XAttribute("value", extra.Value))));
OAuthTests.cs (2)
136var setCookie = Assert.Single(res.Headers, h => h.Key == "Set-Cookie"); 164var setCookie = Assert.Single(res.Headers, h => h.Key == "Set-Cookie");
OpenIdConnect\OpenIdConnectTests.cs (7)
79var setCookie = Assert.Single(res.Headers, h => h.Key == "Set-Cookie"); 106var setCookie = Assert.Single(res.Headers, h => h.Key == "Set-Cookie"); 132var setCookie = Assert.Single(res.Headers, h => h.Key == "Set-Cookie"); 159var setCookie = Assert.Single(res.Headers, h => h.Key == "Set-Cookie"); 321Assert.DoesNotContain(remoteSignOutTransaction.Response.Headers, h => h.Key == "Set-Cookie"); 345Assert.DoesNotContain(remoteSignOutTransaction.Response.Headers, h => h.Key == "Set-Cookie"); 369Assert.Contains(remoteSignOutTransaction.Response.Headers, h => h.Key == "Set-Cookie");
Microsoft.AspNetCore.Authentication.Twitter (5)
TwitterHandler.cs (5)
204signatureParts.Add(queryParameter.Key, queryParameter.Value); 211signatureParts.Add(formItem.Key, formItem.Value); 218stringBuilder.AppendFormat(CultureInfo.InvariantCulture, "{0}={1}&", Uri.EscapeDataString(signaturePart.Key), Uri.EscapeDataString(signaturePart.Value)); 240stringBuilder.AppendFormat(CultureInfo.InvariantCulture, "{0}={1}&", queryParam.Key, queryParam.Value); 250stringBuilder.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\Shared\Debugger\DebuggerHelpers.cs (1)
62sb.Append(kvp.Key);
Microsoft.AspNetCore.BrowserTesting (3)
BrowserManagerConfiguration.cs (3)
134argsMap => argsMap.ToDictionary(kvp => kvp.Key, kvp => string.Join(", ", kvp.Value))), 210argsMap => argsMap.SelectMany(argNameValue => argNameValue.Value.Prepend(argNameValue.Key)).ToArray()), 299true => configuration.Get<Dictionary<string, bool>>().Where(kvp => kvp.Value == true).Select(kvp => kvp.Key).ToArray()
Microsoft.AspNetCore.Components (27)
DynamicComponent.cs (1)
101builder.AddComponentParameter(1, entry.Key, entry.Value);
ParameterView.cs (1)
308builder.Add(kvp.Key, kvp.Value);
Rendering\RenderTreeBuilder.cs (1)
452AddAttribute(sequence, attribute.Key, attribute.Value);
RouteView.cs (1)
91builder.AddComponentParameter(1, kvp.Key, kvp.Value);
Routing\RouteTable.cs (2)
40routeValueDictionary[kvp.Key] = value.Replace("%2F", "/", StringComparison.OrdinalIgnoreCase); 90routeValues[kvp.Key] = value.Replace("%2F", "/", StringComparison.OrdinalIgnoreCase);
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\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\Http\Routing\src\Patterns\RoutePatternMatcher.cs (3)
192if (!values.ContainsKey(kvp.Key)) 194values.Add(kvp.Key, kvp.Value); 495values[item.Key] = item.Value;
src\Http\Routing\src\RouteConstraintBuilder.cs (3)
67if (_optionalParameters.Contains(kvp.Key)) 70constraints.Add(kvp.Key, optionalConstraint); 74constraints.Add(kvp.Key, constraint);
src\Http\Routing\src\RouteConstraintMatcher.cs (1)
67if (!constraint.Match(kvp.Key, routeValues))
src\Shared\Debugger\DictionaryItemDebugView.cs (1)
23Key = keyValue.Key;
Microsoft.AspNetCore.Components.Analyzers (1)
ComponentFacts.cs (1)
66if (string.Equals(kvp.Key, ComponentsApi.ParameterAttribute.CaptureUnmatchedValues, StringComparison.Ordinal))
Microsoft.AspNetCore.Components.Endpoints (7)
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>);
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);
Microsoft.AspNetCore.Components.Endpoints.Tests (9)
Binding\FormDataMapperTests.cs (9)
83dictionary.Add(new FormKey(kvp.Key.AsMemory()), kvp.Value); 953Assert.Equal(expected.OrderBy(o => o.Key).ToArray(), dictionary.OrderBy(o => o.Key).ToArray()); 1007Assert.Equal(expected.OrderBy(o => o.Key).ToArray(), dictionary.OrderBy(o => o.Key).ToArray()); 1037Assert.Equal(expected.OrderBy(o => o.Key).ToArray(), dictionary.OrderBy(o => o.Key).ToArray()); 1248Assert.Equal(expected.OrderBy(o => o.Key).ToArray(), dictionary.OrderBy(o => o.Key).ToArray());
Microsoft.AspNetCore.Components.SdkAnalyzers (1)
ComponentFacts.cs (1)
66if (string.Equals(kvp.Key, ComponentsApi.ParameterAttribute.CaptureUnmatchedValues, StringComparison.Ordinal))
Microsoft.AspNetCore.Components.Server (1)
src\SignalR\common\Protocols.MessagePack\src\Protocol\MessagePackHubProtocolWorker.cs (1)
601writer.Write(header.Key);
Microsoft.AspNetCore.Components.Server.Tests (1)
src\SignalR\common\SignalR.Common\test\Internal\Protocol\HubMessageHelpers.cs (1)
21hubMessage.Headers[header.Key] = header.Value;
Microsoft.AspNetCore.Components.Tests (13)
Lifetime\ComponentStatePersistenceManagerTest.cs (2)
275State = state.ToDictionary(k => k.Key, v => v.Value); 303State = state.ToDictionary(k => k.Key, v => v.Value);
ParameterViewTest.Assignment.cs (4)
355target.CaptureUnmatchedValues.OrderBy(kvp => kvp.Key), 358Assert.Equal("test1", kvp.Key); 363Assert.Equal("test2", kvp.Key); 475Assert.Equal(nameof(HasCaptureUnmatchedValuesPropertyAndCascadingParameter.Cascading), kvp.Key);
ParameterViewTest.cs (2)
287Assert.Equal("entry 1", entry.Key); 292Assert.Equal("entry 2", entry.Key);
RendererTest.cs (1)
5387builder.AddComponentParameter(2, kvp.Key, kvp.Value);
Rendering\RenderTreeBuilderTest.cs (1)
424AssertFrame.Attribute(frame, attribute.Key, attribute.Value);
Routing\RouteTableFactoryTests.cs (3)
308Assert.Single(context.Parameters, p => p.Key == "parameter" && (string)p.Value == expectedValue); 325Assert.Single(context.Parameters, p => p.Key == "parameter" && (string)p.Value == expectedValue); 473var value = expectedValue != null ? Assert.Single(context.Parameters, p => p.Key == "parameter").Value : null;
Microsoft.AspNetCore.Components.Web (1)
Forms\InputBase.cs (1)
357result.Add(item.Key, item.Value);
Microsoft.AspNetCore.Components.WebAssembly.Tests (4)
Hosting\WebAssemblyHostConfigurationTest.cs (4)
96var section = configuration.GetSection("wheels").AsEnumerable(makePathsRelative: true).ToDictionary(k => k.Key, v => v.Value); 161var dict = configuration.GetSection("Mem1").AsEnumerable(makePathsRelative: true).ToDictionary(k => k.Key, v => v.Value); 167var dict2 = configuration.GetSection("Mem2").AsEnumerable(makePathsRelative: true).ToDictionary(k => k.Key, v => v.Value); 173var dict3 = configuration.GetSection("Mem3").AsEnumerable(makePathsRelative: true).ToDictionary(k => k.Key, v => v.Value);
Microsoft.AspNetCore.Components.WebView (3)
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.Test (4)
StaticContentProviderTests.cs (4)
63.Where(kvp => kvp.Key == subpath) 64.Select(x => new InMemoryFileInfo(x.Key, x.Value)) 91.Where(kvp => kvp.Key.StartsWith(_subPath, StringComparison.Ordinal)) 92.Select(x => new InMemoryFileInfo(x.Key, x.Value))
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\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\Shared\Debugger\DebuggerHelpers.cs (1)
62sb.Append(kvp.Key);
Microsoft.AspNetCore.Cors.Test (26)
CorsMiddlewareTests.cs (26)
201response.Headers.OrderBy(h => h.Key), 204Assert.Equal(CorsConstants.AccessControlAllowHeaders, kvp.Key); 209Assert.Equal(CorsConstants.AccessControlAllowMethods, kvp.Key); 214Assert.Equal(CorsConstants.AccessControlAllowOrigin, kvp.Key); 267response.Headers.OrderBy(h => h.Key), 270Assert.Equal(CorsConstants.AccessControlAllowCredentials, kvp.Key); 275Assert.Equal(CorsConstants.AccessControlAllowHeaders, kvp.Key); 280Assert.Equal(CorsConstants.AccessControlAllowMethods, kvp.Key); 285Assert.Equal(CorsConstants.AccessControlAllowOrigin, kvp.Key); 488response.Headers.OrderBy(h => h.Key), 491Assert.Equal(CorsConstants.AccessControlAllowHeaders, kvp.Key); 496Assert.Equal(CorsConstants.AccessControlAllowMethods, kvp.Key); 501Assert.Equal(CorsConstants.AccessControlAllowOrigin, kvp.Key); 545response.Headers.OrderBy(o => o.Key), 548Assert.Equal(CorsConstants.AccessControlAllowOrigin, kvp.Key); 553Assert.Equal(CorsConstants.AccessControlExposeHeaders, kvp.Key); 558Assert.Equal("Test", kvp.Key); 623response.Headers.OrderBy(o => o.Key), 626Assert.Equal(CorsConstants.AccessControlAllowOrigin, kvp.Key); 631Assert.Equal(CorsConstants.AccessControlExposeHeaders, kvp.Key); 668response.Headers.OrderBy(o => o.Key), 671Assert.Equal(CorsConstants.AccessControlAllowHeaders, kvp.Key); 676Assert.Equal(CorsConstants.AccessControlAllowOrigin, kvp.Key); 990Assert.Contains(httpContext.Items, item => string.Equals(item.Key as string, "__CorsMiddlewareWithEndpointInvoked")); 1014Assert.Contains(httpContext.Items, item => string.Equals(item.Key as string, "__CorsMiddlewareWithEndpointInvoked")); 1038Assert.DoesNotContain(httpContext.Items, item => string.Equals(item.Key as string, "__CorsMiddlewareWithEndpointInvoked"));
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.DataProtection.Tests (2)
Internal\KeyManagementOptionsSetupTest.cs (1)
83registryKey.SetValue(entry.Key, entry.Value);
RegistryPolicyResolverTests.cs (1)
257registryKey.SetValue(entry.Key, entry.Value);
Microsoft.AspNetCore.Diagnostics (16)
DeveloperExceptionPage\DeveloperExceptionPageMiddlewareImpl.cs (1)
244sb.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\Shared\Diagnostics\ActivityCreator.cs (2)
79activity.AddTag(tag.Key, tag.Value); 117activity.AddBaggage(baggageItem.Key, baggageItem.Value);
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\Shared\Diagnostics\ActivityCreator.cs (2)
79activity.AddTag(tag.Key, tag.Value); 117activity.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.Tests (118)
Logging\AcceptanceTests.cs (83)
186Assert.DoesNotContain(state, x => x.Key == HttpLoggingTagNames.RequestBody); 187Assert.DoesNotContain(state, x => x.Key.StartsWith(HttpLoggingTagNames.RequestHeaderPrefix)); 188Assert.DoesNotContain(state, x => x.Key.StartsWith(HttpLoggingTagNames.ResponseHeaderPrefix)); 189Assert.Single(state, x => x.Key == HttpLoggingTagNames.Host && !string.IsNullOrEmpty(x.Value)); 190Assert.Single(state, x => x.Key == HttpLoggingTagNames.Path && x.Value == TelemetryConstants.Unknown); 191Assert.Single(state, x => x.Key == HttpLoggingTagNames.StatusCode && x.Value == responseStatus); 192Assert.Single(state, x => x.Key == HttpLoggingTagNames.Method && x.Value == HttpMethod.Post.ToString()); 193Assert.Single(state, x => x.Key == HttpLoggingTagNames.Duration && 199Assert.Single(state, x => x.Key == HttpLoggingTagNames.ResponseBody && x.Value == "Server: hello!Server: world!"); 204Assert.DoesNotContain(state, x => x.Key == HttpLoggingTagNames.ResponseBody); 246Assert.DoesNotContain(state, x => x.Key == HttpLoggingTagNames.ResponseBody); 247Assert.DoesNotContain(state, x => x.Key.StartsWith(HttpLoggingTagNames.RequestHeaderPrefix)); 248Assert.DoesNotContain(state, x => x.Key.StartsWith(HttpLoggingTagNames.ResponseHeaderPrefix)); 249Assert.Single(state, x => x.Key == HttpLoggingTagNames.Host && !string.IsNullOrEmpty(x.Value)); 250Assert.Single(state, x => x.Key == HttpLoggingTagNames.Path && x.Value == TelemetryConstants.Unknown); 251Assert.Single(state, x => x.Key == HttpLoggingTagNames.StatusCode && x.Value == responseStatus); 252Assert.Single(state, x => x.Key == HttpLoggingTagNames.Method && x.Value == HttpMethod.Post.ToString()); 253Assert.Single(state, x => x.Key == HttpLoggingTagNames.Duration && 259Assert.Single(state, x => x.Key == HttpLoggingTagNames.RequestBody && x.Value == Content); 264Assert.DoesNotContain(state, x => x.Key == HttpLoggingTagNames.RequestBody); 317Assert.DoesNotContain(requestState, x => x.Key.StartsWith(HttpLoggingTagNames.ResponseHeaderPrefix)); 318Assert.DoesNotContain(requestState, x => x.Key == HttpLoggingTagNames.StatusCode); 319Assert.DoesNotContain(requestState, x => x.Key == HttpLoggingTagNames.Duration); 320Assert.Single(requestState, x => x.Key == HttpLoggingTagNames.RequestHeaderPrefix + NormalizedRequestHeader); 321Assert.Single(requestState, x => x.Key == HttpLoggingTagNames.Host && !string.IsNullOrEmpty(x.Value)); 322Assert.Single(requestState, x => x.Key == HttpLoggingTagNames.Path && x.Value == TelemetryConstants.Unknown); 323Assert.Single(requestState, x => x.Key == HttpLoggingTagNames.Method && x.Value == HttpMethod.Post.ToString()); 324Assert.Single(requestState, x => x.Key == "Protocol" && x.Value == "HTTP/1.1"); 327Assert.Single(requestBodyState, x => x.Key == "Body" && x.Value == Content); 330Assert.Single(responseState, x => x.Key == HttpLoggingTagNames.ResponseHeaderPrefix + NormalizedResponseHeader); 331Assert.Single(responseState, x => x.Key == HttpLoggingTagNames.StatusCode && x.Value == responseStatus); 334Assert.Single(responseBodyState, x => x.Key == "Body" && x.Value == "Server: hello!Server: world!"); 337Assert.Single(durationState, x => x.Key == HttpLoggingTagNames.Duration && x.Value != null); 375Assert.Single(state, x => x.Key == HttpLoggingTagNames.RequestHeaderPrefix + NormalizedRequestHeader); 376Assert.Single(state, x => x.Key == HttpLoggingTagNames.ResponseHeaderPrefix + NormalizedResponseHeader); 377Assert.Single(state, x => x.Key == HttpLoggingTagNames.Host && !string.IsNullOrEmpty(x.Value)); 378Assert.Single(state, x => x.Key == HttpLoggingTagNames.Path && x.Value == TelemetryConstants.Unknown); 379Assert.Single(state, x => x.Key == HttpLoggingTagNames.StatusCode && x.Value == responseStatus); 380Assert.Single(state, x => x.Key == HttpLoggingTagNames.Duration && 384Assert.Single(state, x => x.Key == HttpLoggingTagNames.Method && x.Value == HttpMethod.Get.ToString()); 385Assert.DoesNotContain(state, x => x.Key == HttpLoggingTagNames.RequestBody); 386Assert.DoesNotContain(state, x => x.Key == HttpLoggingTagNames.ResponseBody); 388x.Key.StartsWith(HttpLoggingTagNames.RequestHeaderPrefix) && !x.Key.EndsWith(NormalizedRequestHeader)); 391x.Key.StartsWith(HttpLoggingTagNames.ResponseHeaderPrefix) && !x.Key.EndsWith(NormalizedResponseHeader)); 421Assert.Single(state, x => x.Key == TestHttpLogEnricher.Key1 && x.Value == TestHttpLogEnricher.Value1); 422Assert.Single(state, x => x.Key == TestHttpLogEnricher.Key2 && x.Value == TestHttpLogEnricher.Value2.ToString(CultureInfo.InvariantCulture)); 423Assert.Single(state, x => x.Key == HttpLoggingTagNames.Method && x.Value == HttpMethod.Delete.ToString()); 424Assert.DoesNotContain(state, x => x.Key == HttpLoggingTagNames.RequestBody); 425Assert.DoesNotContain(state, x => x.Key == HttpLoggingTagNames.ResponseBody); 426Assert.DoesNotContain(state, x => x.Key.StartsWith(HttpLoggingTagNames.RequestHeaderPrefix)); 427Assert.DoesNotContain(state, x => x.Key.StartsWith(HttpLoggingTagNames.ResponseHeaderPrefix)); 463Assert.Single(state, x => x.Key == HttpLoggingTagNames.Path && x.Value == RequestPath); 495Assert.DoesNotContain(firstState, x => x.Key == TestHttpLogEnricher.Key1 && x.Value == TestHttpLogEnricher.Value1); 496Assert.DoesNotContain(firstState, x => x.Key == TestHttpLogEnricher.Key2 && x.Value == TestHttpLogEnricher.Value2.ToString(CultureInfo.InvariantCulture)); 499Assert.Single(secondState, x => x.Key == TestHttpLogEnricher.Key1 && x.Value == TestHttpLogEnricher.Value1); 500Assert.Single(secondState, x => x.Key == TestHttpLogEnricher.Key2 && x.Value == TestHttpLogEnricher.Value2.ToString(CultureInfo.InvariantCulture)); 540Assert.DoesNotContain(firstRecord, x => x.Key == HttpLoggingTagNames.StatusCode); 541Assert.DoesNotContain(firstRecord, x => x.Key == HttpLoggingTagNames.Duration); 542Assert.DoesNotContain(secondRecord!, x => x.Key == HttpLoggingTagNames.Duration); 543Assert.DoesNotContain(fourthRecord, x => x.Key == HttpLoggingTagNames.StatusCode); 544Assert.DoesNotContain(fourthRecord, x => x.Key == HttpLoggingTagNames.Duration); 545Assert.DoesNotContain(fithRecord!, x => x.Key == HttpLoggingTagNames.Duration); 549Assert.Single(secondRecord!, x => x.Key == HttpLoggingTagNames.StatusCode && x.Value == responseStatus); 550Assert.Single(fithRecord!, x => x.Key == HttpLoggingTagNames.StatusCode && x.Value == responseStatus); 554Assert.Single(thirdRecord, x => x.Key == HttpLoggingTagNames.Duration && x.Value != null); 555Assert.Single(sixthRecord, x => x.Key == HttpLoggingTagNames.Duration && x.Value != null); 580Assert.DoesNotContain(state, x => x.Key.StartsWith(HttpLoggingTagNames.RequestHeaderPrefix)); 581Assert.DoesNotContain(state, x => x.Key.StartsWith(HttpLoggingTagNames.ResponseHeaderPrefix)); 582Assert.Single(state, x => x.Key == HttpLoggingTagNames.Method && x.Value == HttpMethod.Get.ToString()); 583Assert.Single(state, x => x.Key == HttpLoggingTagNames.Host && !string.IsNullOrEmpty(x.Value)); 584Assert.Single(state, x => x.Key == HttpLoggingTagNames.Path && x.Value == TelemetryConstants.Unknown); 585Assert.Single(state, x => x.Key == HttpLoggingTagNames.StatusCode && x.Value == expectedStatus); 586Assert.Single(state, x => x.Key == HttpLoggingTagNames.Duration && 621Assert.DoesNotContain(state, x => x.Key.StartsWith(HttpLoggingTagNames.RequestHeaderPrefix)); 622Assert.DoesNotContain(state, x => x.Key.StartsWith(HttpLoggingTagNames.ResponseHeaderPrefix)); 623Assert.Single(state, x => x.Key == HttpLoggingTagNames.Method && x.Value == HttpMethod.Put.ToString()); 624Assert.Single(state, x => x.Key == HttpLoggingTagNames.RequestBody && x.Value == Content); 625Assert.Single(state, x => x.Key == HttpLoggingTagNames.ResponseBody && x.Value == "test body"); 655Assert.DoesNotContain(state, x => x.Key.StartsWith(HttpLoggingTagNames.RequestHeaderPrefix)); 656Assert.DoesNotContain(state, x => x.Key.StartsWith(HttpLoggingTagNames.ResponseHeaderPrefix)); 657Assert.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.Diagnostics.Tests (1)
StatusCodeMiddlewareTest.cs (1)
63Assert.Equal(expectedUri, response.Headers.First(s => s.Key == "Location").Value.First());
Microsoft.AspNetCore.Grpc.JsonTranscoding (9)
Internal\Json\MessageTypeInfoResolver.cs (1)
57var 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.Grpc.JsonTranscoding.Tests (1)
JsonTranscodingServiceMethodProviderTests.cs (1)
124if ((string)values.Single(v => v.Key == "MethodName").Value! != "SayHello")
Microsoft.AspNetCore.Grpc.Swagger (2)
Internal\GrpcJsonTranscodingDescriptionProvider.cs (1)
159Name = queryDescription.Key,
Internal\XmlComments\GrpcXmlCommentsDocumentFilter.cs (1)
70Name = nameAndType.Key,
Microsoft.AspNetCore.HeaderParsing (1)
HeaderParsingOptionsManualValidator.cs (1)
19$"Negative cached value count of {item.Value} specified for the {item.Key} header",
Microsoft.AspNetCore.Hosting (10)
src\Shared\Diagnostics\ActivityCreator.cs (2)
79activity.AddTag(tag.Key, tag.Value); 117activity.AddBaggage(baggageItem.Key, baggageItem.Value);
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\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.Hosting.Tests (19)
HostingApplicationDiagnosticsTests.cs (19)
508if (pair.Key == "Microsoft.AspNetCore.Hosting.HttpRequestIn.Start") 514if (pair.Key == "Microsoft.AspNetCore.Hosting.HttpRequestIn.Stop") 547eventsFired |= pair.Key.StartsWith("Microsoft.AspNetCore.Hosting.HttpRequestIn", StringComparison.Ordinal); 581eventsFired |= pair.Key.StartsWith("Microsoft.AspNetCore.Hosting.HttpRequestIn", StringComparison.Ordinal); 616if (pair.Key == "Microsoft.AspNetCore.Hosting.HttpRequestIn.Start") 640if (pair.Key == "Microsoft.AspNetCore.Hosting.HttpRequestIn.Stop") 665if (pair.Key == "Microsoft.AspNetCore.Hosting.HttpRequestIn.Stop") 689if (pair.Key == "Microsoft.AspNetCore.Hosting.UnhandledException") 751Assert.Contains(Activity.Current.Baggage, pair => pair.Key == "Key1" && pair.Value == "value1"); 752Assert.Contains(Activity.Current.Baggage, pair => pair.Key == "Key2" && pair.Value == "value2"); 780Assert.Contains(Activity.Current.Baggage, pair => pair.Key == "Key1" && pair.Value == "value1"); 781Assert.Contains(Activity.Current.Baggage, pair => pair.Key == "Key2" && pair.Value == "value2"); 810Assert.Contains(Activity.Current.Baggage, pair => pair.Key == "Key1" && pair.Value == "value1"); 811Assert.Contains(Activity.Current.Baggage, pair => pair.Key == "Key2" && pair.Value == "value2"); 841Assert.Contains(Activity.Current.Baggage, pair => pair.Key == "Key1" && pair.Value == "value3"); 842Assert.Contains(Activity.Current.Baggage, pair => pair.Key == "Key2" && pair.Value == "value4"); 908Assert.Contains(Activity.Current.Baggage, pair => pair.Key == "Key1" && pair.Value == "value1/1"); 943Assert.Contains(Activity.Current.Baggage, pair => pair.Key == "Key1" && pair.Value == "value1"); 944Assert.Contains(Activity.Current.Baggage, pair => pair.Key == "Key2" && pair.Value == "value2");
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\Shared\Debugger\DictionaryItemDebugView.cs (1)
23Key = keyValue.Key;
src\Shared\Debugger\StringValuesDictionaryDebugView.cs (1)
28keyValuePairs.Add(new DictionaryItemDebugView<string, string>(kvp.Key, kvp.Value.ToString()));
src\Shared\Dictionary\AdaptiveCapacityDictionary.cs (7)
165keys[i] = array[i].Key; 207Add(item.Key, item.Value); 271return TryGetValue(item.Key, out var value) && EqualityComparer<object>.Default.Equals(value, item.Value); 355var index = FindIndex(item.Key); 522_dictionaryStorage[item.Key] = item.Value; 563if (_comparer.Equals(ArrayStorageSpan[i].Key, key)) 583if (_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\Shared\Debugger\DebuggerHelpers.cs (1)
62sb.Append(kvp.Key);
src\Shared\Debugger\DictionaryItemDebugView.cs (1)
23Key = keyValue.Key;
Microsoft.AspNetCore.Http.Abstractions.Tests (78)
HttpValidationProblemDetailsJsonConverterTest.cs (12)
75Assert.Equal("traceId", kvp.Key); 79problemDetails.Errors.OrderBy(kvp => kvp.Key), 82Assert.Equal("key0", kvp.Key); 87Assert.Equal("key1", kvp.Key); 116Assert.Equal("traceId", kvp.Key); 120problemDetails.Errors.OrderBy(kvp => kvp.Key), 123Assert.Equal("key0", kvp.Key); 128Assert.Equal("key1", kvp.Key); 155Assert.Equal("traceId", kvp.Key); 159problemDetails.Errors.OrderBy(kvp => kvp.Key), 162Assert.Equal("key0", kvp.Key); 167Assert.Equal("key1", kvp.Key);
ProblemDetailsJsonConverterTest.cs (4)
59Assert.Equal("traceId", kvp.Key); 90Assert.Equal("traceId", kvp.Key); 122Assert.Equal("traceId", kvp.Key); 152Assert.Equal("traceId", kvp.Key);
RouteValueDictionaryTests.cs (62)
87yield return new object[] { routeValues.ToDictionary(kvp => kvp.Key, kvp => kvp.Value) }; 106yield return new object[] { routeValues.ToDictionary(kvp => kvp.Key, kvp => kvp.Value) }; 124dict.OrderBy(kvp => kvp.Key), 127Assert.Equal("Address", kvp.Key); 132kvp => { Assert.Equal("Age", kvp.Key); Assert.Equal(30, kvp.Value); }, 133kvp => { Assert.Equal("Name", kvp.Key); Assert.Equal("James", kvp.Value); }); 146dict.OrderBy(kvp => kvp.Key), 147kvp => { Assert.Equal("First Name", kvp.Key); Assert.Equal("James", kvp.Value); }, 148kvp => { Assert.Equal("Last Name", kvp.Key); Assert.Equal("Henrik", kvp.Value); }, 149kvp => { Assert.Equal("Middle Name", kvp.Key); Assert.Equal("Bob", kvp.Value); }); 198dict.OrderBy(kvp => kvp.Key), 199kvp => { Assert.Equal("awesome", kvp.Key); Assert.Equal(123, kvp.Value); }, 200kvp => { Assert.Equal("cool", kvp.Key); Assert.Equal("beans", kvp.Value); }); 215dict.OrderBy(kvp => kvp.Key), 218Assert.Equal("CoolnessFactor", kvp.Key); 223Assert.Equal("IsAwesome", kvp.Key); 241dict.OrderBy(kvp => kvp.Key), 244Assert.Equal("IsPublic", kvp.Key); 293dict.OrderBy(kvp => kvp.Key), 296Assert.Equal("DerivedProperty", kvp.Key); 302Assert.Equal("TotallySweetProperty", kvp.Key); 321dict.OrderBy(kvp => kvp.Key), 322kvp => { Assert.Equal("DerivedProperty", kvp.Key); Assert.Equal(5, kvp.Value); }); 374dict.OrderBy(kvp => kvp.Key), 375kvp => { Assert.Equal("City", kvp.Key); Assert.Equal("Singapore", kvp.Value); }, 376kvp => { Assert.Equal("State", kvp.Key); Assert.Null(kvp.Value); }); 392dict.OrderBy(kvp => kvp.Key), 393kvp => { Assert.Equal("City", kvp.Key); Assert.Equal("Singapore", kvp.Value); }, 394kvp => { Assert.Equal("State", kvp.Key); Assert.Null(kvp.Value); }); 580Assert.Collection(dict, kvp => { Assert.Equal("key", kvp.Key); Assert.Equal("value", kvp.Value); }); 595dict.OrderBy(kvp => kvp.Key), 596kvp => { Assert.Equal("age", kvp.Key); Assert.Equal(30, kvp.Value); }, 597kvp => { Assert.Equal("key", kvp.Key); Assert.Equal("value", kvp.Value); }); 611Assert.Collection(dict, kvp => { Assert.Equal("key", kvp.Key); Assert.Equal("value", kvp.Value); }); 625Assert.Collection(dict, kvp => { Assert.Equal("kEy", kvp.Key); Assert.Equal("value", kvp.Value); }); 643dict.OrderBy(kvp => kvp.Key), 644kvp => { Assert.Equal("age", kvp.Key); Assert.Equal(30, kvp.Value); }, 645kvp => { Assert.Equal("key", kvp.Key); Assert.Equal("value", kvp.Value); }); 662Assert.Collection(dict, kvp => { Assert.Equal("key", kvp.Key); Assert.Equal("value", kvp.Value); }); 679Assert.Collection(dict, kvp => { Assert.Equal("key", kvp.Key); Assert.Equal("value", kvp.Value); }); 827Assert.Collection(dict, kvp => { Assert.Equal("key", kvp.Key); Assert.Equal("value", kvp.Value); }); 855dict.OrderBy(kvp => kvp.Key), 856kvp => { Assert.Equal("age", kvp.Key); Assert.Equal(30, kvp.Value); }, 857kvp => { Assert.Equal("key", kvp.Key); Assert.Equal("value", kvp.Value); }); 883dict.OrderBy(kvp => kvp.Key), 884kvp => { Assert.Equal("age", kvp.Key); Assert.Equal(30, kvp.Value); }, 885kvp => { Assert.Equal("key", kvp.Key); Assert.Equal("value", kvp.Value); }); 905dict.OrderBy(kvp => kvp.Key), 906kvp => { Assert.Equal("key", kvp.Key); Assert.Equal("value", kvp.Value); }); 926dict.OrderBy(kvp => kvp.Key), 927kvp => { Assert.Equal("key", kvp.Key); Assert.Equal("value", kvp.Value); }); 945dict.OrderBy(kvp => kvp.Key), 946kvp => { Assert.Equal("age", kvp.Key); Assert.Equal(30, kvp.Value); }, 947kvp => { Assert.Equal("key", kvp.Key); Assert.Equal("value", kvp.Value); }); 1373Assert.Collection(dict, kvp => { Assert.Equal("key", kvp.Key); Assert.Equal("value", kvp.Value); }); 1394Assert.Collection(dict, kvp => { Assert.Equal("key", kvp.Key); Assert.Equal("value", kvp.Value); }); 1450Assert.Collection(dict, kvp => { Assert.Equal("key", kvp.Key); Assert.Equal("value", kvp.Value); }); 1498Assert.Collection(dict, kvp => { Assert.Equal("key", kvp.Key); Assert.Equal("value", kvp.Value); }); 1594Assert.Collection(dict, kvp => { Assert.Equal("key", kvp.Key); Assert.Equal("value", kvp.Value); }); 1647Assert.Collection(dict, kvp => { Assert.Equal("key", kvp.Key); Assert.Equal("value", kvp.Value); }); 2079Assert.Equal("key", storage[0].Key); 2081Assert.Equal("key3", storage[1].Key);
Microsoft.AspNetCore.Http.Connections (1)
Internal\HttpConnectionDispatcher.cs (1)
729requestHeaders[header.Key] = header.Value;
Microsoft.AspNetCore.Http.Connections.Client (8)
HttpConnection.cs (7)
644if (string.Equals(header.Key, Constants.UserAgent, StringComparison.OrdinalIgnoreCase)) 649httpClient.DefaultRequestHeaders.Remove(header.Key); 651else if (httpClient.DefaultRequestHeaders.Contains(header.Key)) 653httpClient.DefaultRequestHeaders.Remove(header.Key); 654httpClient.DefaultRequestHeaders.Add(header.Key, header.Value); 658httpClient.DefaultRequestHeaders.Add(header.Key, header.Value); 663httpClient.DefaultRequestHeaders.Add(header.Key, header.Value);
Internal\WebSocketsTransport.cs (1)
124webSocket.Options.SetRequestHeader(header.Key, header.Value);
Microsoft.AspNetCore.Http.Extensions (2)
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));
Microsoft.AspNetCore.Http.Extensions.Tests (10)
ProblemDetailsDefaultWriterTest.cs (5)
484Assert.Equal("Extension1", extension.Key); 489Assert.Equal("Extension2", extension.Key); 494Assert.Equal("traceId", extension.Key); 532Assert.Equal("Extension", extension.Key); 540Assert.Equal("traceId", extension.Key);
RequestDelegateGenerator\RequestDelegateCreationTests.Forms.cs (5)
562Assert.Equal("message", item.Key); 567Assert.Equal("name", item.Key); 609Assert.Equal("message", item.Key); 614Assert.Equal("name", item.Key); 847Assert.Equal("name", item.Key);
Microsoft.AspNetCore.Http.Features (1)
IResponseCookies.cs (1)
35Append(keyValuePair.Key, keyValuePair.Value, options);
Microsoft.AspNetCore.Http.Microbenchmarks (36)
AdaptiveCapacityDictionaryBenchmark.cs (36)
44_filledSmallDictionary[a.Key] = a.Value; 53_filledDictTen[a.Key] = a.Value; 60_smallCapDict[_oneValue.Key] = _oneValue.Value; 61_ = _smallCapDict[_oneValue.Key]; 67_dict[_oneValue.Key] = _oneValue.Value; 68_ = _dict[_oneValue.Key]; 74_smallCapDict[_oneValue.Key] = _oneValue.Value; 80_dict[_oneValue.Key] = _oneValue.Value; 101_smallCapDictTen[val.Key] = val.Value; 102_ = _smallCapDictTen[val.Key]; 112_smallCapDictTen[val.Key] = val.Value; 113_ = _smallCapDictTen[val.Key]; 123_smallCapDictTen[val.Key] = val.Value; 124_ = _smallCapDictTen[val.Key]; 134_smallCapDictTen[val.Key] = val.Value; 135_ = _smallCapDictTen[val.Key]; 145_smallCapDictTen[val.Key] = val.Value; 146_ = _smallCapDictTen[val.Key]; 156_smallCapDictTen[val.Key] = val.Value; 157_ = _smallCapDictTen[val.Key]; 167_smallCapDictTen[val.Key] = val.Value; 168_ = _smallCapDictTen[val.Key]; 178_dictTen[val.Key] = val.Value; 179_ = _dictTen[val.Key]; 189_dictTen[val.Key] = val.Value; 190_ = _dictTen[val.Key]; 199_dictTen[val.Key] = val.Value; 200_ = _dictTen[val.Key]; 209_dictTen[val.Key] = val.Value; 210_ = _dictTen[val.Key]; 219_dictTen[val.Key] = val.Value; 220_ = _dictTen[val.Key]; 229_dictTen[val.Key] = val.Value; 230_ = _dictTen[val.Key]; 240_dictTen[val.Key] = val.Value; 241_ = _dictTen[val.Key];
Microsoft.AspNetCore.Http.RequestDelegateGenerator (2)
src\Shared\RoslynUtils\IncrementalValuesProviderExtensions.cs (1)
33result.Add((entry.Key, index, entry.Value.ToImmutable()));
src\Shared\RoslynUtils\SymbolExtensions.cs (1)
208if (string.Equals(namedArgument.Key, argumentName, StringComparison.Ordinal))
Microsoft.AspNetCore.Http.Results.Tests (1)
ProblemResultTests.cs (1)
166Assert.Equal("testError", error.Key);
Microsoft.AspNetCore.HttpLogging (2)
HttpLog.cs (2)
50builder.Append(kvp.Key); 59builder.Append(kvp.Key);
Microsoft.AspNetCore.HttpsPolicy.Tests (1)
HstsMiddlewareTests.cs (1)
411Assert.Contains(response.Headers, x => x.Key == HeaderNames.StrictTransportSecurity);
Microsoft.AspNetCore.Identity.FunctionalTests (6)
Extensions\HttpClientExtensions.cs (3)
38var element = Assert.IsAssignableFrom<IHtmlInputElement>(form[kvp.Key]); 56submision.Headers.TryAddWithoutValidation(header.Key, header.Value); 57submision.Content.Headers.TryAddWithoutValidation(header.Key, header.Value);
Extensions\ResponseAssert.cs (1)
47htmlResponse.Header(header.Key, value);
Infrastructure\ServerFactory.cs (1)
111var assemblyName = kvp.Key.GetName().Name;
MapIdentityApiTests.cs (1)
1463Assert.Equal(error, errorEntry.Key);
Microsoft.AspNetCore.Identity.InMemory.Test (1)
FunctionalTest.cs (1)
416xml.Add(result.Properties.Items.Select(extra => new XElement("extra", new XAttribute("type", extra.Key), new XAttribute("value", extra.Value))));
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.InternalTesting.Tests (1)
LogValuesAssertTest.cs (1)
218string.Join(",", logValues.Select(kvp => $"[{kvp.Key} {kvp.Value}]"));
Microsoft.AspNetCore.JsonPatch.Tests (1)
WriteOnceDynamicTestObject.cs (1)
44SetValueForKey(item.Key, item.Value);
Microsoft.AspNetCore.Mvc.Abstractions (3)
ModelBinding\ModelStateDictionary.cs (2)
454var target = GetOrAddNode(source.Key); 1166Current = current.Key;
src\Shared\Debugger\DictionaryItemDebugView.cs (1)
23Key = keyValue.Key;
Microsoft.AspNetCore.Mvc.Abstractions.Test (20)
ModelBinding\ModelStateDictionaryTest.cs (20)
297Assert.Equal("some key", kvp.Key); 314Assert.Equal("some key", kvp.Key); 335Assert.Equal("some key", kvp.Key); 1011Assert.Equal("key", entry.Key); 1039Assert.Equal("key", entry.Key); 1065Assert.Equal("key", entry.Key); 1126Assert.Equal("key", entry.Key); 1155Assert.Equal("key", entry.Key); 1182Assert.Equal("key", entry.Key); 1217Assert.Equal("key", entry.Key); 1235Assert.Equal("key", entry.Key); 1255Assert.Equal("key", entry.Key); 1275Assert.Equal("key", entry.Key); 1414Assert.Equal("Property1", entry.Key); 1422Assert.Equal("Property4", entry.Key); 1430Assert.Equal("Property1.Property2", entry.Key); 1438Assert.Equal("Property2[Property3]", entry.Key); 1460Assert.Equal("prop", entry.Key); 1465Assert.Equal("property", entry.Key); 1470Assert.Equal("property_name", entry.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.Api.Analyzers (1)
SymbolApiResponseMetadataProvider.cs (1)
193if (string.Equals(namedArgument.Key, StatusCodeProperty, StringComparison.Ordinal) &&
Microsoft.AspNetCore.Mvc.ApiExplorer (2)
ApiResponseTypeProvider.cs (1)
103responseTypes[responseType.Key] = responseType.Value;
DefaultApiDescriptionProvider.cs (1)
290Name = routeParameter.Key,
Microsoft.AspNetCore.Mvc.Core (31)
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);
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)
85_routeValueDictionary.Add(kvp.Key, kvp.Value); 96_routeValueDictionary.Add(kvp.Key, kvp.Value);
SerializableError.cs (1)
40var key = keyModelStatePair.Key;
ValidationProblemDetails.cs (1)
41var key = keyModelStatePair.Key;
Microsoft.AspNetCore.Mvc.Core.Test (252)
AcceptedAtActionResultTests.cs (1)
210Assert.Equal("Location", header.Key);
ApplicationModels\ControllerActionDescriptorProviderTests.cs (12)
244var controller = Assert.Single(action.RouteValues, kvp => kvp.Key.Equals("controller")); 247var actionConstraint = Assert.Single(action.RouteValues, kvp => kvp.Key.Equals("action")); 345var controller = Assert.Single(action.RouteValues, kvp => kvp.Key.Equals("controller")); 348var actionConstraint = Assert.Single(action.RouteValues, kvp => kvp.Key.Equals("action")); 375c.Key == "controller" && 380c.Key == "action" && 385c.Key == "key" && 392c.Key == "controller" && 397c.Key == "action" && 905var controllerDefault = Assert.Single(indexAction.RouteValues, rd => rd.Key.Equals("controller", StringComparison.OrdinalIgnoreCase)); 908var actionDefault = Assert.Single(indexAction.RouteValues, rd => rd.Key.Equals("action", StringComparison.OrdinalIgnoreCase)); 911var areaDefault = Assert.Single(indexAction.RouteValues, rd => rd.Key.Equals("area", StringComparison.OrdinalIgnoreCase));
Builder\MvcAreaRouteBuilderExtensionsTest.cs (34)
29route.Constraints.OrderBy(kvp => kvp.Key), 32Assert.Equal("area", kvp.Key); 37route.Defaults.OrderBy(kvp => kvp.Key), 40Assert.Equal("area", kvp.Key); 64route.Constraints.OrderBy(kvp => kvp.Key), 67Assert.Equal("area", kvp.Key); 72route.Defaults.OrderBy(kvp => kvp.Key), 75Assert.Equal("action", kvp.Key); 80Assert.Equal("area", kvp.Key); 105route.Constraints.OrderBy(kvp => kvp.Key), 108Assert.Equal("area", kvp.Key); 113Assert.Equal("id", kvp.Key); 118route.Defaults.OrderBy(kvp => kvp.Key), 121Assert.Equal("action", kvp.Key); 126Assert.Equal("area", kvp.Key); 152route.Constraints.OrderBy(kvp => kvp.Key), 155Assert.Equal("area", kvp.Key); 160Assert.Equal("id", kvp.Key); 164route.DataTokens.OrderBy(kvp => kvp.Key), 167Assert.Equal("some_token", kvp.Key); 171route.Defaults.OrderBy(kvp => kvp.Key), 174Assert.Equal("action", kvp.Key); 179Assert.Equal("area", kvp.Key); 205route.Constraints.OrderBy(kvp => kvp.Key), 208Assert.Equal("area", kvp.Key); 212route.DataTokens.OrderBy(kvp => kvp.Key), 215Assert.Equal("some_token", kvp.Key); 219route.Defaults.OrderBy(kvp => kvp.Key), 222Assert.Equal("area", kvp.Key); 243route.Constraints.OrderBy(kvp => kvp.Key), 246Assert.Equal("area", kvp.Key); 253routeKey: kvp.Key, 261route.Defaults.OrderBy(kvp => kvp.Key), 264Assert.Equal("area", kvp.Key);
ConsumesAttributeTests.cs (1)
412routeContext.RouteData.Values.Add(kvp.Key, kvp.Value);
ControllerBaseTest.cs (6)
1051Assert.Equal("key", item.Key); 1096Assert.Equal("key", item.Key); 1154Assert.Equal("key", item.Key); 1201Assert.Equal("key", item.Key); 2710Assert.Empty(modelState.Key); 3189Assert.Equal("test", item.Key);
Controllers\ControllerBinderDelegateProviderTest.cs (2)
1013Name = keyValuePair.Key, 1243Assert.Empty(entry.Key);
DependencyInjection\ApplicationModelConventionExtensionsTest.cs (7)
36Assert.Equal("TestProperty", kvp.Key); 76Assert.Equal("TestProperty", kvp.Key); 80Assert.Equal("TestProperty", kvp.Key); 135Assert.Equal("TestProperty", kvp.Key); 139Assert.Equal("TestProperty", kvp.Key); 143Assert.Equal("TestProperty", kvp.Key); 164Assert.Equal("TestProperty", kvp.Key);
DependencyInjection\MvcCoreServiceCollectionExtensionsTest.cs (4)
39var mockType = typeof(Mock<>).MakeGenericType(serviceType.Key); 40services.Add(ServiceDescriptor.Transient(serviceType.Key, mockType)); 49AssertServiceCountEquals(services, serviceType.Key, serviceType.Value.Length + 1); 53AssertContainsSingle(services, serviceType.Key, implementationType);
Formatters\JsonInputFormatterTestBase.cs (18)
148formatterContext.ModelState.OrderBy(k => k.Key), 151Assert.Equal(expectedKey, kvp.Key); 175formatterContext.ModelState.OrderBy(k => k.Key), 178Assert.Equal(expectedKey, kvp.Key); 203formatterContext.ModelState.OrderBy(k => k.Key), 206Assert.Equal(expectedKey, kvp.Key); 326Assert.Collection(formatterContext.ModelState.OrderBy(k => k.Key), 329Assert.Equal(expectedKey, kvp.Key); 352Assert.Collection(formatterContext.ModelState.OrderBy(k => k.Key), 355Assert.Equal(expectedKey, kvp.Key); 379Assert.Collection(formatterContext.ModelState.OrderBy(k => k.Key), 382Assert.Equal(expectedValue, kvp.Key); 405formatterContext.ModelState.OrderBy(k => k.Key), 408Assert.Equal(expectedKey, kvp.Key); 486Assert.Collection(formatterContext.ModelState.OrderBy(k => k.Key), 489Assert.Equal(expectedKey, kvp.Key); 511formatterContext.ModelState.OrderBy(k => k.Key), 514Assert.Equal(ReadAsync_NestedParseError_Expected, kvp.Key);
Formatters\SystemTextJsonInputFormatterTest.cs (3)
83Assert.Equal("$[1]", kvp.Key); 105Assert.Empty(kvp.Key); 126Assert.Empty(kvp.Key);
Infrastructure\ActionSelectorTest.cs (3)
1058.Where(a => a.RouteValues.Any(kvp => kvp.Key == "area" && comparer.Equals(kvp.Value, area))) 1059.Where(a => a.RouteValues.Any(kvp => kvp.Key == "controller" && comparer.Equals(kvp.Value, controller))) 1060.Where(a => a.RouteValues.Any(kvp => kvp.Key == "action" && comparer.Equals(kvp.Value, action)));
Infrastructure\ControllerActionInvokerTest.cs (4)
67Assert.Contains(routeValues, kvp => kvp.Key == "tag" && string.Equals(kvp.Value, "value")); 1663Name = kvp.Key, 1664ParameterInfo = method.GetParameters().Where(p => p.Name == kvp.Key).Single(), 1754args[item.Key] = item.Value;
Infrastructure\ProblemDetailsFactoryTest.cs (9)
31Assert.Equal("traceId", kvp.Key); 52Assert.Equal("traceId", kvp.Key); 75Assert.Equal("traceId", kvp.Key); 98Assert.Equal("traceId", kvp.Key); 105Assert.Equal("some-key", kvp.Key); 128Assert.Equal("traceId", kvp.Key); 135Assert.Equal("some-key", kvp.Key); 160Assert.Equal("traceId", kvp.Key); 167Assert.Equal("some-key", kvp.Key);
Infrastructure\ValidationProblemDetailsJsonConverterTest.cs (12)
41Assert.Equal("traceId", kvp.Key); 45problemDetails.Errors.OrderBy(kvp => kvp.Key), 48Assert.Equal("key0", kvp.Key); 53Assert.Equal("key1", kvp.Key); 81Assert.Equal("traceId", kvp.Key); 85problemDetails.Errors.OrderBy(kvp => kvp.Key), 88Assert.Equal("key0", kvp.Key); 93Assert.Equal("key1", kvp.Key); 119Assert.Equal("traceId", kvp.Key); 123problemDetails.Errors.OrderBy(kvp => kvp.Key), 126Assert.Equal("key0", kvp.Key); 131Assert.Equal("key1", kvp.Key);
ModelBinding\Binders\ArrayModelBinderTest.cs (1)
119Assert.Equal("modelName", keyValuePair.Key);
ModelBinding\Binders\BodyModelBinderTests.cs (10)
71Assert.Equal(string.Empty, entry.Key); 96Assert.Equal("custom", entry.Key); 154Assert.Equal("custom", entry.Key); 276Assert.Equal(string.Empty, entry.Key); 319Assert.Equal(string.Empty, entry.Key); 350Assert.Equal(string.Empty, entry.Key); 390Assert.Equal(string.Empty, entry.Key); 421Assert.Equal(string.Empty, entry.Key); 501Assert.Equal(string.Empty, entry.Key); 557Assert.Equal(string.Empty, entry.Key);
ModelBinding\Binders\ByteArrayModelBinderTests.cs (1)
32Assert.Equal("foo", modelState.Key);
ModelBinding\Binders\CollectionModelBinderTest.cs (1)
305Assert.Equal("modelName", keyValuePair.Key);
ModelBinding\Binders\ComplexObjectModelBinderTest.cs (3)
317Assert.Equal(string.Empty, keyValuePair.Key); 361Assert.Equal(string.Empty, keyValuePair.Key); 405Assert.Equal(string.Empty, keyValuePair.Key);
ModelBinding\Binders\ComplexTypeModelBinderTest.cs (3)
377Assert.Equal(string.Empty, keyValuePair.Key); 421Assert.Equal(string.Empty, keyValuePair.Key); 465Assert.Equal(string.Empty, keyValuePair.Key);
ModelBinding\Binders\DateTimeModelBinderTest.cs (1)
151Assert.Equal("theModelName", entry.Key);
ModelBinding\Binders\DictionaryModelBinderTest.cs (6)
288var stringDictionary = dictionary.ToDictionary(kvp => kvp.Key.ToString(CultureInfo.InvariantCulture), kvp => kvp.Value.ToString(CultureInfo.InvariantCulture)); 373}.OrderBy(kvp => kvp.Key), 491Assert.Equal("modelName", keyValuePair.Key); 642kvp => string.Format(CultureInfo.InvariantCulture, keyFormat, kvp.Key), 658kvp => string.Format(CultureInfo.InvariantCulture, keyFormat, kvp.Key), 679valueProvider.Add(kvp.Key, string.Empty);
ModelBinding\Binders\FloatingPointTypeModelBinderTestOfT.cs (1)
232Assert.Equal("theModelName", entry.Key);
ModelBinding\Binders\SimpleTypeModelBinderTest.cs (1)
326Assert.Equal("theModelName", entry.Key);
ModelBinding\Binders\TryParseTypeModelBinderTest.cs (1)
252Assert.Equal("theModelName", entry.Key);
ModelBinding\CompositeValueProviderTest.cs (2)
62Assert.Empty(entry.Key); 85Assert.Equal("prefix-test", result.Key);
ModelBinding\EnumerableValueProviderTest.cs (1)
100Assert.Equal(expected, result.OrderBy(kvp => kvp.Key));
ModelBinding\Metadata\DefaultModelMetadataTest.cs (1)
651ModelMetadataIdentity.ForProperty(typeof(int), kvp.Key, typeof(string)),
ModelBinding\ParameterBinderTest.cs (13)
79Assert.Equal("myParam", actionContext.ModelState.Single().Key); 117Assert.Equal("myParam", actionContext.ModelState.Single().Key); 218Assert.Equal(expectedKey, modelState.Key); 255Assert.Equal("myParam", actionContext.ModelState.Single().Key); 296Assert.Equal("myParam", actionContext.ModelState.Single().Key); 352Assert.Equal($"{parameter.Name}.{nameof(DerivedPerson.DerivedProperty)}", kvp.Key); 407Assert.Equal(parameter.Name, kvp.Key); 462Assert.Equal($"{property.Name}.{nameof(DerivedPerson.DerivedProperty)}", kvp.Key); 516Assert.Equal($"{property.Name}", kvp.Key); 574Assert.Equal("id", kvp.Key); 635Assert.Empty(kvp.Key); 642Assert.Equal("id", kvp.Key); 700Assert.Equal("id", keyValuePair.Key);
ModelBinding\PrefixContainerTest.cs (12)
210Assert.Collection(result.OrderBy(k => k.Key, StringComparer.OrdinalIgnoreCase), 213Assert.Equal("0", item.Key); 218Assert.Equal("foo", item.Key); 223Assert.Equal("item1", item.Key); 253Assert.Collection(result.OrderBy(k => k.Key, StringComparer.OrdinalIgnoreCase), 256Assert.Equal("0", item.Key); 261Assert.Equal("1", item.Key); 266Assert.Equal("age", item.Key); 271Assert.Equal("name", item.Key); 287Assert.Collection(result.OrderBy(k => k.Key, StringComparer.OrdinalIgnoreCase), 290Assert.Equal("0", item.Key); 295Assert.Equal("1", item.Key);
ModelBinding\Validation\DefaultObjectValidatorTests.cs (13)
417Assert.Equal("FirstName", state.Key); 423Assert.Equal("Address.City", state.Key); 451Assert.Equal("invalidProperties.FirstName", state.Key); 457Assert.Equal("invalidProperties.Address.City", state.Key); 538Assert.Equal("parameter", entry.Key); 544Assert.Equal("parameter.ValidatableModelProperty", entry.Key); 553Assert.Equal("parameter.ValidatableModelProperty.Property1", entry.Key); 560Assert.Equal("parameter.ValidatableModelProperty.Property2", entry.Key); 567Assert.Equal("parameter.ValidatableModelProperty.Property3", entry.Key); 963Assert.Equal("Items[0]", state.Key); 969Assert.Equal("Items[2]", state.Key); 1247Assert.Empty(kvp.Key); 1254Assert.Equal("one", kvp.Key);
RedirectToPageResultTest.cs (9)
115Assert.Equal("test", value.Key); 120Assert.Equal("page", value.Key); 125Assert.Equal("handler", value.Key); 169Assert.Equal("test", value.Key); 174Assert.Equal("page", value.Key); 179Assert.Equal("handler", value.Key); 231Assert.Equal("page", value.Key); 282Assert.Equal("page", value.Key); 287Assert.Equal("handler", value.Key);
ResponseCacheAttributeTest.cs (1)
331optionsAccessor.Value.CacheProfiles.Add(p.Key, p.Value);
Routing\ActionEndpointFactoryTest.cs (2)
465actionDescriptor.RouteValues[kvp.Key] = kvp.Value?.ToString(); 487var isPresent = fullSet.TryGetValue(subsetPair.Key, out var fullSetPairValue);
Routing\AttributeRouteTest.cs (4)
190Assert.Single(e.Constraints, kvp => kvp.Key == "id"); 392Assert.Single(e.Constraints, kvp => kvp.Key == "id"); 441e.Defaults.OrderBy(kvp => kvp.Key), 824result.Add(kvp.Key, kvp.Value);
Routing\ControllerActionEndpointDataSourceTest.cs (1)
569action.RouteValues[kvp.Key] = kvp.Value?.ToString();
Routing\DynamicControllerEndpointMatcherPolicyTest.cs (13)
191candidates[0].Values.OrderBy(kvp => kvp.Key), 194Assert.Equal("action", kvp.Key); 199Assert.Equal("controller", kvp.Key); 269candidates[0].Values.OrderBy(kvp => kvp.Key), 272Assert.Equal("action", kvp.Key); 277Assert.Equal("controller", kvp.Key); 282Assert.Equal("slug", kvp.Key); 287Assert.Equal("state", kvp.Key); 369candidates[0].Values.OrderBy(kvp => kvp.Key), 372Assert.Equal("action", kvp.Key); 377Assert.Equal("controller", kvp.Key); 382Assert.Equal("slug", kvp.Key); 387Assert.Equal("state", kvp.Key);
Routing\UrlHelperExtensionsTest.cs (30)
44Assert.Equal("page", value.Key); 92Assert.Equal("id", value.Key); 97Assert.Equal("page", value.Key); 124Assert.Equal("id", value.Key); 129Assert.Equal("page", value.Key); 156Assert.Equal("id", value.Key); 161Assert.Equal("page", value.Key); 188Assert.Equal("id", value.Key); 193Assert.Equal("page", value.Key); 198Assert.Equal("handler", value.Key); 238Assert.Equal("id", value.Key); 243Assert.Equal("page", value.Key); 287Assert.Equal("id", value.Key); 292Assert.Equal("page", value.Key); 330Assert.Equal("id", value.Key); 335Assert.Equal("page", value.Key); 340Assert.Equal("handler", value.Key); 378Assert.Equal("handler", value.Key); 383Assert.Equal("page", value.Key); 421Assert.Equal("handler", value.Key); 426Assert.Equal("page", value.Key); 456Assert.Equal("page", value.Key); 483Assert.Equal("page", value.Key); 527Assert.Equal("page", value.Key); 587Assert.Collection(Assert.IsType<RouteValueDictionary>(actual.Values).OrderBy(v => v.Key), 590Assert.Equal("area", value.Key); 595Assert.Equal("page", value.Key); 746Assert.Equal("page", value.Key); 794Assert.Equal("page", value.Key); 842Assert.Equal("page", value.Key);
ValidationProblemDetailsTest.cs (5)
40Assert.Equal("key1", item.Key); 45Assert.Equal("key3", item.Key); 70Assert.Equal("unsafeError", item.Key); 94Assert.Equal("key1", item.Key); 99Assert.Equal("key2", item.Key);
Microsoft.AspNetCore.Mvc.Core.TestCommon (2)
LinkBuilder.cs (2)
29Values.Add("link_" + kvp.Key, kvp.Value); 37return Url + "?" + string.Join("&", Values.Select(kvp => kvp.Key + "=" + kvp.Value));
Microsoft.AspNetCore.Mvc.DataAnnotations.Test (117)
CompareAttributeAdapterTest.cs (18)
41kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); }, 42kvp => { Assert.Equal("data-val-equalto", kvp.Key); Assert.Equal(expectedMessage, kvp.Value); }, 45Assert.Equal("data-val-equalto-other", kvp.Key); 84kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); }, 85kvp => { Assert.Equal("data-val-equalto", kvp.Key); Assert.Equal(expectedMessage, kvp.Value); }, 88Assert.Equal("data-val-equalto-other", kvp.Key); 119kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); }, 120kvp => { Assert.Equal("data-val-equalto", kvp.Key); Assert.Equal(expectedMessage, kvp.Value); }, 123Assert.Equal("data-val-equalto-other", kvp.Key); 156kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); }, 157kvp => { Assert.Equal("data-val-equalto", kvp.Key); Assert.Equal(expectedMessage, kvp.Value); }, 160Assert.Equal("data-val-equalto-other", kvp.Key); 196kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); }, 197kvp => { Assert.Equal("data-val-equalto", kvp.Key); Assert.Equal(expectedMessage, kvp.Value); }, 200Assert.Equal("data-val-equalto-other", kvp.Key); 233kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("original", kvp.Value); }, 234kvp => { Assert.Equal("data-val-equalto", kvp.Key); Assert.Equal("original", kvp.Value); }, 235kvp => { Assert.Equal("data-val-equalto-other", kvp.Key); Assert.Equal("original", kvp.Value); });
DataAnnotationsMetadataProviderTest.cs (16)
288Assert.Equal("Name from DisplayNameAttribute", e.Key.Name); 1033Assert.Equal("Loc_Two_Name", groupTwo.Key.Name); 1038Assert.Equal("Loc_Two_Name", groupTwo.Key.Name); 1053Assert.Equal("Loc_Two_Name en-US", groupTwo.Key.Name); 1058Assert.Equal("Loc_Two_Name fr-FR", groupTwo.Key.Name); 1073Assert.Equal("type three name en-US", groupThree.Key.Name); 1078Assert.Equal("type three name fr-FR", groupThree.Key.Name); 1093Assert.Equal("type three name en-US", groupThree.Key.Name); 1098Assert.Equal("type three name fr-FR", groupThree.Key.Name); 1600var property = type.GetProperty(nameof(KeyValuePair<string, object>.Key)); 1617var property = type.GetProperty(nameof(KeyValuePair<string, object>.Key))!; 1747return x.Key.Name.Equals(y.Key.Name, StringComparison.Ordinal) 1748&& x.Key.Group.Equals(y.Key.Group, StringComparison.Ordinal); 1756return obj.Key.GetHashCode();
FileExtensionsAttributeAdapterTest.cs (12)
41kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); }, 42kvp => { Assert.Equal("data-val-fileextensions", kvp.Key); Assert.Equal(expectedErrorMessage, kvp.Value); }, 43kvp => { Assert.Equal("data-val-fileextensions-extensions", kvp.Key); Assert.Equal(expectedExtensions, kvp.Value); }); 92kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); }, 93kvp => { Assert.Equal("data-val-fileextensions", kvp.Key); Assert.Equal(expectedErrorMessage, kvp.Value); }, 94kvp => { Assert.Equal("data-val-fileextensions-extensions", kvp.Key); Assert.Equal(expectedExtensions, kvp.Value); }); 127kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); }, 128kvp => { Assert.Equal("data-val-fileextensions", kvp.Key); Assert.Equal(expectedErrorMessage, kvp.Value); }, 129kvp => { Assert.Equal("data-val-fileextensions-extensions", kvp.Key); Assert.Equal(expectedExtensions, kvp.Value); }); 156kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("original", kvp.Value); }, 157kvp => { Assert.Equal("data-val-fileextensions", kvp.Key); Assert.Equal("original", kvp.Value); }, 158kvp => { Assert.Equal("data-val-fileextensions-extensions", kvp.Key); Assert.Equal("original", kvp.Value); });
MaxLengthAttributeAdapterTest.cs (15)
44kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); }, 45kvp => { Assert.Equal("data-val-maxlength", kvp.Key); Assert.Equal(expectedMessage, kvp.Value); }, 46kvp => { Assert.Equal("data-val-maxlength-max", kvp.Key); Assert.Equal("10", kvp.Value); }); 71kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); }, 72kvp => { Assert.Equal("data-val-maxlength", kvp.Key); Assert.Equal(expectedMessage, kvp.Value); }, 73kvp => { Assert.Equal("data-val-maxlength-max", kvp.Key); Assert.Equal("10", kvp.Value); }); 100kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); }, 101kvp => { Assert.Equal("data-val-maxlength", kvp.Key); Assert.Equal(expectedMessage, kvp.Value); }, 102kvp => { Assert.Equal("data-val-maxlength-max", kvp.Key); Assert.Equal("5", kvp.Value); }); 133kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); }, 134kvp => { Assert.Equal("data-val-maxlength", kvp.Key); Assert.Equal(expectedMessage, kvp.Value); }, 135kvp => { Assert.Equal("data-val-maxlength-max", kvp.Key); Assert.Equal("10", kvp.Value); }); 164kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("original", kvp.Value); }, 165kvp => { Assert.Equal("data-val-maxlength", kvp.Key); Assert.Equal("original", kvp.Value); }, 166kvp => { Assert.Equal("data-val-maxlength-max", kvp.Key); Assert.Equal("original", kvp.Value); });
MinLengthAttributeAdapterTest.cs (12)
44kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); }, 45kvp => { Assert.Equal("data-val-minlength", kvp.Key); Assert.Equal(expectedMessage, kvp.Value); }, 46kvp => { Assert.Equal("data-val-minlength-min", kvp.Key); Assert.Equal("6", kvp.Value); }); 71kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); }, 72kvp => { Assert.Equal("data-val-minlength", kvp.Key); Assert.Equal(expectedMessage, kvp.Value); }, 73kvp => { Assert.Equal("data-val-minlength-min", kvp.Key); Assert.Equal("6", kvp.Value); }); 99kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); }, 100kvp => { Assert.Equal("data-val-minlength", kvp.Key); Assert.Equal(expectedMessage, kvp.Value); }, 101kvp => { Assert.Equal("data-val-minlength-min", kvp.Key); Assert.Equal("2", kvp.Value); }); 129kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("original", kvp.Value); }, 130kvp => { Assert.Equal("data-val-minlength", kvp.Key); Assert.Equal("original", kvp.Value); }, 131kvp => { Assert.Equal("data-val-minlength-min", kvp.Key); Assert.Equal("original", kvp.Value); });
NumericClientModelValidatorTest.cs (10)
34kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); }, 35kvp => { Assert.Equal("data-val-number", kvp.Key); Assert.Equal(expectedMessage, kvp.Value); }); 66kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); }, 67kvp => { Assert.Equal("data-val-number", kvp.Key); Assert.Equal(expectedMessage, kvp.Value); }); 98kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); }, 99kvp => { Assert.Equal("data-val-number", kvp.Key); Assert.Equal(expectedMessage, kvp.Value); }); 124kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); }, 125kvp => { Assert.Equal("data-val-number", kvp.Key); Assert.Equal(expectedMessage, kvp.Value); }); 150kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("original", kvp.Value); }, 151kvp => { Assert.Equal("data-val-number", kvp.Key); Assert.Equal("original", kvp.Value); });
RangeAttributeAdapterTest.cs (12)
38kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); }, 39kvp => { Assert.Equal("data-val-range", kvp.Key); Assert.Equal(expectedMessage, kvp.Value); }, 40kvp => { Assert.Equal("data-val-range-max", kvp.Key); Assert.Equal("100", kvp.Value); }, 41kvp => { Assert.Equal("data-val-range-min", kvp.Key); Assert.Equal("0", kvp.Value); }); 74kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); }, 75kvp => { Assert.Equal("data-val-range", kvp.Key); Assert.Equal(expectedMessage, kvp.Value); }, 76kvp => { Assert.Equal("data-val-range-max", kvp.Key); Assert.Equal("100", kvp.Value); }, 77kvp => { Assert.Equal("data-val-range-min", kvp.Key); Assert.Equal("0", kvp.Value); }); 107kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("original", kvp.Value); }, 108kvp => { Assert.Equal("data-val-range", kvp.Key); Assert.Equal("original", kvp.Value); }, 109kvp => { Assert.Equal("data-val-range-max", kvp.Key); Assert.Equal("original", kvp.Value); }, 110kvp => { Assert.Equal("data-val-range-min", kvp.Key); Assert.Equal("original", kvp.Value); });
RequiredAttributeAdapterTest.cs (6)
45kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); }, 46kvp => { Assert.Equal("data-val-required", kvp.Key); Assert.Equal(expectedMessage, kvp.Value); }); 70kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); }, 71kvp => { Assert.Equal("data-val-required", kvp.Key); Assert.Equal(expectedMessage, kvp.Value); }); 98kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("original", kvp.Value); }, 99kvp => { Assert.Equal("data-val-required", kvp.Key); Assert.Equal("original", kvp.Value); });
StringLengthAttributeAdapterTest.cs (16)
45kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); }, 46kvp => { Assert.Equal("data-val-length", kvp.Key); Assert.Equal(expectedMessage, kvp.Value); }, 47kvp => { Assert.Equal("data-val-length-max", kvp.Key); Assert.Equal("8", kvp.Value); }); 72kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); }, 73kvp => { Assert.Equal("data-val-length", kvp.Key); Assert.Equal(expectedMessage, kvp.Value); }, 74kvp => { Assert.Equal("data-val-length-max", kvp.Key); Assert.Equal("8", kvp.Value); }); 99kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); }, 100kvp => { Assert.Equal("data-val-length", kvp.Key); Assert.Equal(expectedMessage, kvp.Value); }, 101kvp => { Assert.Equal("data-val-length-max", kvp.Key); Assert.Equal("10", kvp.Value); }, 102kvp => { Assert.Equal("data-val-length-min", kvp.Key); Assert.Equal("3", kvp.Value); }); 127kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); }, 128kvp => { Assert.Equal("data-val-length", kvp.Key); Assert.Equal(expectedMessage, kvp.Value); }); 158kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("original", kvp.Value); }, 159kvp => { Assert.Equal("data-val-length", kvp.Key); Assert.Equal("original", kvp.Value); }, 160kvp => { Assert.Equal("data-val-length-max", kvp.Key); Assert.Equal("original", kvp.Value); }, 161kvp => { Assert.Equal("data-val-length-min", kvp.Key); Assert.Equal("original", kvp.Value); });
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.Formatters.Xml.Test (17)
ProblemDetailsWrapperTest.cs (4)
38problemDetails.Extensions.OrderBy(kvp => kvp.Key), 41Assert.Empty(kvp.Key); 46Assert.Equal("[key2]", kvp.Key); 51Assert.Equal("key1", kvp.Key);
SerializableErrorWrapperTests.cs (4)
75Assert.Equal(string.Empty, kvp.Key); 80Assert.Equal("key1", kvp.Key); 85Assert.Equal("key2", kvp.Key); 90Assert.Equal("list[3].key3", kvp.Key);
ValidationProblemDetailsWrapperTest.cs (9)
42problemDetails.Extensions.OrderBy(kvp => kvp.Key), 45Assert.Equal("[key2]", kvp.Key); 50Assert.Equal("key1", kvp.Key); 55problemDetails.Errors.OrderBy(kvp => kvp.Key), 58Assert.Empty(kvp.Key); 63Assert.Equal("[error2]", kvp.Key); 68Assert.Equal("error1", kvp.Key); 101Assert.Equal("key1", kvp.Key); 106Assert.Equal("[key2]", kvp.Key);
Microsoft.AspNetCore.Mvc.FunctionalTests (32)
ApiBehaviorTest.cs (7)
74problemDetails.Errors.OrderBy(kvp => kvp.Key), 77Assert.Equal("Name", kvp.Key); 83Assert.Equal("Zip", kvp.Key); 93Assert.Equal("traceId", kvp.Key); 311Assert.Equal("traceId", kvp.Key); 373Assert.Equal("tracking-id", kvp.Key); 381Assert.Equal("Error1", kvp.Key);
BasicTests.cs (4)
632problem.Errors.OrderBy(e => e.Key), 635Assert.Equal("ConfirmPassword", kvp.Key); 640Assert.Equal("UserName", kvp.Key); 661Assert.Empty(kvp.Key);
CorsTestsBase.cs (4)
56Assert.Equal(CorsConstants.AccessControlAllowOrigin, header.Key); 133response.Headers.OrderBy(h => h.Key), 136Assert.Equal(CorsConstants.AccessControlAllowMethods, h.Key); 141Assert.Equal(CorsConstants.AccessControlAllowOrigin, h.Key);
HtmlGenerationTest.cs (1)
207Assert.Equal(attribute.Value, imgElement.GetAttribute(attribute.Key));
InputFormatterTests.cs (3)
195Assert.Empty(kvp.Key); 213Assert.Empty(kvp.Key); 218Assert.NotEmpty(kvp.Key);
InputObjectValidationTests.cs (3)
306Assert.Empty(error.Key); 335Assert.Equal("isbn", error.Key); 367Assert.Empty(error.Key);
JsonInputFormatterTestBase.cs (4)
163problem.Errors.OrderBy(e => e.Key), 166Assert.Equal("Id", kvp.Key); 171Assert.Equal("Name", kvp.Key); 176Assert.Equal("StreetName", kvp.Key);
JsonOutputFormatterTestBase.cs (2)
67var errors = Assert.Single(modelStateErrors, kvp => kvp.Key == "Id").Value; 72errors = Assert.Single(modelStateErrors, kvp => kvp.Key == "Name").Value;
ReadFromDisconnectedClientTest.cs (1)
68Assert.Empty(error.Key);
RoutingTestsBase.cs (3)
167Assert.Single(result.DataTokens, kvp => kvp.Key == "actionName" && ((string)kvp.Value) == "DataTokens"); 179Assert.Single(result.DataTokens, kvp => kvp.Key == "actionName" && ((string)kvp.Value) == "Conventional"); 198Assert.Single(result, kvp => kvp.Key == "hasDataTokens" && ((bool)kvp.Value) == true);
Microsoft.AspNetCore.Mvc.IntegrationTests (580)
ActionParametersIntegrationTest.cs (2)
113Assert.Equal("Address[0].Street", entry.Key); 293Assert.Equal("prefix.Address[0].Street", entry.Key);
ArrayModelBinderIntegrationTest.cs (12)
44var entry = Assert.Single(modelState, kvp => kvp.Key == "parameter[0]").Value; 48entry = Assert.Single(modelState, kvp => kvp.Key == "parameter[1]").Value; 88var entry = Assert.Single(modelState, kvp => kvp.Key == "prefix[0]").Value; 92entry = Assert.Single(modelState, kvp => kvp.Key == "prefix[1]").Value; 128var entry = Assert.Single(modelState, kvp => kvp.Key == "[0]").Value; 132entry = Assert.Single(modelState, kvp => kvp.Key == "[1]").Value; 204var entry = Assert.Single(modelState, kvp => kvp.Key == "parameter[0].Name").Value; 208entry = Assert.Single(modelState, kvp => kvp.Key == "parameter[1].Name").Value; 249var entry = Assert.Single(modelState, kvp => kvp.Key == "prefix[0].Name").Value; 253entry = Assert.Single(modelState, kvp => kvp.Key == "prefix[1].Name").Value; 290var entry = Assert.Single(modelState, kvp => kvp.Key == "[0].Name").Value; 294entry = Assert.Single(modelState, kvp => kvp.Key == "[1].Name").Value;
BinderTypeBasedModelBinderIntegrationTest.cs (2)
182Assert.Equal("Street", kvp.Key); 234Assert.Equal("Address.Street", kvp.Key);
BodyValidationIntegrationTests.cs (4)
478Assert.Equal("CustomParameter.Address", entry.Key); 638Assert.Equal("CustomParameter.Address", entry.Key); 735Assert.Equal("CustomParameter.Address.Street", entry.Key); 908result.Add(item.Key, errorMessage);
ByteArrayModelBinderIntegrationTest.cs (2)
62Assert.Equal(queryStringKey, entry.Key); 143Assert.Equal("CustomParameter", entry.Key);
CollectionModelBinderIntegrationTest.cs (27)
50var entry = Assert.Single(modelState, kvp => kvp.Key == "parameter[0]").Value; 54entry = Assert.Single(modelState, kvp => kvp.Key == "parameter[1]").Value; 320var entry = Assert.Single(modelState, kvp => kvp.Key == "parameter[0].Id").Value; 324entry = Assert.Single(modelState, kvp => kvp.Key == "parameter[1].Id").Value; 328entry = Assert.Single(modelState, kvp => kvp.Key == "parameter[0].Name").Value; 334entry = Assert.Single(modelState, kvp => kvp.Key == "parameter[1].Name").Value; 379var entry = Assert.Single(modelState, kvp => kvp.Key == "prefix[0].Id").Value; 383entry = Assert.Single(modelState, kvp => kvp.Key == "prefix[1].Id").Value; 387entry = Assert.Single(modelState, kvp => kvp.Key == "prefix[0].Name").Value; 391entry = Assert.Single(modelState, kvp => kvp.Key == "prefix[1].Name").Value; 430var entry = Assert.Single(modelState, kvp => kvp.Key == "[0].Id").Value; 434entry = Assert.Single(modelState, kvp => kvp.Key == "[1].Id").Value; 438entry = Assert.Single(modelState, kvp => kvp.Key == "[0].Name").Value; 442entry = Assert.Single(modelState, kvp => kvp.Key == "[1].Name").Value; 480var entry = Assert.Single(modelState, kvp => kvp.Key == "parameter[low]").Value; 485entry = Assert.Single(modelState, kvp => kvp.Key == "parameter[high]").Value; 525var entry = Assert.Single(modelState, kvp => kvp.Key == "[low].Id").Value; 529entry = Assert.Single(modelState, kvp => kvp.Key == "[high].Id").Value; 533entry = Assert.Single(modelState, kvp => kvp.Key == "[low].Name").Value; 537entry = Assert.Single(modelState, kvp => kvp.Key == "[high].Name").Value; 620var entry = Assert.Single(modelState, kvp => kvp.Key == "Addresses[Key1].Street").Value; 624entry = Assert.Single(modelState, kvp => kvp.Key == "Addresses[Key2].Street").Value; 677Assert.Equal("Addresses[Key1].Street", kvp.Key); 1165Assert.Equal("[0]", kvp.Key); 1170Assert.Equal("[1]", kvp.Key); 1214Assert.Equal("[0]", kvp.Key); 1219Assert.Equal("[1]", kvp.Key);
ComplexRecordIntegrationTest.cs (135)
76var entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value; 126var entry = Assert.Single(modelState, e => e.Key == "Customer.Name").Value; 177var entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value; 231var entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value; 377var entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value; 381entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Token").Value; 429var entry = Assert.Single(modelState, e => e.Key == "Customer.Name").Value; 433entry = Assert.Single(modelState, e => e.Key == "Customer.Token").Value; 481var entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value; 534var entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value; 538entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Documents").Value; 587var entry = Assert.Single(modelState, e => e.Key == "Customer.Name").Value; 591entry = Assert.Single(modelState, e => e.Key == "Customer.Documents").Value; 641Assert.Equal("parameter.Customer.Name", kvp.Key); 698Assert.Single(modelState, e => e.Key == "parameter.Customer.Documents"); 699var entry = Assert.Single(modelState, e => e.Key == "parameter.ProductId").Value; 753Assert.Equal("Customer.Documents", entry.Key); 801var entry = Assert.Single(modelState, e => e.Key == "parameter.Name").Value; 805entry = Assert.Single(modelState, e => e.Key == "parameter.ProductIds[0]").Value; 809entry = Assert.Single(modelState, e => e.Key == "parameter.ProductIds[1]").Value; 856var entry = Assert.Single(modelState, e => e.Key == "Name").Value; 860entry = Assert.Single(modelState, e => e.Key == "ProductIds[0]").Value; 864entry = Assert.Single(modelState, e => e.Key == "ProductIds[1]").Value; 911var entry = Assert.Single(modelState, e => e.Key == "parameter.Name").Value; 1004var entry = Assert.Single(modelState, e => e.Key == "parameter.Name").Value; 1008entry = Assert.Single(modelState, e => e.Key == "parameter.ProductIds[0]").Value; 1012entry = Assert.Single(modelState, e => e.Key == "parameter.ProductIds[1]").Value; 1059var entry = Assert.Single(modelState, e => e.Key == "Name").Value; 1063entry = Assert.Single(modelState, e => e.Key == "ProductIds[0]").Value; 1067entry = Assert.Single(modelState, e => e.Key == "ProductIds[1]").Value; 1114var entry = Assert.Single(modelState, e => e.Key == "parameter.Name").Value; 1207var entry = Assert.Single(modelState, e => e.Key == "parameter.Name").Value; 1211entry = Assert.Single(modelState, e => e.Key == "parameter.ProductIds[0].Key").Value; 1215entry = Assert.Single(modelState, e => e.Key == "parameter.ProductIds[0].Value").Value; 1262var entry = Assert.Single(modelState, e => e.Key == "Name").Value; 1266entry = Assert.Single(modelState, e => e.Key == "ProductIds[0].Key").Value; 1270entry = Assert.Single(modelState, e => e.Key == "ProductIds[0].Value").Value; 1317var entry = Assert.Single(modelState, e => e.Key == "parameter.Name").Value; 1422Assert.Equal("camera_specs", e.Key); 1436Assert.Equal("tyre_specs", e.Key); 1453var entry = Assert.Single(modelState, e => e.Key == "p.Name").Value; 1457entry = Assert.Single(modelState, e => e.Key == "p.Specs[0].Key").Value; 1461entry = Assert.Single(modelState, e => e.Key == "p.Specs[0].Value[0].Name").Value; 1465entry = Assert.Single(modelState, e => e.Key == "p.Specs[0].Value[1].Name").Value; 1469entry = Assert.Single(modelState, e => e.Key == "p.Specs[1].Key").Value; 1473entry = Assert.Single(modelState, e => e.Key == "p.Specs[1].Value[0].Name").Value; 1477entry = Assert.Single(modelState, e => e.Key == "p.Specs[1].Value[1].Name").Value; 1529Assert.Equal("camera_specs", e.Key); 1543Assert.Equal("tyre_specs", e.Key); 1560var entry = Assert.Single(modelState, e => e.Key == "p.Name").Value; 1564entry = Assert.Single(modelState, e => e.Key == "p.Specs[0].Key").Value; 1568entry = Assert.Single(modelState, e => e.Key == "p.Specs[0].Value[0].Name").Value; 1572entry = Assert.Single(modelState, e => e.Key == "p.Specs[0].Value[1].Name").Value; 1576entry = Assert.Single(modelState, e => e.Key == "p.Specs[1].Key").Value; 1580entry = Assert.Single(modelState, e => e.Key == "p.Specs[1].Value[0].Name").Value; 1584entry = Assert.Single(modelState, e => e.Key == "p.Specs[1].Value[1].Name").Value; 1636Assert.Equal("camera_specs", e.Key); 1650Assert.Equal("tyre_specs", e.Key); 1667var entry = Assert.Single(modelState, e => e.Key == "p.Name").Value; 1671entry = Assert.Single(modelState, e => e.Key == "p.Specs[0].Key").Value; 1675entry = Assert.Single(modelState, e => e.Key == "p.Specs[0].Value[0].Name").Value; 1679entry = Assert.Single(modelState, e => e.Key == "p.Specs[0].Value[1].Name").Value; 1683entry = Assert.Single(modelState, e => e.Key == "p.Specs[1].Key").Value; 1687entry = Assert.Single(modelState, e => e.Key == "p.Specs[1].Value[0].Name").Value; 1691entry = Assert.Single(modelState, e => e.Key == "p.Specs[1].Value[1].Name").Value; 1741var entry = Assert.Single(modelState, e => e.Key == "parameter.Name").Value; 1745entry = Assert.Single(modelState, e => e.Key == "parameter.ProductId.Key").Value; 1749entry = Assert.Single(modelState, e => e.Key == "parameter.ProductId.Value").Value; 1796var entry = Assert.Single(modelState, e => e.Key == "Name").Value; 1800entry = Assert.Single(modelState, e => e.Key == "ProductId.Key").Value; 1804entry = Assert.Single(modelState, e => e.Key == "ProductId.Value").Value; 1859Assert.Equal("spec1", e.Key); 1864Assert.Equal("spec2", e.Key); 1872var entry = Assert.Single(modelState, e => e.Key == "p.Name").Value; 1876entry = Assert.Single(modelState, e => e.Key == "p.Specs.Key").Value; 1880entry = Assert.Single(modelState, e => e.Key == "p.Specs.Value[0].Key").Value; 1884entry = Assert.Single(modelState, e => e.Key == "p.Specs.Value[0].Value").Value; 1888entry = Assert.Single(modelState, e => e.Key == "p.Specs.Value[1].Key").Value; 1892entry = Assert.Single(modelState, e => e.Key == "p.Specs.Value[1].Value").Value; 1991var entry = Assert.Single(modelState, e => e.Key == "Customer").Value; 2047var entry = Assert.Single(modelState, e => e.Key == "Customer").Value; 2101var entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Id").Value; 2105entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value; 2155var entry = Assert.Single(modelState, e => e.Key == "Customer.Id").Value; 2159entry = Assert.Single(modelState, e => e.Key == "Customer.Name").Value; 2213var entry = Assert.Single(modelState, e => e.Key == "customParameter.Customer.Id").Value; 2217entry = Assert.Single(modelState, e => e.Key == "customParameter.Customer.Name").Value; 2267var entry = Assert.Single(modelState, e => e.Key == "ProductName").Value; 2319var entry = Assert.Single(modelState, e => e.Key == "customParameter.ProductName").Value; 2367var entry = Assert.Single(modelState, e => e.Key == "ProductName").Value; 2415var entry = Assert.Single(modelState, e => e.Key == "OrderIds").Value; 2467var entry = Assert.Single(modelState, e => e.Key == "customParameter.OrderIds").Value; 2514var entry = Assert.Single(modelState, e => e.Key == "OrderIds[0]").Value; 2565var entry = Assert.Single(modelState, e => e.Key == "parameter.ProductId").Value; 2616Assert.Equal("parameter.ProductId", entry.Key); 2675Assert.Equal("HomeAddress.Street", kvp.Key); 2723Assert.Equal("HomeAddress.Street", kvp.Key); 2783Assert.Equal("Address.Street", kvp.Key); 2836Assert.Equal("Street", kvp.Key); 2936Assert.Equal("location1", model.Info.Key); 2946var entry = Assert.Single(modelState, e => e.Key == "Id").Value; 2950entry = Assert.Single(modelState, e => e.Key == "Info.Key").Value; 2954entry = Assert.Single(modelState, e => e.Key == "Info.Value.Zipcode").Value; 2958entry = Assert.Single(modelState, e => e.Key == "Info.Value.GpsCoordinates").Value; 3013Assert.Equal("[0].Photo", state.Key); 3086Assert.Equal("parameter.InnerModels[0].Rate", kvp.Key); 3094Assert.Equal("parameter.InnerModels[1].Rate", kvp.Key); 3149Assert.Equal("Photo", state.Key); 3211Assert.Equal("Photo", kvp.Key); 3218Assert.Equal("Mother.Photo", kvp.Key); 3519Assert.Equal("Name", entry.Key); 3562Assert.Equal("Age", entry.Key); 3605var entry = Assert.Single(modelState, m => m.Key == "Age"); 3609entry = Assert.Single(modelState, m => m.Key == "Name"); 3656Assert.Equal("Name", entry.Key); 3702Assert.Equal("Name", entry.Key); 3754Assert.Single(modelState, e => e.Key == "Name"); 3755Assert.Single(modelState, e => e.Key == "Id"); 3797Assert.Equal("Name", entry.Key); 3842Assert.Single(modelState, e => e.Key == "Id"); 3843Assert.Single(modelState, e => e.Key == "Tags[0]"); 3844Assert.Single(modelState, e => e.Key == "Tags[1]"); 3884var entry = Assert.Single(modelState, e => e.Key == "Id"); 3929Assert.Single(modelState, e => e.Key == "Id"); 3930Assert.Single(modelState, e => e.Key == "Tags[0]"); 3931Assert.Single(modelState, e => e.Key == "Tags[1]"); 3975Assert.Single(modelState, e => e.Key == "Id"); 3976Assert.Single(modelState, e => e.Key == "Tags[0]"); 3977Assert.Single(modelState, e => e.Key == "Tags[1]"); 4061Assert.Equal("Tags[0]", entry.Key); 4104Assert.Equal("parameter.Tags[0]", entry.Key); 4150Assert.Single(modelState, m => m.Key == "Age"); 4151Assert.Single(modelState, m => m.Key == "Name"); 4195var entry = Assert.Single(modelState, m => m.Key == "Age"); 4198entry = Assert.Single(modelState, m => m.Key == "Name");
ComplexTypeIntegrationTestBase.cs (112)
113var entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value; 163var entry = Assert.Single(modelState, e => e.Key == "Customer.Name").Value; 214var entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value; 370var entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value; 374entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Token").Value; 422var entry = Assert.Single(modelState, e => e.Key == "Customer.Name").Value; 426entry = Assert.Single(modelState, e => e.Key == "Customer.Token").Value; 474var entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value; 537var entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value; 541entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Documents").Value; 590var entry = Assert.Single(modelState, e => e.Key == "Customer.Name").Value; 594entry = Assert.Single(modelState, e => e.Key == "Customer.Documents").Value; 644Assert.Equal("parameter.Customer.Name", kvp.Key); 701Assert.Single(modelState, e => e.Key == "parameter.Customer.Documents"); 702var entry = Assert.Single(modelState, e => e.Key == "parameter.ProductId").Value; 756Assert.Equal("Customer.Documents", entry.Key); 809var entry = Assert.Single(modelState, e => e.Key == "parameter.Name").Value; 813entry = Assert.Single(modelState, e => e.Key == "parameter.ProductIds[0]").Value; 817entry = Assert.Single(modelState, e => e.Key == "parameter.ProductIds[1]").Value; 864var entry = Assert.Single(modelState, e => e.Key == "Name").Value; 868entry = Assert.Single(modelState, e => e.Key == "ProductIds[0]").Value; 872entry = Assert.Single(modelState, e => e.Key == "ProductIds[1]").Value; 919var entry = Assert.Single(modelState, e => e.Key == "parameter.Name").Value; 1017var entry = Assert.Single(modelState, e => e.Key == "parameter.Name").Value; 1021entry = Assert.Single(modelState, e => e.Key == "parameter.ProductIds[0]").Value; 1025entry = Assert.Single(modelState, e => e.Key == "parameter.ProductIds[1]").Value; 1072var entry = Assert.Single(modelState, e => e.Key == "Name").Value; 1076entry = Assert.Single(modelState, e => e.Key == "ProductIds[0]").Value; 1080entry = Assert.Single(modelState, e => e.Key == "ProductIds[1]").Value; 1127var entry = Assert.Single(modelState, e => e.Key == "parameter.Name").Value; 1225var entry = Assert.Single(modelState, e => e.Key == "parameter.Name").Value; 1229entry = Assert.Single(modelState, e => e.Key == "parameter.ProductIds[0].Key").Value; 1233entry = Assert.Single(modelState, e => e.Key == "parameter.ProductIds[0].Value").Value; 1280var entry = Assert.Single(modelState, e => e.Key == "Name").Value; 1284entry = Assert.Single(modelState, e => e.Key == "ProductIds[0].Key").Value; 1288entry = Assert.Single(modelState, e => e.Key == "ProductIds[0].Value").Value; 1335var entry = Assert.Single(modelState, e => e.Key == "parameter.Name").Value; 1458Assert.Equal("camera_specs", e.Key); 1472Assert.Equal("tyre_specs", e.Key); 1489var entry = Assert.Single(modelState, e => e.Key == "p.Name").Value; 1493entry = Assert.Single(modelState, e => e.Key == "p.Specs[0].Key").Value; 1497entry = Assert.Single(modelState, e => e.Key == "p.Specs[0].Value[0].Name").Value; 1501entry = Assert.Single(modelState, e => e.Key == "p.Specs[0].Value[1].Name").Value; 1505entry = Assert.Single(modelState, e => e.Key == "p.Specs[1].Key").Value; 1509entry = Assert.Single(modelState, e => e.Key == "p.Specs[1].Value[0].Name").Value; 1513entry = Assert.Single(modelState, e => e.Key == "p.Specs[1].Value[1].Name").Value; 1565Assert.Equal("camera_specs", e.Key); 1579Assert.Equal("tyre_specs", e.Key); 1596var entry = Assert.Single(modelState, e => e.Key == "p.Name").Value; 1600entry = Assert.Single(modelState, e => e.Key == "p.Specs[0].Key").Value; 1604entry = Assert.Single(modelState, e => e.Key == "p.Specs[0].Value[0].Name").Value; 1608entry = Assert.Single(modelState, e => e.Key == "p.Specs[0].Value[1].Name").Value; 1612entry = Assert.Single(modelState, e => e.Key == "p.Specs[1].Key").Value; 1616entry = Assert.Single(modelState, e => e.Key == "p.Specs[1].Value[0].Name").Value; 1620entry = Assert.Single(modelState, e => e.Key == "p.Specs[1].Value[1].Name").Value; 1672Assert.Equal("camera_specs", e.Key); 1686Assert.Equal("tyre_specs", e.Key); 1703var entry = Assert.Single(modelState, e => e.Key == "p.Name").Value; 1707entry = Assert.Single(modelState, e => e.Key == "p.Specs[0].Key").Value; 1711entry = Assert.Single(modelState, e => e.Key == "p.Specs[0].Value[0].Name").Value; 1715entry = Assert.Single(modelState, e => e.Key == "p.Specs[0].Value[1].Name").Value; 1719entry = Assert.Single(modelState, e => e.Key == "p.Specs[1].Key").Value; 1723entry = Assert.Single(modelState, e => e.Key == "p.Specs[1].Value[0].Name").Value; 1727entry = Assert.Single(modelState, e => e.Key == "p.Specs[1].Value[1].Name").Value; 1782var entry = Assert.Single(modelState, e => e.Key == "parameter.Name").Value; 1786entry = Assert.Single(modelState, e => e.Key == "parameter.ProductId.Key").Value; 1790entry = Assert.Single(modelState, e => e.Key == "parameter.ProductId.Value").Value; 1837var entry = Assert.Single(modelState, e => e.Key == "Name").Value; 1841entry = Assert.Single(modelState, e => e.Key == "ProductId.Key").Value; 1845entry = Assert.Single(modelState, e => e.Key == "ProductId.Value").Value; 1891var entry = Assert.Single(modelState, e => e.Key == "parameter.Name").Value; 1895entry = Assert.Single(modelState, e => e.Key == "parameter.ProductId.Key").Value; 1940var entry = Assert.Single(modelState, e => e.Key == "ProductId.Key").Value; 1999Assert.Equal("spec1", e.Key); 2004Assert.Equal("spec2", e.Key); 2012var entry = Assert.Single(modelState, e => e.Key == "p.Name").Value; 2016entry = Assert.Single(modelState, e => e.Key == "p.Specs.Key").Value; 2020entry = Assert.Single(modelState, e => e.Key == "p.Specs.Value[0].Key").Value; 2024entry = Assert.Single(modelState, e => e.Key == "p.Specs.Value[0].Value").Value; 2028entry = Assert.Single(modelState, e => e.Key == "p.Specs.Value[1].Key").Value; 2032entry = Assert.Single(modelState, e => e.Key == "p.Specs.Value[1].Value").Value; 2145var entry = Assert.Single(modelState, e => e.Key == "Customer").Value; 2200var entry = Assert.Single(modelState, e => e.Key == "Customer").Value; 2263var entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Id").Value; 2267entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value; 2317var entry = Assert.Single(modelState, e => e.Key == "Customer.Id").Value; 2321entry = Assert.Single(modelState, e => e.Key == "Customer.Name").Value; 2375var entry = Assert.Single(modelState, e => e.Key == "customParameter.Customer.Id").Value; 2379entry = Assert.Single(modelState, e => e.Key == "customParameter.Customer.Name").Value; 2433var entry = Assert.Single(modelState, e => e.Key == "ProductName").Value; 2485var entry = Assert.Single(modelState, e => e.Key == "customParameter.ProductName").Value; 2533var entry = Assert.Single(modelState, e => e.Key == "ProductName").Value; 2585var entry = Assert.Single(modelState, e => e.Key == "OrderIds").Value; 2637var entry = Assert.Single(modelState, e => e.Key == "customParameter.OrderIds").Value; 2684var entry = Assert.Single(modelState, e => e.Key == "OrderIds[0]").Value; 2738var entry = Assert.Single(modelState, e => e.Key == "parameter.ProductId").Value; 2789Assert.Equal("parameter.ProductId", entry.Key); 2854Assert.Equal("HomeAddress.Street", kvp.Key); 2902Assert.Equal("HomeAddress.Street", kvp.Key); 2974Assert.Equal("Address.Street", kvp.Key); 3027Assert.Equal("Street", kvp.Key); 3140Assert.Equal("location1", model.Info.Key); 3150var entry = Assert.Single(modelState, e => e.Key == "Id").Value; 3154entry = Assert.Single(modelState, e => e.Key == "Info.Key").Value; 3158entry = Assert.Single(modelState, e => e.Key == "Info.Value.Zipcode").Value; 3162entry = Assert.Single(modelState, e => e.Key == "Info.Value.GpsCoordinates").Value; 3221Assert.Equal("[0].Photo", state.Key); 3301Assert.Equal("parameter.InnerModels[0].Rate", kvp.Key); 3309Assert.Equal("parameter.InnerModels[1].Rate", kvp.Key); 3371Assert.Equal("Photo", state.Key); 3433Assert.Equal("Photo", kvp.Key); 3440Assert.Equal("Mother.Photo", kvp.Key);
DictionaryModelBinderIntegrationTest.cs (25)
48var entry = Assert.Single(modelState, kvp => kvp.Key == "parameter[0].Key").Value; 52entry = Assert.Single(modelState, kvp => kvp.Key == "parameter[0].Value").Value; 88Assert.Equal("parameter[key0]", kvp.Key); 127var entry = Assert.Single(modelState, kvp => kvp.Key == "parameter[low].Key").Value; 132entry = Assert.Single(modelState, kvp => kvp.Key == "parameter[low].Value").Value; 1257model.OrderBy(kvp => kvp.Key), 1260Assert.Equal("key0", kvp.Key); 1265modelState.OrderBy(kvp => kvp.Key), 1268Assert.Equal("parameter[key0]", kvp.Key); 1311model.OrderBy(kvp => kvp.Key), 1314Assert.Equal("key0", kvp.Key); 1321Assert.Equal("key1", kvp.Key); 1328modelState.OrderBy(kvp => kvp.Key), 1331Assert.Equal("parameter[key0].Age", kvp.Key); 1337Assert.Equal("parameter[key0].Name", kvp.Key); 1342Assert.Equal("parameter[key1].Age", kvp.Key); 1347Assert.Equal("parameter[key1].Name", kvp.Key); 1464model.OrderBy(kvp => kvp.Key), 1467Assert.Equal("key0", kvp.Key); 1474Assert.Equal("key1", kvp.Key); 1481modelState.OrderBy(kvp => kvp.Key), 1484Assert.Equal("parameter[key0].Age", kvp.Key); 1490Assert.Equal("parameter[key0].Name", kvp.Key); 1495Assert.Equal("parameter[key1].Age", kvp.Key); 1500Assert.Equal("parameter[key1].Name", kvp.Key);
FormCollectionModelBindingIntegrationTest.cs (1)
68Assert.Equal("Address.Zip", entry.Key);
FormFileModelBindingIntegrationTest.cs (32)
114modelState.OrderBy(kvp => kvp.Key), 118Assert.Equal("Address.File", kvp.Key); 165modelState.OrderBy(kvp => kvp.Key), 169Assert.Equal("Parameter1.Address.File", kvp.Key); 228modelState.OrderBy(kvp => kvp.Key), 232Assert.Equal("Person.Address.File", kvp.Key); 240Assert.Equal("Person.Address.Zip", kvp.Key); 318modelState.OrderBy(kvp => kvp.Key), 322Assert.Equal("fleet.Garage.Name", kvp.Key); 330Assert.Equal("fleet.Garage.Vehicles[0].Spec", kvp.Key); 384modelState.OrderBy(kvp => kvp.Key), 388Assert.Equal("fleet.Garage.Name", kvp.Key); 396Assert.Equal("fleet.Garage.Vehicles[0].BackupVehicle.Spec", kvp.Key); 446modelState.OrderBy(kvp => kvp.Key), 450Assert.Equal("GroupName", kvp.Key); 458Assert.Equal("Person.Address.File", kvp.Key); 508Assert.Equal("files", kvp.Key); 597Assert.Equal("files", kvp.Key); 648Assert.Equal("CustomParameter", entry.Key); 737var entry = Assert.Single(modelState, e => e.Key == "p.Name").Value; 741Assert.Single(modelState, e => e.Key == "p.Specs"); 812var entry = Assert.Single(modelState, e => e.Key == "house.Garage.Cars[0].Name").Value; 816Assert.Single(modelState, e => e.Key == "house.Garage.Cars[0].Specs"); 817Assert.Single(modelState, e => e.Key == "house.Garage.Cars[1].Specs"); 877Assert.Single(modelState, e => e.Key == "house.Garage.Cars[0].Specs"); 878Assert.Single(modelState, e => e.Key == "house.Garage.Cars[1].Specs"); 979Assert.Equal("house.Garage.Cars[0].Specs", kvp.Key); 1024var entry = Assert.Single(modelState, e => e.Key == "p.Name").Value; 1028Assert.Single(modelState, e => e.Key == "p.Specs"); 1231container.Dictionary.OrderBy(kvp => kvp.Key), 1234Assert.Equal("key0", kvp.Key); 1239Assert.Equal("key1", kvp.Key);
GenericModelBinderIntegrationTest.cs (20)
285Assert.Equal("key0", kvp.Key); 292var entry = Assert.Single(modelState, e => e.Key == "parameter[0][0].Key").Value; 296entry = Assert.Single(modelState, e => e.Key == "parameter[0][0].Value").Value; 330Assert.Equal("key0", kvp.Key); 337var entry = Assert.Single(modelState, e => e.Key == "[0][0].Key").Value; 341entry = Assert.Single(modelState, e => e.Key == "[0][0].Value").Value; 409Assert.Equal("key0", kvp.Key); 416var entry = Assert.Single(modelState, e => e.Key == "parameter[0].Key").Value; 420entry = Assert.Single(modelState, e => e.Key == "parameter[0].Value").Value; 453Assert.Equal("key0", kvp.Key); 460var entry = Assert.Single(modelState, e => e.Key == "[0].Key").Value; 464entry = Assert.Single(modelState, e => e.Key == "[0].Value").Value; 533Assert.Equal("key0", kvp.Key); 540var entry = Assert.Single(modelState, e => e.Key == "parameter[0].Key").Value; 544entry = Assert.Single(modelState, e => e.Key == "parameter[0].Value[0]").Value; 548entry = Assert.Single(modelState, e => e.Key == "parameter[0].Value[1]").Value; 581Assert.Equal("key0", kvp.Key); 588var entry = Assert.Single(modelState, e => e.Key == "[0].Key").Value; 592entry = Assert.Single(modelState, e => e.Key == "[0].Value[0]").Value; 596entry = Assert.Single(modelState, e => e.Key == "[0].Value[1]").Value;
HeaderModelBinderIntegrationTest.cs (14)
102Assert.Equal("prefix.Address.Header", entry.Key); 144Assert.Equal("Address.Header", entry.Key); 189Assert.Equal("Header", kvp.Key); 236Assert.Equal("Header", kvp.Key); 298Assert.Equal("CustomParameter", entry.Key); 360modelState.OrderBy(kvp => kvp.Key), 363Assert.Equal("prefix.Manufacturer.ArrayOfString", kvp.Key); 372Assert.Equal("prefix.Manufacturer.EnumerableOfDouble", kvp.Key); 381Assert.Equal("prefix.Manufacturer.IntProperty", kvp.Key); 390Assert.Equal("prefix.Manufacturer.ListOfEnum", kvp.Key); 399Assert.Equal("prefix.Manufacturer.ListOfOrderWithTypeConverter", kvp.Key); 408Assert.Equal("prefix.Manufacturer.NoCommaString", kvp.Key); 417Assert.Equal("prefix.Manufacturer.NullableIntProperty", kvp.Key); 426Assert.Equal("prefix.Manufacturer.OneCommaSeparatedString", kvp.Key);
KeyValuePairModelBinderIntegrationTest.cs (30)
44var entry = Assert.Single(modelState, kvp => kvp.Key == "parameter.Key").Value; 48entry = Assert.Single(modelState, kvp => kvp.Key == "parameter.Value").Value; 79var entry = Assert.Single(modelState, kvp => kvp.Key == "parameter.Key").Value; 84entry = Assert.Single(modelState, kvp => kvp.Key == "parameter.Value").Value; 129var entry = Assert.Single(modelState, kvp => kvp.Key == "parameter.Key").Value; 134entry = Assert.Single(modelState, kvp => kvp.Key == "parameter.Value").Value; 166var entry = Assert.Single(modelState, kvp => kvp.Key == "parameter.Key").Value; 171entry = Assert.Single(modelState, kvp => kvp.Key == "parameter.Value").Value; 216var entry = Assert.Single(modelState, kvp => kvp.Key == "parameter.Key").Value; 221entry = Assert.Single(modelState, kvp => kvp.Key == "parameter.Value").Value; 262var entry = Assert.Single(modelState, kvp => kvp.Key == "prefix.Key").Value; 266entry = Assert.Single(modelState, kvp => kvp.Key == "prefix.Value").Value; 302var entry = Assert.Single(modelState, kvp => kvp.Key == "Key").Value; 306entry = Assert.Single(modelState, kvp => kvp.Key == "Value").Value; 340var entry = Assert.Single(modelState, kvp => kvp.Key == "Key").Value; 374Assert.Equal("key0", model.Key); 381var entry = Assert.Single(modelState, kvp => kvp.Key == "parameter.Key").Value; 385entry = Assert.Single(modelState, kvp => kvp.Key == "parameter.Value.Id").Value; 419Assert.Equal("key0", model.Key); 426var entry = Assert.Single(modelState, kvp => kvp.Key == "prefix.Key").Value; 430entry = Assert.Single(modelState, kvp => kvp.Key == "prefix.Value.Id").Value; 460Assert.Equal("key0", model.Key); 467var entry = Assert.Single(modelState, kvp => kvp.Key == "Key").Value; 471entry = Assert.Single(modelState, kvp => kvp.Key == "Value.Id").Value; 505var entry = Assert.Single(modelState, kvp => kvp.Key == "Key").Value; 508entry = Assert.Single(modelState, kvp => kvp.Key == "Value").Value; 536Assert.Equal("key1", model.Key); 543var entry = Assert.Single(modelState, kvp => kvp.Key == "p.Key").Value; 547entry = Assert.Single(modelState, kvp => kvp.Key == "p.Value[0]").Value; 551entry = Assert.Single(modelState, kvp => kvp.Key == "p.Value[1]").Value;
NullableReferenceTypeIntegrationTest.cs (6)
50modelState.OrderBy(kvp => kvp.Key), 53Assert.Equal("FirstName", kvp.Key); 137modelState.OrderBy(kvp => kvp.Key), 140Assert.Equal("FirstName", kvp.Key); 192modelState.OrderBy(kvp => kvp.Key), 195Assert.Equal("param1", kvp.Key);
TryUpdateModelIntegrationTest.cs (25)
52Assert.Equal("Street", entry.Key); 86Assert.Equal("Street", entry.Key); 196Assert.Equal("Address.Street", entry.Key); 237Assert.Equal("Address[0].Street", entry.Key); 278Assert.Equal("Address[0].Street", entry.Key); 339Assert.Equal("Address[0].Street", entry.Key); 373Assert.Equal("Address[0].Street", entry.Key); 402Assert.Equal("prefix.Address[0].Street", entry.Key); 443Assert.Equal("Address[0].Street", entry.Key); 491Assert.Equal("Address[0].Street", entry.Key); 659Assert.Equal("prefix.Street", entry.Key); 693Assert.Equal("prefix.Street", entry.Key); 796Assert.Equal("prefix.Address.Street", entry.Key); 832Assert.Equal("prefix.Address[0].Street", entry.Key); 873Assert.Equal("prefix.Address[0].Street", entry.Key); 924Assert.Equal("prefix.Address[0].Street", entry.Key); 960Assert.Equal("prefix.Address[0].Street", entry.Key); 1008Assert.Equal("prefix.Address[0].Street", entry.Key); 1077Assert.Equal("files", kvp.Key); 1129Assert.Equal("Street", entry.Key); 1200var entry = Assert.Single(modelState, k => k.Key == "Address.ZipCode"); 1207entry = Assert.Single(modelState, k => k.Key == "Address.Street"); 1252modelState.OrderBy(kvp => kvp.Key), 1255Assert.Equal("Address.Street", kvp.Key); 1264Assert.Equal("Address.ZipCode", kvp.Key);
TryValidateModelIntegrationTest.cs (1)
239result.Add(item.Key, errorMessage);
ValidationIntegrationTests.cs (65)
116e => string.Equals(e.Key, "AccountId", StringComparison.OrdinalIgnoreCase)).Value; 194var entry = Assert.Single(modelState, e => e.Key == "parameter.CustomerName").Value; 231var entry = Assert.Single(modelState, e => e.Key == "CustomerName").Value; 283var entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value; 320var entry = Assert.Single(modelState, e => e.Key == "Customer").Value; 374var entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value; 414var entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value; 466var entry = Assert.Single(modelState, e => e.Key == "Items[0].ItemId").Value; 504var entry = Assert.Single(modelState, e => e.Key == "Items").Value; 552var entry = Assert.Single(modelState, e => e.Key == "parameter[0].ProductId").Value; 592var entry = Assert.Single(modelState, e => e.Key == "parameter[0].ProductId").Value; 669var entry = Assert.Single(modelState, e => e.Key == "parameter").Value; 710var entry = Assert.Single(modelState, e => e.Key == "parameter.Name").Value; 747var entry = Assert.Single(modelState, e => e.Key == "parameter.Name").Value; 798var entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value; 835var entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value; 933var entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value; 970var entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value; 974entry = Assert.Single(modelState, e => e.Key == "parameter.Customer").Value; 1040var entry = Assert.Single(modelState, e => e.Key == "parameter.Products[0].Name").Value; 1077var entry = Assert.Single(modelState, e => e.Key == "parameter.Products[0].Name").Value; 1081entry = Assert.Single(modelState, e => e.Key == "parameter.Products").Value; 1128var entry = Assert.Single(modelState, e => e.Key == "parameter[0].Name").Value; 1165var entry = Assert.Single(modelState, e => e.Key == "parameter[0].Name").Value; 1244Assert.Equal("Id", state.Key); 1284Assert.Equal("Zip", state.Key); 1377Assert.Equal(nameof(ValidateSomeProperties.NeverValidBecauseType), state.Key); 1390state.Key); 1423Assert.Equal(nameof(ValidateSomeProperties.NeverValidBecauseAttribute), kvp.Key); 1461Assert.Equal(nameof(ValidateSomeProperties.ValidateNever), kvp.Key); 1523Assert.Equal(propertyName, kvp.Key); 1600Assert.Equal(nameof(ValidateSomePropertiesSometimes.ControlLength), kvp.Key); 1639state => Assert.Equal(nameof(ValidateSomePropertiesSometimes.Control), state.Key), 1642Assert.Equal(nameof(ValidateSomePropertiesSometimes.ControlLength), state.Key); 1690Assert.Equal(nameof(ValidateSomePropertiesSometimesWithoutValidation.ControlLength), kvp.Key); 1755var entry = Assert.Single(modelState, e => e.Key == "HomeAddress.Country.Name").Value; 1760entry = Assert.Single(modelState, e => e.Key == "ShippingAddresses[0].Zip").Value; 1765entry = Assert.Single(modelState, e => e.Key == "HomeAddress.Zip").Value; 1815var entry = Assert.Single(modelState, kvp => kvp.Key == "CustomParameter.message"); 1857var entry = Assert.Single(modelState, kvp => kvp.Key == "message"); 1903var entry = Assert.Single(modelState, kvp => kvp.Key == "other.key"); 1950var entry = Assert.Single(modelState, kvp => kvp.Key == "Message"); 1953entry = Assert.Single(modelState, kvp => kvp.Key == "other.key"); 2055var entry = Assert.Single(modelState, e => e.Key == "[0]").Value; 2060entry = Assert.Single(modelState, e => e.Key == "[1]").Value; 2107var entry = Assert.Single(modelState, e => e.Key == "").Value; 2110entry = Assert.Single(modelState, e => e.Key == "[0]").Value; 2115entry = Assert.Single(modelState, e => e.Key == "[1]").Value; 2178var entry = Assert.Single(modelState, e => e.Key == "p[0].Id").Value; 2183entry = Assert.Single(modelState, e => e.Key == "p[1]").Value; 2186entry = Assert.Single(modelState, e => e.Key == "p[1].Id").Value; 2233model.OrderBy(k => k.Key), 2236Assert.Equal("key0", kvp.Key); 2243var entry = Assert.Single(modelState, e => e.Key == "parameter[0].Key").Value; 2248entry = Assert.Single(modelState, e => e.Key == "parameter[0].Value").Value; 2280model.OrderBy(k => k.Key), 2283Assert.Equal("key0", kvp.Key); 2290var entry = Assert.Single(modelState, e => e.Key == "parameter[0].Key").Value; 2295entry = Assert.Single(modelState, e => e.Key == "parameter[0].Value.NeverValidProperty").Value; 2300entry = Assert.Single(modelState, e => e.Key == "parameter[0].Value").Value; 2343var entry = Assert.Single(modelState, e => e.Key == "Model.Id").Value; 2397var entry = Assert.Single(modelState, e => e.Key == "Model.Id").Value; 2402entry = Assert.Single(modelState, e => e.Key == "Model").Value; 2447var entry = Assert.Single(modelState, e => e.Key == "Property1").Value; 2499var entry = Assert.Single(modelState, e => e.Key == "Property1").Value;
ValidationWithRecordIntegrationTests.cs (65)
108e => string.Equals(e.Key, "AccountId", StringComparison.OrdinalIgnoreCase)).Value; 182var entry = Assert.Single(modelState, e => e.Key == "parameter.CustomerName").Value; 219var entry = Assert.Single(modelState, e => e.Key == "CustomerName").Value; 264var entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value; 301var entry = Assert.Single(modelState, e => e.Key == "Customer").Value; 346var entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value; 386var entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value; 431var entry = Assert.Single(modelState, e => e.Key == "Items[0].ItemId").Value; 469var entry = Assert.Single(modelState, e => e.Key == "Items").Value; 511var entry = Assert.Single(modelState, e => e.Key == "parameter[0].ProductId").Value; 551var entry = Assert.Single(modelState, e => e.Key == "parameter[0].ProductId").Value; 593var entry = Assert.Single(modelState, e => e.Key == "parameter.Name").Value; 630var entry = Assert.Single(modelState, e => e.Key == "parameter.Name").Value; 674var entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value; 711var entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value; 802var entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value; 839var entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value; 843entry = Assert.Single(modelState, e => e.Key == "parameter.Customer").Value; 902var entry = Assert.Single(modelState, e => e.Key == "parameter.Products[0].Name").Value; 939var entry = Assert.Single(modelState, e => e.Key == "parameter.Products[0].Name").Value; 943entry = Assert.Single(modelState, e => e.Key == "parameter.Products").Value; 986var entry = Assert.Single(modelState, e => e.Key == "parameter[0].Name").Value; 1023var entry = Assert.Single(modelState, e => e.Key == "parameter[0].Name").Value; 1096Assert.Equal("Id", state.Key); 1136Assert.Equal("Zip", state.Key); 1221Assert.Equal(nameof(ValidateSomeProperties.NeverValidBecauseType), state.Key); 1234state.Key); 1267Assert.Equal(nameof(ValidateSomeProperties.NeverValidBecauseAttribute), kvp.Key); 1305Assert.Equal(nameof(ValidateSomeProperties.ValidateNever), kvp.Key); 1408Assert.Equal(nameof(ValidateSomePropertiesSometimes.ControlLength), kvp.Key); 1447state => Assert.Equal(nameof(ValidateSomePropertiesSometimes.Control), state.Key), 1450Assert.Equal(nameof(ValidateSomePropertiesSometimes.ControlLength), state.Key); 1496Assert.Equal(nameof(ValidateSomePropertiesSometimesWithoutValidation.ControlLength), kvp.Key); 1558var entry = Assert.Single(modelState, e => e.Key == "HomeAddress.Country.Name").Value; 1563entry = Assert.Single(modelState, e => e.Key == "ShippingAddresses[0].Zip").Value; 1568entry = Assert.Single(modelState, e => e.Key == "HomeAddress.Zip").Value; 1618var entry = Assert.Single(modelState, kvp => kvp.Key == "CustomParameter.message"); 1660var entry = Assert.Single(modelState, kvp => kvp.Key == "message"); 1706var entry = Assert.Single(modelState, kvp => kvp.Key == "other.key"); 1753var entry = Assert.Single(modelState, kvp => kvp.Key == "Message"); 1756entry = Assert.Single(modelState, kvp => kvp.Key == "other.key"); 1846var entry = Assert.Single(modelState, e => e.Key == "[0]").Value; 1851entry = Assert.Single(modelState, e => e.Key == "[1]").Value; 1898var entry = Assert.Single(modelState, e => e.Key == "").Value; 1901entry = Assert.Single(modelState, e => e.Key == "[0]").Value; 1906entry = Assert.Single(modelState, e => e.Key == "[1]").Value; 1969var entry = Assert.Single(modelState, e => e.Key == "p[0].Id").Value; 1974entry = Assert.Single(modelState, e => e.Key == "p[1]").Value; 1977entry = Assert.Single(modelState, e => e.Key == "p[1].Id").Value; 2024model.OrderBy(k => k.Key), 2027Assert.Equal("key0", kvp.Key); 2034var entry = Assert.Single(modelState, e => e.Key == "parameter[0].Key").Value; 2039entry = Assert.Single(modelState, e => e.Key == "parameter[0].Value").Value; 2071model.OrderBy(k => k.Key), 2074Assert.Equal("key0", kvp.Key); 2081var entry = Assert.Single(modelState, e => e.Key == "parameter[0].Key").Value; 2086entry = Assert.Single(modelState, e => e.Key == "parameter[0].Value.NeverValidProperty").Value; 2091entry = Assert.Single(modelState, e => e.Key == "parameter[0].Value").Value; 2134var entry = Assert.Single(modelState, e => e.Key == "Model.Id").Value; 2185var entry = Assert.Single(modelState, e => e.Key == "Model.Id").Value; 2190entry = Assert.Single(modelState, e => e.Key == "Model").Value; 2235var entry = Assert.Single(modelState, e => e.Key == "Property1").Value; 2285var entry = Assert.Single(modelState, e => e.Key == "Property1").Value; 2447var entry = Assert.Single(modelState, e => e.Key == "Property1").Value; 2452entry = Assert.Single(modelState, e => e.Key == "Property2").Value;
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.NewtonsoftJson.Test (22)
JsonPatchExtensionsTest.cs (1)
87Assert.Equal(nameof(Customer), modelState.First().Key);
NewtonsoftJsonInputFormatterTest.cs (3)
272formatterContext.ModelState.OrderBy(k => k.Key), 275Assert.Equal("[1]", kvp.Key); 281Assert.Equal("[3]", kvp.Key);
src\Mvc\Mvc.Core\test\Formatters\JsonInputFormatterTestBase.cs (18)
148formatterContext.ModelState.OrderBy(k => k.Key), 151Assert.Equal(expectedKey, kvp.Key); 175formatterContext.ModelState.OrderBy(k => k.Key), 178Assert.Equal(expectedKey, kvp.Key); 203formatterContext.ModelState.OrderBy(k => k.Key), 206Assert.Equal(expectedKey, kvp.Key); 326Assert.Collection(formatterContext.ModelState.OrderBy(k => k.Key), 329Assert.Equal(expectedKey, kvp.Key); 352Assert.Collection(formatterContext.ModelState.OrderBy(k => k.Key), 355Assert.Equal(expectedKey, kvp.Key); 379Assert.Collection(formatterContext.ModelState.OrderBy(k => k.Key), 382Assert.Equal(expectedValue, kvp.Key); 405formatterContext.ModelState.OrderBy(k => k.Key), 408Assert.Equal(expectedKey, kvp.Key); 486Assert.Collection(formatterContext.ModelState.OrderBy(k => k.Key), 489Assert.Equal(expectedKey, kvp.Key); 511formatterContext.ModelState.OrderBy(k => k.Key), 514Assert.Equal(ReadAsync_NestedParseError_Expected, kvp.Key);
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.Razor.RuntimeCompilation.Test (4)
CSharpCompilerTest.cs (4)
98Assert.Collection(compilationOptions.SpecificDiagnosticOptions.OrderBy(d => d.Key), 101Assert.Equal("CS1701", item.Key); 106Assert.Equal("CS1702", item.Key); 111Assert.Equal("CS1705", item.Key);
Microsoft.AspNetCore.Mvc.Razor.Test (3)
RazorViewEngineTest.cs (3)
2124routeData.Values.Add(kvp.Key, kvp.Value); 2139routeData.Values.Add(kvp.Key, kvp.Value); 2146actionDescriptor.RouteValues.Add(kvp.Key, kvp.Value);
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.RazorPages.Test (72)
ApplicationModels\CompiledPageRouteModelProviderTest.cs (22)
46result.RouteValues.OrderBy(k => k.Key), 49Assert.Equal("page", kvp.Key); 61result.RouteValues.OrderBy(k => k.Key), 64Assert.Equal("page", kvp.Key); 108result.RouteValues.OrderBy(k => k.Key), 111Assert.Equal("area", kvp.Key); 116Assert.Equal("page", kvp.Key); 128result.RouteValues.OrderBy(k => k.Key), 131Assert.Equal("area", kvp.Key); 136Assert.Equal("page", kvp.Key); 148result.RouteValues.OrderBy(k => k.Key), 151Assert.Equal("area", kvp.Key); 156Assert.Equal("page", kvp.Key); 196result.RouteValues.OrderBy(k => k.Key), 199Assert.Equal("area", kvp.Key); 204Assert.Equal("page", kvp.Key); 216result.RouteValues.OrderBy(k => k.Key), 219Assert.Equal("page", kvp.Key); 418result.RouteValues.OrderBy(k => k.Key), 421Assert.Equal("page", kvp.Key); 433result.RouteValues.OrderBy(k => k.Key), 436Assert.Equal("page", kvp.Key);
ApplicationModels\PageRouteModelFactoryTest.cs (9)
35Assert.Equal("page", kvp.Key); 64Assert.Equal("page", kvp.Key); 92Assert.Equal("page", kvp.Key); 118routeModel.RouteValues.OrderBy(kvp => kvp.Key), 121Assert.Equal("area", kvp.Key); 126Assert.Equal("page", kvp.Key); 153routeModel.RouteValues.OrderBy(kvp => kvp.Key), 156Assert.Equal("area", kvp.Key); 161Assert.Equal("page", kvp.Key);
Filters\PageSaveTempDataPropertyFilterTest.cs (1)
185Assert.Equal("Test", item.Key);
Filters\PageViewDataAttributeFilterTest.cs (4)
32var feature = Assert.Single(httpContext.Features, f => f.Key == typeof(IViewDataValuesProviderFeature)); 79viewData.OrderBy(kvp => kvp.Key), 82Assert.Equal("Prop1", kvp.Key); 87Assert.Equal("Prop2", kvp.Key);
Infrastructure\DynamicPageEndpointMatcherPolicyTest.cs (10)
207candidates[0].Values.OrderBy(kvp => kvp.Key), 210Assert.Equal("page", kvp.Key); 248candidates[0].Values.OrderBy(kvp => kvp.Key), 251Assert.Equal("page", kvp.Key); 256Assert.Equal("slug", kvp.Key); 261Assert.Equal("state", kvp.Key); 375candidates[0].Values.OrderBy(kvp => kvp.Key), 378Assert.Equal("page", kvp.Key); 383Assert.Equal("slug", kvp.Key); 388Assert.Equal("state", kvp.Key);
Infrastructure\PageActionDescriptorProviderTest.cs (6)
103descriptor.RouteValues.OrderBy(kvp => kvp.Key), 106Assert.Equal("custom-key", kvp.Key); 111Assert.Equal("page", kvp.Key); 153descriptor.RouteValues.OrderBy(kvp => kvp.Key), 156Assert.Equal("area", kvp.Key); 161Assert.Equal("page", kvp.Key);
Infrastructure\PageActionEndpointDataSourceTest.cs (1)
277action.RouteValues[kvp.Key] = kvp.Value?.ToString();
Infrastructure\PageActionInvokerTest.cs (1)
55Assert.Contains(routeValues, kvp => kvp.Key == "tag" && string.Equals(kvp.Value, "value"));
Infrastructure\PageBinderFactoryTest.cs (4)
571Assert.Equal(nameof(PageModelWithValidation.Validated), kvp.Key); 613Assert.Equal("id", kvp.Key); 701Assert.Equal("name", kvp.Key); 748Assert.Empty(entry.Key);
PageModelTest.cs (7)
1005Assert.Equal("key", item.Key); 1045Assert.Equal("key", item.Key); 1090Assert.Equal("key", item.Key); 1148Assert.Equal("key", item.Key); 1174Assert.Equal("key", item.Key); 1221Assert.Equal("key", item.Key); 1775Assert.Empty(modelState.Key);
PageTest.cs (7)
1079Assert.Equal("key", item.Key); 1119Assert.Equal("key", item.Key); 1164Assert.Equal("key", item.Key); 1222Assert.Equal("key", item.Key); 1248Assert.Equal("key", item.Key); 1295Assert.Equal("key", item.Key); 1853Assert.Empty(modelState.Key);
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.TagHelpers.Test (20)
AnchorTagHelperTest.cs (2)
451Assert.Collection(rvd.OrderBy(item => item.Key), 454Assert.Equal("area", item.Key);
FormActionTagHelperTest.cs (3)
462rvd.OrderBy(item => item.Key), 465Assert.Equal("area", item.Key); 470Assert.Equal("page", item.Key);
FormTagHelperTest.cs (4)
472var routeValue = Assert.Single(routeValueDictionary, attr => attr.Key.Equals("val")); 474routeValue = Assert.Single(routeValueDictionary, attr => attr.Key.Equals("-Name")); 930rvd.OrderBy(item => item.Key), 933Assert.Equal("area", item.Key);
JavaScriptResourcesTest.cs (1)
44Assert.Equal("test.js", kvp.Key);
PrerenderComponentApplicationStoreTest.cs (1)
45expected.ToDictionary(kvp => kvp.Key, kvp => kvp.Value.ToArray()),
ProtectedPrerenderComponentApplicationStateTest.cs (1)
53expectedState.ToDictionary(kvp => kvp.Key, kvp => kvp.Value.ToArray()),
SelectTagHelperTest.cs (7)
134theoryData.Add(items[0], attribute.Key, attribute.Value, items[1]); 248entry => (Type)entry.Key == typeof(SelectTagHelper)); 347entry => (Type)entry.Key == typeof(SelectTagHelper)); 427Assert.Equal(typeof(SelectTagHelper), kvp.Key); 527entry => (Type)entry.Key == typeof(SelectTagHelper)); 621entry => (Type)entry.Key == typeof(SelectTagHelper)); 697entry => (Type)entry.Key == typeof(SelectTagHelper));
TagHelperOutputExtensionsTest.cs (1)
782tagBuilder.Attributes.Add(attr.Key, attr.Value);
Microsoft.AspNetCore.Mvc.Test (4)
MvcServiceCollectionExtensionsTest.cs (4)
64var mockType = typeof(Mock<>).MakeGenericType(serviceType.Key); 65services.Add(ServiceDescriptor.Transient(serviceType.Key, mockType)); 73AssertServiceCountEquals(services, serviceType.Key, serviceType.Value.Length + 1); 77AssertContainsSingle(services, serviceType.Key, implementationType);
Microsoft.AspNetCore.Mvc.Testing (8)
.packages\microsoft.extensions.hostfactoryresolver.sources\10.0.0-preview.2.25107.7\contentFiles\cs\netstandard2.0\HostFactoryResolver.cs (2)
331if (value.Key == "HostBuilding") 336if (value.Key == "HostBuilt")
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);
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.Mvc.ViewFeatures.Test (99)
ControllerUnitTestabilityTests.cs (1)
714Assert.Equal("some-key", error.Key);
DefaultEditorTemplatesTest.cs (1)
1628string.Join(" ", htmlAttributesDictionary.Select(entry => $"{ entry.Key }='{ entry.Value }'"));
DefaultHtmlGeneratorTest.cs (10)
132var attribute = Assert.Single(tagBuilder.Attributes, a => a.Key == "name"); 186var attribute = Assert.Single(tagBuilder.Attributes, a => a.Key == "name"); 210var attribute = Assert.Single(tagBuilder.Attributes, a => a.Key == "maxlength"); 234var attribute = Assert.Single(tagBuilder.Attributes, a => a.Key == "maxlength"); 258var attribute = Assert.Single(tagBuilder.Attributes, a => a.Key == "maxlength"); 280var attribute = Assert.Single(tagBuilder.Attributes, a => a.Key == "maxlength"); 302Assert.DoesNotContain(tagBuilder.Attributes, a => a.Key == "maxlength"); 326var attribute = Assert.Single(tagBuilder.Attributes, a => a.Key == "maxlength"); 433Assert.DoesNotContain(tagBuilder.Attributes, a => a.Key == "maxlength"); 486var attribute = Assert.Single(tagBuilder.Attributes, a => a.Key == "data-valmsg-for");
DefaultValidationHtmlAttributeProviderTest.cs (6)
45Assert.Equal("data-val", kvp.Key); 50Assert.Equal("data-val-number", kvp.Key); 81Assert.Equal("data-val", kvp.Key); 86Assert.Equal("data-val-number", kvp.Key); 180Assert.Equal("data-val", kvp.Key); 185Assert.Equal("data-val-number", kvp.Key);
Filters\ControllerSaveTempDataPropertyFilterTest.cs (3)
186tempData.OrderBy(i => i.Key), 189Assert.Equal(nameof(TestController.Test), item.Key); 194Assert.Equal(nameof(TestController.Test2), item.Key);
Filters\ControllerViewDataAttributeFilterTest.cs (4)
28var feature = Assert.Single(httpContext.Features, f => f.Key == typeof(IViewDataValuesProviderFeature)); 74viewData.OrderBy(kvp => kvp.Key), 77Assert.Equal("Prop1", kvp.Key); 82Assert.Equal("Prop2", kvp.Key);
ModelStateDictionaryExtensionsTest.cs (17)
21Assert.Equal("Text", modelState.Key); 38Assert.Equal("Child.Text", modelState.Key); 55Assert.Equal("Child.Value", modelState.Key); 73Assert.Equal("variable", modelState.Key); 91Assert.Equal("Text", modelState.Key); 111Assert.Equal("Text", modelState.Key); 129Assert.Equal("Child.Text", modelState.Key); 149Assert.Equal("Child.Text", modelState.Key); 167Assert.Equal("Child.Value", modelState.Key); 187Assert.Equal("Child.Value", modelState.Key); 206Assert.Equal("variable", modelState.Key); 227Assert.Equal("variable", modelState.Key); 305Assert.Equal("Key", modelState.Key); 325Assert.Equal("Key", modelState.Key); 344Assert.Equal("Child", modelState.Key); 367Assert.Equal("Key", modelState.Key); 389Assert.Equal("Key", modelState.Key);
RemoteAttributeBaseTest.cs (40)
159kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); }, 162Assert.Equal("data-val-remote", kvp.Key); 167Assert.Equal("data-val-remote-additionalfields", kvp.Key); 170kvp => { Assert.Equal("data-val-remote-type", kvp.Key); Assert.Equal("POST", kvp.Value); }, 171kvp => { Assert.Equal("data-val-remote-url", kvp.Key); Assert.Equal(url, kvp.Value); }); 194kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); }, 198Assert.Equal("data-val-remote", kvp.Key); 203Assert.Equal("data-val-remote-additionalfields", kvp.Key); 206kvp => { Assert.Equal("data-val-remote-type", kvp.Key); Assert.Equal("POST", kvp.Value); }, 207kvp => { Assert.Equal("data-val-remote-url", kvp.Key); Assert.Equal(url, kvp.Value); }); 234kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); }, 238Assert.Equal("data-val-remote", kvp.Key); 243Assert.Equal("data-val-remote-additionalfields", kvp.Key); 246kvp => { Assert.Equal("data-val-remote-type", kvp.Key); Assert.Equal("POST", kvp.Value); }, 247kvp => { Assert.Equal("data-val-remote-url", kvp.Key); Assert.Equal(url, kvp.Value); }); 282kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); }, 285Assert.Equal("data-val-remote", kvp.Key); 290Assert.Equal("data-val-remote-additionalfields", kvp.Key); 293kvp => { Assert.Equal("data-val-remote-type", kvp.Key); Assert.Equal("POST", kvp.Value); }, 294kvp => { Assert.Equal("data-val-remote-url", kvp.Key); Assert.Equal(url, kvp.Value); }); 325kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); }, 329Assert.Equal("data-val-remote", kvp.Key); 334Assert.Equal("data-val-remote-additionalfields", kvp.Key); 337kvp => { Assert.Equal("data-val-remote-type", kvp.Key); Assert.Equal("POST", kvp.Value); }, 338kvp => { Assert.Equal("data-val-remote-url", kvp.Key); Assert.Equal(url, kvp.Value); }); 366kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); }, 369Assert.Equal("data-val-remote", kvp.Key); 374Assert.Equal("data-val-remote-additionalfields", kvp.Key); 377kvp => { Assert.Equal("data-val-remote-type", kvp.Key); Assert.Equal("POST", kvp.Value); }, 378kvp => { Assert.Equal("data-val-remote-url", kvp.Key); Assert.Equal(url, kvp.Value); }); 419kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); }, 422Assert.Equal("data-val-remote", kvp.Key); 427Assert.Equal("data-val-remote-additionalfields", kvp.Key); 430kvp => { Assert.Equal("data-val-remote-type", kvp.Key); Assert.Equal("POST", kvp.Value); }, 431kvp => { Assert.Equal("data-val-remote-url", kvp.Key); Assert.Equal(url, kvp.Value); }); 453kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); }, 454kvp => { Assert.Equal("data-val-remote", kvp.Key); Assert.Equal("Error", kvp.Value); }, 457Assert.Equal("data-val-remote-additionalfields", kvp.Key); 460kvp => { Assert.Equal("data-val-remote-type", kvp.Key); Assert.Equal("POST", kvp.Value); }, 461kvp => { Assert.Equal("data-val-remote-url", kvp.Key); Assert.Equal(url, kvp.Value); });
RemoteAttributeTest.cs (10)
57Assert.Equal("controller", keyValuePair.Key); 68Assert.Equal("action", keyValuePair.Key); 97keyValuePair => string.Equals(keyValuePair.Key, "action", StringComparison.Ordinal)) 115keyValuePair => string.Equals(keyValuePair.Key, "controller", StringComparison.Ordinal)) 135keyValuePair => string.Equals(keyValuePair.Key, "area", StringComparison.Ordinal)) 347kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("original", kvp.Value); }, 348kvp => { Assert.Equal("data-val-remote", kvp.Key); Assert.Equal("original", kvp.Value); }, 349kvp => { Assert.Equal("data-val-remote-additionalfields", kvp.Key); Assert.Equal("original", kvp.Value); }, 350kvp => { Assert.Equal("data-val-remote-type", kvp.Key); Assert.Equal("original", kvp.Value); }, 351kvp => { Assert.Equal("data-val-remote-url", kvp.Key); Assert.Equal("original", kvp.Value); });
Rendering\HtmlHelperFormTest.cs (1)
813dictionary.Select(keyValue => string.Format(CultureInfo.InvariantCulture, " {0}=\"HtmlEncode[[{1}]]\"", keyValue.Key, keyValue.Value)));
ViewComponents\DefaultViewComponentHelperTest.cs (6)
43Assert.Equal("a", item.Key); 63Assert.Equal("a", item.Key); 83Assert.Equal("a", item1.Key); 89Assert.Equal("b", item2.Key); 110Assert.Equal("o", item.Key); 134Assert.Equal("a", item.Key);
Microsoft.AspNetCore.OpenApi (3)
Schemas\OpenApiJsonSchema.Helpers.cs (1)
277schema.Properties = props?.ToDictionary(p => p.Key, p => p.Value.Schema);
Services\OpenApiGenerator.cs (1)
198var statusCode = annotation.Key;
Services\Schemas\OpenApiSchemaService.cs (1)
164schema.Properties[property.Key] = ResolveReferenceForSchema(document, property.Value);
Microsoft.AspNetCore.OpenApi.Tests (245)
Services\CreateSchemaReferenceIdTests.cs (25)
45item => Assert.Equal("triangle", item.Key), 46item => Assert.Equal("square", item.Key) 79Assert.Equal("application/json", content.Key); 87Assert.Equal("id", property.Key); 92Assert.Equal("title", property.Key); 97Assert.Equal("completed", property.Key); 102Assert.Equal("createdAt", property.Key); 128Assert.Equal("application/json", content.Key); 137Assert.Equal("id", property.Key); 142Assert.Equal("title", property.Key); 147Assert.Equal("completed", property.Key); 152Assert.Equal("createdAt", property.Key); 187Assert.Equal("application/json", content.Key); 195Assert.Equal("application/json", responseContent.Key); 230Assert.Equal("application/json", content.Key); 238Assert.Equal("application/json", responseContent.Key); 252Assert.Equal("dueDate", property.Key); 258Assert.Equal("id", property.Key); 263Assert.Equal("title", property.Key); 268Assert.Equal("completed", property.Key); 273Assert.Equal("createdAt", property.Key); 283Assert.Equal("id", property.Key); 288Assert.Equal("title", property.Key); 293Assert.Equal("completed", property.Key); 298Assert.Equal("createdAt", property.Key);
Services\OpenApiDocumentService\OpenApiDocumentServiceTests.Paths.cs (26)
23Assert.Collection(document.Paths.OrderBy(p => p.Key), 26Assert.Equal("/api/todos", path.Key); 27Assert.Collection(path.Value.Operations.OrderBy(o => o.Key), 30Assert.Equal(OperationType.Get, operation.Key); 35Assert.Equal("/api/users", path.Key); 36Assert.Collection(path.Value.Operations.OrderBy(o => o.Key), 39Assert.Equal(OperationType.Get, operation.Key); 61Assert.Collection(document.Paths.OrderBy(p => p.Key), 64Assert.Equal("/api/todos", path.Key); 83Assert.Collection(document.Paths.OrderBy(p => p.Key), 86Assert.Equal("/api/todos", path.Key); 87Assert.Collection(path.Value.Operations.OrderBy(o => o.Key), 90Assert.Equal(OperationType.Get, operation.Key); 94Assert.Equal(OperationType.Post, operation.Key); 115Assert.Collection(document.Paths.OrderBy(p => p.Key), 118Assert.Equal("/api/todos/{id}", path.Key); 119Assert.Collection(path.Value.Operations.OrderBy(o => o.Key), 122Assert.Equal(OperationType.Get, operation.Key); 126Assert.Equal(OperationType.Put, operation.Key); 130Assert.Equal(OperationType.Post, operation.Key); 134Assert.Equal(OperationType.Patch, operation.Key); 154Assert.Collection(document.Paths.OrderBy(p => p.Key), 157Assert.Equal("/api/todos/{id}", path.Key); 158Assert.Collection(path.Value.Operations.OrderBy(o => o.Key), 161Assert.Equal(OperationType.Get, operation.Key); 165Assert.Equal(OperationType.Post, operation.Key);
Services\OpenApiDocumentService\OpenApiDocumentServiceTests.RequestBody.cs (38)
40Assert.Equal("multipart/form-data", content.Key); 117Assert.Equal("multipart/form-data", content.Key); 185Assert.Equal("multipart/form-data", content.Key); 225Assert.Equal("application/magic-foo-content-type", content.Key); 252Assert.Equal("application/magic-foo-content-type", content.Key); 280Assert.Equal("application/json", content.Key); 333Assert.Equal("application/json", content.Key); 354Assert.Equal("application/magic-foo-content-type", content.Key); 375Assert.Equal("application/magic-foo-content-type", content.Key); 431Assert.Equal("id", property.Key); 436Assert.Equal("title", property.Key); 441Assert.Equal("completed", property.Key); 446Assert.Equal("createdAt", property.Key); 530Assert.Equal("Id", property.Key); 535Assert.Equal("Title", property.Key); 540Assert.Equal("Completed", property.Key); 545Assert.Equal("CreatedAt", property.Key); 588Assert.Equal("id", property.Key); 593Assert.Equal("title", property.Key); 598Assert.Equal("completed", property.Key); 603Assert.Equal("createdAt", property.Key); 613Assert.Equal("code", property.Key); 618Assert.Equal("message", property.Key); 653Assert.Equal("Id", property.Key); 658Assert.Equal("Title", property.Key); 663Assert.Equal("Completed", property.Key); 668Assert.Equal("CreatedAt", property.Key); 678Assert.Equal("Code", property.Key); 683Assert.Equal("Message", property.Key); 719Assert.Equal("Name", property.Key); 795Assert.Equal("Name", property.Key); 800Assert.Equal("Description", property.Key); 805Assert.Equal("Resume", property.Key); 838Assert.Equal("name", property.Key); 843Assert.Equal("description", property.Key); 848Assert.Equal("resume", property.Key); 878Assert.Equal("model", property.Key); 1123Assert.Equal("application/octet-stream", content.Key);
Services\OpenApiDocumentService\OpenApiDocumentServiceTests.Responses.cs (37)
28Assert.Collection(operation.Responses.OrderBy(r => r.Key), 31Assert.Equal("201", response.Key); 36Assert.Equal("400", response.Key); 57Assert.Equal("400", response.Key); 81Assert.Equal("200", response.Key); 84Assert.Equal("text/plain", content.Key); 106Assert.Equal("200", response.Key); 109Assert.Equal("application/json", content.Key); 129Assert.Equal("200", response.Key); 131Assert.Collection(response.Value.Content.OrderBy(c => c.Key), 134Assert.Equal("application/json", content.Key); 138Assert.Equal("application/xml", content.Key); 159Assert.Equal("200", response.Key); 161Assert.Collection(response.Value.Content.OrderBy(c => c.Key), 164Assert.Equal("application/xml", content.Key); 183Assert.Equal("200", response.Key); 202Assert.Equal("200", response.Key); 204Assert.Collection(response.Value.Content.OrderBy(c => c.Key), 207Assert.Equal("application/json", content.Key); 211Assert.Equal("application/xml", content.Key); 230Assert.Equal(Microsoft.AspNetCore.OpenApi.OpenApiConstants.DefaultOpenApiResponseKey, response.Key); 233Assert.Equal("application/json", mediaTypeEntry.Key); 238Assert.Equal("code", property.Key); 242Assert.Equal("message", property.Key); 271Assert.Equal("code", property.Key); 276Assert.Equal("message", property.Key); 284Assert.Equal("application/json", okContent.Key); 289Assert.Equal("id", property.Key); 293Assert.Equal("title", property.Key); 297Assert.Equal("completed", property.Key); 301Assert.Equal("createdAt", property.Key); 328Assert.Collection(operation.Responses.OrderBy(r => r.Key), 331Assert.Equal("201", response.Key); 336Assert.Equal("400", response.Key); 359Assert.Collection(operation.Responses.OrderBy(r => r.Key), 362Assert.Equal("201", response.Key); 367Assert.Equal("400", response.Key);
Services\OpenApiGeneratorTests.cs (42)
124Assert.Equal("application/custom0", request.Content.First().Key); 125Assert.Equal("application/custom1", request.Content.Last().Key); 140Assert.Equal("application/custom0", request.Content.First().Key); 141Assert.Equal("application/custom1", request.Content.Last().Key); 155Assert.Equal("200", response.Key); 158Assert.Equal("application/json", formats.Key); 177Assert.Equal("200", response.Key); 179Assert.Equal("text/plain", formats.Key); 188Assert.Equal("200", response.Key); 216Assert.Equal("application/json", content.Key); 222Assert.Equal("application/json", badRequestContent.Key); 239Assert.Equal("application/json", createdResponseContent.Key); 434Assert.Equal("application/json", content.Key); 467Assert.Equal("application/json", fromBodyContent.Key); 554Assert.Equal("application/json+problem", content.Key); 571Assert.Equal("application/json", content.Key); 604responses.OrderBy(response => response.Key), 608Assert.Equal("200", responseType.Key); 609Assert.Equal("application/json", content.Key); 614Assert.Equal("400", responseType.Key); 615Assert.Equal("application/problem+json", content.Key); 620Assert.Equal("404", responseType.Key); 621Assert.Equal("application/problem+json", content.Key); 626Assert.Equal("409", responseType.Key); 627Assert.Equal("application/problem+json", content.Key); 646responses.OrderBy(response => response.Key), 650Assert.Equal("200", responseType.Key); 651Assert.Equal("application/json", content.Key); 656Assert.Equal("201", responseType.Key); 657Assert.Equal("application/json", content.Key); 681Assert.Equal("application/json", parameter.Key); 685Assert.Equal("application/xml", parameter.Key); 720Assert.Equal("application/json", content.Key); 736Assert.Equal("application/json", content.Key); 752Assert.Equal("application/xml", content.Key); 768Assert.Equal("multipart/form-data", content.Key); 784Assert.Equal("multipart/form-data", content.Key); 800Assert.Equal("multipart/form-data", content.Key); 855Assert.Equal("multipart/form-data", content.Key); 879Assert.Equal("multipart/form-data", content.Key); 914Assert.Equal("200", response.Key); 915Assert.Equal("application/json", content.Key);
Services\OpenApiSchemaService\OpenApiSchemaService.ParameterSchemas.cs (1)
697Assert.Equal("name", property.Key);
Services\OpenApiSchemaService\OpenApiSchemaService.PolymorphicSchemas.cs (12)
31item => Assert.Equal("triangle", item.Key), 32item => Assert.Equal("square", item.Key) 68item => Assert.Equal("0", item.Key), 69item => Assert.Equal("1", item.Key), 70item => Assert.Equal("2", item.Key) 113item => Assert.Equal("student", item.Key), 114item => Assert.Equal("teacher", item.Key) 190item => Assert.Equal("cat", item.Key), 191item => Assert.Equal("dog", item.Key), 192item => Assert.Equal("pet", item.Key) 279item => Assert.Equal("manager", item.Key), 280item => Assert.Equal("employee", item.Key)
Services\OpenApiSchemaService\OpenApiSchemaService.RequestBodySchemas.cs (34)
34Assert.Equal("application/json", content.Key); 41Assert.Equal("id", property.Key); 46Assert.Equal("title", property.Key); 51Assert.Equal("completed", property.Key); 56Assert.Equal("createdAt", property.Key); 97Assert.Equal("id", property.Key); 105Assert.Equal("name", property.Key); 112Assert.Equal("isPrivate", property.Key); 220Assert.Equal("proposalElement", property.Key); 224Assert.Equal("stream", property.Key); 272Assert.Equal("id", property.Key); 277Assert.Equal("title", property.Key); 282Assert.Equal("completed", property.Key); 287Assert.Equal("createdAt", property.Key); 317Assert.Equal("length", property.Key); 323Assert.Equal("wheels", property.Key); 329Assert.Equal("make", property.Key); 356Assert.Equal("id", property.Key); 363Assert.Equal("title", property.Key); 369Assert.Equal("completed", property.Key); 375Assert.Equal("createdAt", property.Key); 420Assert.Equal("nullableInt", property.Key); 426Assert.Equal("nullableString", property.Key); 432Assert.Equal("nullableBool", property.Key); 438Assert.Equal("nullableDateTime", property.Key); 445Assert.Equal("nullableUri", property.Key); 473Assert.Equal("name", property.Key); 478Assert.Equal("nested", property.Key); 518Assert.Equal("name", property.Key); 523Assert.Equal("nested", property.Key); 617Assert.Equal("number", property.Key); 643Assert.Equal("number", property.Key); 681Assert.Equal("selfReferenceList", property.Key); 687Assert.Equal("selfReferenceDictionary", property.Key);
Transformers\OperationTransformerTests.cs (30)
30Assert.Collection(document.Paths.OrderBy(p => p.Key), 33Assert.Equal("/todo", path.Key); 39Assert.Equal("/user", path.Key); 94Assert.Collection(document.Paths.OrderBy(p => p.Key), 97Assert.Equal("/todo", path.Key); 103Assert.Equal("/user", path.Key); 162Assert.Collection(document.Paths.OrderBy(p => p.Key), 165Assert.Equal("/todo", path.Key); 171Assert.Equal("/user", path.Key); 195Assert.Collection(document.Paths.OrderBy(p => p.Key), 198Assert.Equal("/todo", path.Key); 204Assert.Equal("/user", path.Key); 224Assert.Collection(document.Paths.OrderBy(p => p.Key), 227Assert.Equal("/todo", path.Key); 233Assert.Equal("/user", path.Key); 253Assert.Collection(document.Paths.OrderBy(p => p.Key), 256Assert.Equal("/todo", path.Key); 262Assert.Equal("/user", path.Key); 286Assert.Collection(document.Paths.OrderBy(p => p.Key), 289Assert.Equal("/todo", path.Key); 296Assert.Equal("/user", path.Key); 303Assert.Collection(document.Paths.OrderBy(p => p.Key), 306Assert.Equal("/todo", path.Key); 312Assert.Equal("/user", path.Key); 353Assert.Collection(document.Paths.OrderBy(p => p.Key), 356Assert.Equal("/todo", path.Key); 362Assert.Equal("/user", path.Key); 384Assert.Collection(document.Paths.OrderBy(p => p.Key), 387Assert.Equal("/todo", path.Key); 393Assert.Equal("/user", path.Key);
Microsoft.AspNetCore.OutputCaching (5)
OutputCacheEntry.cs (2)
93if (OutputCacheEntryFormatter.ShouldStoreHeader(header.Key)) 95arr[index++] = (header.Key, header.Value);
OutputCacheKeyProvider.cs (2)
365public 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.OutputCaching.Microbenchmarks (4)
EndToEndBenchmarks.cs (4)
223if (header.Key == HeaderNames.ContentLength || header.Key == HeaderNames.RequestId) 228if (!value.TryFindHeader(header.Key, out var vals) || vals != header.Value) 230throw new InvalidOperationException("Invalid header: " + header.Key);
Microsoft.AspNetCore.OutputCaching.Tests (2)
OutputCacheTests.cs (2)
1056Assert.Equal(initialResponse.Headers.GetValues(header.Key), subsequentResponse.Headers.GetValues(header.Key));
Microsoft.AspNetCore.Owin (7)
DictionaryStringArrayWrapper.cs (2)
20private static KeyValuePair<string, StringValues> Convert(KeyValuePair<string, string[]> item) => new KeyValuePair<string, StringValues>(item.Key, item.Value); 22private static KeyValuePair<string, string[]> Convert(KeyValuePair<string, StringValues> item) => new KeyValuePair<string, string[]>(item.Key, item.Value);
DictionaryStringValuesWrapper.cs (2)
21private static KeyValuePair<string, StringValues> Convert(KeyValuePair<string, string[]> item) => new KeyValuePair<string, StringValues>(item.Key, item.Value); 23private static KeyValuePair<string, string[]> Convert(KeyValuePair<string, StringValues> item) => new KeyValuePair<string, string[]>(item.Key, item.Value);
OwinEnvironment.cs (3)
163.Select(pair => pair.Key).Concat(_context.Items.Keys.Select(key => Convert.ToString(key, CultureInfo.InvariantCulture))).ToList(); 294yield return new KeyValuePair<string, object>(entryPair.Key, value); 299yield return new KeyValuePair<string, object>(Convert.ToString(entryPair.Key, CultureInfo.InvariantCulture), entryPair.Value);
Microsoft.AspNetCore.Owin.Tests (2)
OwinEnvironmentTests.cs (1)
158var orderedEnvironment = owinEnvironment.OrderBy(kv => kv.Key).ToList();
OwinExtensionTests.cs (1)
147kvp => string.Equals(typeof(HttpContext).FullName, kvp.Key, StringComparison.Ordinal))
Microsoft.AspNetCore.RateLimiting (1)
RateLimitingMiddleware.cs (1)
52_policyMap.Add(unactivatedPolicy.Key, unactivatedPolicy.Value(serviceProvider));
Microsoft.AspNetCore.Razor.Runtime (1)
src\Shared\Debugger\DictionaryItemDebugView.cs (1)
23Key = keyValue.Key;
Microsoft.AspNetCore.Razor.Runtime.Test (8)
Runtime\TagHelpers\TagHelperScopeManagerTest.cs (8)
23Assert.Equal("test-entry", (string)executionContextItem.Key, StringComparer.Ordinal); 40Assert.Equal("test-entry", (string)executionContextItem.Key, StringComparer.Ordinal); 59Assert.Equal("test-entry", (string)executionContextItem.Key, StringComparer.Ordinal); 62Assert.Equal("from-child", parentEntry.Key, StringComparer.Ordinal); 80Assert.Equal("test-entry", (string)executionContextItem.Key, StringComparer.Ordinal); 83Assert.Equal("test-entry", (string)parentExecutionContextItem.Key, StringComparer.Ordinal); 100Assert.Equal("new-entry", (string)executionContextItem.Key, StringComparer.Ordinal); 120Assert.Equal("test-entry", (string)parentExecutionContextItem.Key, StringComparer.Ordinal);
Microsoft.AspNetCore.Razor.Test (2)
TagHelpers\TagHelperContextTest.cs (2)
64Assert.Equal("test-entry", (string)item.Key, StringComparer.Ordinal); 87Assert.Equal("test-entry", (string)item.Key, StringComparer.Ordinal);
Microsoft.AspNetCore.ResponseCaching (7)
CacheEntry\CacheEntryHelpers.cs (1)
27size += (item.Key.Length * sizeof(char)) + EstimateStringValuesSize(item.Value);
ResponseCachingKeyProvider.cs (3)
142.AppendUpperInvariant(queryArray[i].Key) 204public 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; 314if (!string.Equals(header.Key, HeaderNames.Age, StringComparison.OrdinalIgnoreCase)) 316context.CachedResponse.Headers[header.Key] = header.Value;
Microsoft.AspNetCore.ResponseCaching.Tests (2)
ResponseCachingTests.cs (2)
960Assert.Equal(initialResponse.Headers.GetValues(header.Key), subsequentResponse.Headers.GetValues(header.Key));
Microsoft.AspNetCore.Rewrite.Tests (2)
ApacheModRewrite\FlagParserTest.cs (2)
80.OrderBy(kvp => kvp.Key) 82.OrderBy(kvp => kvp.Key));
Microsoft.AspNetCore.Routing (86)
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)
240var edgeKey = kvp.Key; 266result[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)
288new 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\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);
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\Shared\Debugger\DictionaryItemDebugView.cs (1)
23Key = keyValue.Key;
Microsoft.AspNetCore.Routing.Tests (114)
DefaultLinkGeneratorProcessTemplateTest.cs (6)
814Assert.Equal(expectedValues.OrderBy(kvp => kvp.Key), constraint.Values.OrderBy(kvp => kvp.Key)); 847Assert.Equal(expectedValues.OrderBy(kvp => kvp.Key), constraint.Values.OrderBy(kvp => kvp.Key)); 913Assert.Equal(expectedValues.OrderBy(kvp => kvp.Key), constraint.Values.OrderBy(kvp => kvp.Key));
EndpointRoutingMiddlewareTest.cs (1)
73Assert.Equal("Microsoft.AspNetCore.Routing.EndpointMatched", pair.Key);
Matching\DfaMatcherTest.cs (13)
158httpContext.Request.RouteValues.OrderBy(kvp => kvp.Key), 161Assert.Equal("action", kvp.Key); 166Assert.Equal("controller", kvp.Key); 223httpContext.Request.RouteValues.OrderBy(kvp => kvp.Key), 226Assert.Equal("action", kvp.Key); 231Assert.Equal("controller", kvp.Key); 236Assert.Equal("id", kvp.Key); 341httpContext.Request.RouteValues.OrderBy(kvp => kvp.Key), 344Assert.Equal("action", kvp.Key); 349Assert.Equal("controller", kvp.Key); 601httpContext.Request.RouteValues.OrderBy(kvp => kvp.Key), 604Assert.Equal("action", kvp.Key); 609Assert.Equal("controller", kvp.Key);
Matching\MatcherAssert.cs (5)
19!expectedValues.OrderBy(kvp => kvp.Key).SequenceEqual(actualValues.OrderBy(kvp => kvp.Key))) 85!values.OrderBy(kvp => kvp.Key).SequenceEqual(actualValues.OrderBy(kvp => kvp.Key))) 106return values == null ? "{}" : "{" + string.Join(", ", values.Select(kvp => $"{kvp.Key} = '{kvp.Value}'")) + "}";
Patterns\DefaultRoutePatternTransformerTest.cs (12)
38actual.RequiredValues.OrderBy(kvp => kvp.Key), 79actual.Defaults.OrderBy(kvp => kvp.Key), 84actual.RequiredValues.OrderBy(kvp => kvp.Key), 143actual.RequiredValues.OrderBy(kvp => kvp.Key), 165actual.RequiredValues.OrderBy(kvp => kvp.Key), 192actual.RequiredValues.OrderBy(kvp => kvp.Key), 227actual.RequiredValues.OrderBy(kvp => kvp.Key), 268actual.RequiredValues.OrderBy(kvp => kvp.Key), 309actual.RequiredValues.OrderBy(kvp => kvp.Key), 331actual.RequiredValues.OrderBy(kvp => kvp.Key), 353actual.RequiredValues.OrderBy(kvp => kvp.Key), 375actual.RequiredValues.OrderBy(kvp => kvp.Key),
Patterns\RoutePatternFactoryTest.cs (37)
35actual.Defaults.OrderBy(kvp => kvp.Key), 36kvp => { Assert.Equal("a", kvp.Key); Assert.Equal("15", kvp.Value); }, 37kvp => { Assert.Equal("b", kvp.Key); Assert.Equal(17, kvp.Value); }, 38kvp => { Assert.Equal("c", kvp.Key); Assert.Equal("19", kvp.Value); }); 60actual.Defaults.OrderBy(kvp => kvp.Key), 61kvp => { Assert.Equal("d", kvp.Key); Assert.Equal("15", kvp.Value); }, 62kvp => { Assert.Equal("e", kvp.Key); Assert.Equal(17, kvp.Value); }); 110kvp => { Assert.Equal("a", kvp.Key); Assert.Equal("13", kvp.Value); }); 163actual.ParameterPolicies.OrderBy(kvp => kvp.Key), 166Assert.Equal("a", kvp.Key); 174Assert.Equal("b", kvp.Key); 200actual.ParameterPolicies.OrderBy(kvp => kvp.Key), 203Assert.Equal("d", kvp.Key); 210Assert.Equal("e", kvp.Key); 236actual.ParameterPolicies.OrderBy(kvp => kvp.Key), 239Assert.Equal("d", kvp.Key); 267actual.ParameterPolicies.OrderBy(kvp => kvp.Key), 270Assert.Equal("a", kvp.Key); 277Assert.Equal("b", kvp.Key); 284Assert.Equal("c", kvp.Key); 334actual.ParameterPolicies.OrderBy(kvp => kvp.Key), 337Assert.Equal("d", kvp.Key); 344Assert.Equal("e", kvp.Key); 370actual.ParameterPolicies.OrderBy(kvp => kvp.Key), 373Assert.Equal("d", kvp.Key); 552action.RequiredValues.OrderBy(kvp => kvp.Key), 553kvp => { Assert.Equal("action", kvp.Key); Assert.Equal("Index", kvp.Value); }, 554kvp => { Assert.Equal("area", kvp.Key); Assert.Equal("Admin", kvp.Value); }, 555kvp => { Assert.Equal("controller", kvp.Key); Assert.Equal("Store", kvp.Value); }); 572action.RequiredValues.OrderBy(kvp => kvp.Key), 573kvp => { Assert.Equal("action", kvp.Key); Assert.Equal("Index", kvp.Value); }, 574kvp => { Assert.Equal("area", kvp.Key); Assert.Null(kvp.Value); }, 575kvp => { Assert.Equal("controller", kvp.Key); Assert.Equal("Store", kvp.Value); }); 592action.RequiredValues.OrderBy(kvp => kvp.Key), 593kvp => { Assert.Equal("action", kvp.Key); Assert.Equal("Index", kvp.Value); }, 594kvp => { Assert.Equal("area", kvp.Key); Assert.Equal("", kvp.Value); }, 595kvp => { Assert.Equal("controller", kvp.Key); Assert.Equal("Store", kvp.Value); });
RouteCollectionTest.cs (2)
155Assert.True(pathData.DataTokens.ContainsKey(dataToken.Key)); 156Assert.Equal(dataToken.Value, pathData.DataTokens[dataToken.Key]);
RouteConstraintBuilderTest.cs (6)
27Assert.Equal("controller", result.First().Key); 48Assert.Equal("controller", kvp.Key); 67Assert.Equal("controller", kvp.Key); 111Assert.Equal("id", result.First().Key); 124Assert.Equal("id", result.First().Key); 139Assert.Equal("name", result.First().Key);
RouteTest.cs (9)
448Assert.Single(route.DataTokens, kvp => kvp.Key == "culture" && ((string)kvp.Value) == "en-CA"); 479Assert.Equal("controller", value.Key); 786Assert.DoesNotContain(routeDataTokens.First().Key, pathData.DataTokens.Keys); 791Assert.True(pathData.DataTokens.ContainsKey(dataToken.Key)); 792Assert.Equal(dataToken.Value, pathData.DataTokens[dataToken.Key]); 830Assert.True(pathData.DataTokens.ContainsKey(dataToken.Key)); 831Assert.Equal(dataToken.Value, pathData.DataTokens[dataToken.Key]); 1105Assert.Equal(expectedValues.OrderBy(kvp => kvp.Key), constraint.Values.OrderBy(kvp => kvp.Key));
Template\TemplateBinderTests.cs (1)
1184Assert.True(actualParts.Parameters.TryGetValue(kvp.Key, out value));
Tree\TreeRouteBuilderTest.cs (11)
90Assert.Equal("a", firstSegment.Key); 97Assert.Equal("c", thirdSegment.Key); 122Assert.Equal("a", firstSegment.Key); 129Assert.Equal("c", thirdSegment.Key); 137Assert.Equal("e", fifthSegment.Key); 166Assert.Equal("a", firstSegment.Key); 173Assert.Equal("c", thirdSegment.Key); 198Assert.Equal("a", firstSegment.Key); 205Assert.Equal("c", thirdSegment.Key); 230Assert.Equal("a", firstSegment.Key); 237Assert.Equal("c", thirdSegment.Key);
Tree\TreeRouterTest.cs (11)
167var data = Assert.Single(context.RouteData.Values, v => v.Key == entry.Key); 219var data = Assert.Single(context.RouteData.Values, v => v.Key == entry.Key); 262var data = Assert.Single(context.RouteData.Values, v => v.Key == entry.Key); 1807Assert.DoesNotContain(context.RouteData.Values, kvp => kvp.Key == "test_route_group"); 1808Assert.Single(nestedValues, kvp => kvp.Key == "test_route_group"); 1849Assert.DoesNotContain(context.RouteData.Values, kvp => kvp.Key == "test_route_group"); 1850Assert.Single(nestedValues, kvp => kvp.Key == "test_route_group"); 1893Assert.DoesNotContain(nestedValues, kvp => kvp.Key == "category1");
Microsoft.AspNetCore.Server.HttpSys (14)
RequestProcessing\Response.cs (1)
637var headerName = headerPair.Key;
src\Shared\Debugger\DictionaryItemDebugView.cs (1)
23Key = keyValue.Key;
src\Shared\Debugger\StringValuesDictionaryDebugView.cs (1)
28keyValuePairs.Add(new DictionaryItemDebugView<string, string>(kvp.Key, kvp.Value.ToString()));
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\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)
101yield 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.HttpSys.FunctionalTests (5)
RequestBodyTests.cs (2)
221if (string.Equals(header.Key, "Content-Length", StringComparison.OrdinalIgnoreCase)) 249if (string.Equals(header.Key, headerName, StringComparison.OrdinalIgnoreCase))
RequestHeaderTests.cs (2)
238client.DefaultRequestHeaders.Add(header.Key, header.Value); 264builder.Append(header.Key);
src\Shared\Http2cat\HPackHeaderWriter.cs (1)
64if (!EncodeHeader(headersEnumerator.Current.Key, headersEnumerator.Current.Value, buffer.Slice(currentLength), out int headerLength))
Microsoft.AspNetCore.Server.IIS (17)
Core\IISHttpContext.cs (5)
603var isKnownHeader = HttpApiTypes.KnownResponseHeaders.TryGetValue(headerPair.Key, out var knownHeaderIndex); 620var headerNameBytes = Encoding.UTF8.GetBytes(headerPair.Key); 647var headerNameBytes = Encoding.ASCII.GetBytes(headerPair.Key); 716await entry.Key.Invoke(entry.Value); 740await entry.Key.Invoke(entry.Value);
Core\IISHttpContext.FeatureCollection.cs (3)
65if (kv.Key == key) 83if (MaybeExtra[i].Key == key) 98if (MaybeExtra[i].Key == key)
src\Shared\Debugger\DictionaryItemDebugView.cs (1)
23Key = keyValue.Key;
src\Shared\Debugger\StringValuesDictionaryDebugView.cs (1)
28keyValuePairs.Add(new DictionaryItemDebugView<string, string>(kvp.Key, kvp.Value.ToString()));
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\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\Shared\Process\ProcessEx.cs (1)
118startInfo.EnvironmentVariables[envVar.Key] = envVar.Value;
Microsoft.AspNetCore.Server.IntegrationTesting.IIS (3)
IISDeployer.cs (1)
368.GetOrAdd("add", "name", tuple.Key)
IISDeployerBase.cs (2)
119environmentVariables.GetOrAdd("environmentVariable", "name", envVar.Key) 134handlerSettings.GetOrAdd("handlerSetting", "name", handlerSetting.Key)
Microsoft.AspNetCore.Server.Kestrel.Core (33)
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)
823await entry.Key.Invoke(entry.Value); 851await 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);
src\Servers\Kestrel\shared\HPackHeaderWriter.cs (1)
124var name = headersEnumerator.Current.Key;
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\Shared\Debugger\DictionaryItemDebugView.cs (1)
23Key = keyValue.Key;
src\Shared\Debugger\StringValuesDictionaryDebugView.cs (1)
28keyValuePairs.Add(new DictionaryItemDebugView<string, string>(kvp.Key, kvp.Value.ToString()));
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.Core.Tests (34)
ConnectionDispatcherTests.cs (1)
45var pairs = scopeObjects[0].ToDictionary(p => p.Key, p => p.Value);
Http1\Http1HttpProtocolFeatureCollectionTests.cs (7)
66Type type = feature.Key; 171Assert.Equal(0, _collection.Count(kv => kv.Key == typeof(string))); 174Assert.Equal(1, _collection.Count(kv => kv.Key == typeof(string))); 177Assert.Equal(0, _collection.Count(kv => kv.Key == typeof(string))); 201var type = item.Key; 228Type type = featureIter.Key; 245Type type = feature.Key;
Http2\Http2HeadersEnumeratorTests.cs (8)
94Assert.Equal("Name1", e.Current.Key); 99Assert.Equal("Name2", e.Current.Key); 104Assert.Equal("Name2", e.Current.Key); 119Assert.Equal("Grpc-Status", e.Current.Key); 124Assert.Equal("Name1", e.Current.Key); 129Assert.Equal("Name2", e.Current.Key); 134Assert.Equal("Name2", e.Current.Key); 146headers.Add(CreateHeaderResult(enumerator.HPackStaticTableId, enumerator.Current.Key, enumerator.Current.Value));
Http2\Http2HPackEncoderTests.cs (1)
663.GroupBy(k => k.Key)
HttpParserTests.cs (2)
829Assert.Equal(headerName, pairs[0].Key); 848Assert.Equal(expectedHeaderNames, parsedHeaders.Select(t => t.Key));
HttpRequestHeadersTests.cs (5)
378Assert.Null(entries[0].Key); 381Assert.Equal("Host", entries[1].Key); 384Assert.Equal("Content-Length", entries[2].Key); 387Assert.Equal("custom", entries[3].Key); 390Assert.Null(entries[4].Key);
src\Servers\Kestrel\shared\HPackHeaderWriter.cs (1)
124var name = headersEnumerator.Current.Key;
src\Servers\Kestrel\shared\Http2HeadersEnumerator.cs (3)
87if (_hasMultipleValues && MoveNextOnStringEnumerator(Current.Key)) 108? SetCurrent(_genericEnumerator.Current.Key, _genericEnumerator.Current.Value, GetKnownRequestHeaderType(_genericEnumerator.Current.Key))
src\Shared\test\Shared.Tests\runtime\Http2\HPackDecoderTest.cs (2)
125Assert.Equal(":method", _handler.DecodedStaticHeaders[H2StaticTable.MethodGet].Key); 139Assert.Equal(_userAgentString, _handler.DecodedStaticHeaders[H2StaticTable.UserAgent].Key);
src\Shared\test\Shared.Tests\runtime\Http3\QPackDecoderTest.cs (4)
79Assert.Equal(":method", _handler.DecodedStaticHeaders[H3StaticTable.MethodGet].Key); 94Assert.Equal(_contentTypeString, _handler.DecodedStaticHeaders[H3StaticTable.ContentTypeApplicationDnsMessage].Key); 357Assert.Equal(expectedValue.Value, handler.DecodedHeaders[expectedValue.Key]); 361throw new InvalidOperationException($"Error when checking header '{expectedValue.Key}'.", ex);
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (13)
src\Servers\Kestrel\shared\ConnectionCompletion.cs (2)
28var task = entry.Key.Invoke(entry.Value); 58await entry.Key.Invoke(entry.Value);
src\Servers\Kestrel\shared\HPackHeaderWriter.cs (1)
124var name = headersEnumerator.Current.Key;
src\Servers\Kestrel\shared\Http2HeadersEnumerator.cs (3)
87if (_hasMultipleValues && MoveNextOnStringEnumerator(Current.Key)) 108? SetCurrent(_genericEnumerator.Current.Key, _genericEnumerator.Current.Value, GetKnownRequestHeaderType(_genericEnumerator.Current.Key))
src\Servers\Kestrel\shared\test\Http3\Http3InMemory.cs (4)
96internal Dictionary<string, object> ConnectionTags => MultiplexedConnectionContext.Tags.ToDictionary(t => t.Key, t => t.Value); 714.GroupBy(g => g.Key) 743return _headerHandler.DecodedHeaders.ToDictionary(kvp => kvp.Key, kvp => kvp.Value, _headerHandler.DecodedHeaders.Comparer); 760return _headerHandler.DecodedHeaders.ToDictionary(kvp => kvp.Key, kvp => kvp.Value, _headerHandler.DecodedHeaders.Comparer);
src\Servers\Kestrel\shared\TransportConnection.Generated.cs (3)
79if (kv.Key == key) 97if (MaybeExtra[i].Key == key) 112if (MaybeExtra[i].Key == key)
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (3)
src\Servers\Kestrel\shared\TransportConnection.Generated.cs (3)
79if (kv.Key == key) 97if (MaybeExtra[i].Key == key) 112if (MaybeExtra[i].Key == key)
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (8)
src\Servers\Kestrel\shared\ConnectionCompletion.cs (2)
28var task = entry.Key.Invoke(entry.Value); 58await entry.Key.Invoke(entry.Value);
src\Servers\Kestrel\shared\TransportConnection.Generated.cs (3)
79if (kv.Key == key) 97if (MaybeExtra[i].Key == key) 112if (MaybeExtra[i].Key == key)
src\Servers\Kestrel\shared\TransportMultiplexedConnection.Generated.cs (3)
66if (kv.Key == key) 84if (MaybeExtra[i].Key == key) 99if (MaybeExtra[i].Key == key)
Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (3)
src\Servers\Kestrel\shared\TransportConnection.Generated.cs (3)
79if (kv.Key == key) 97if (MaybeExtra[i].Key == key) 112if (MaybeExtra[i].Key == key)
Microsoft.AspNetCore.Session (1)
DistributedSession.cs (1)
325var keyBytes = entry.Key.KeyBytes;
Microsoft.AspNetCore.Shared.Tests (45)
AdaptiveCapacityDictionaryTests.cs (23)
198Assert.Collection(dict, kvp => { Assert.Equal("key", kvp.Key); Assert.Equal("value", kvp.Value); }); 216dict.OrderBy(kvp => kvp.Key), 217kvp => { Assert.Equal("age", kvp.Key); Assert.Equal(30, kvp.Value); }, 218kvp => { Assert.Equal("key", kvp.Key); Assert.Equal("value", kvp.Value); }); 235Assert.Collection(dict, kvp => { Assert.Equal("key", kvp.Key); Assert.Equal("value", kvp.Value); }); 252Assert.Collection(dict, kvp => { Assert.Equal("key", kvp.Key); Assert.Equal("value", kvp.Value); }); 358Assert.Collection(dict, kvp => { Assert.Equal("key", kvp.Key); Assert.Equal("value", kvp.Value); }); 389dict.OrderBy(kvp => kvp.Key), 390kvp => { Assert.Equal("age", kvp.Key); Assert.Equal(30, kvp.Value); }, 391kvp => { Assert.Equal("key", kvp.Key); Assert.Equal("value", kvp.Value); }); 411dict.OrderBy(kvp => kvp.Key), 412kvp => { Assert.Equal("key", kvp.Key); Assert.Equal("value", kvp.Value); }); 432dict.OrderBy(kvp => kvp.Key), 433kvp => { Assert.Equal("key", kvp.Key); Assert.Equal("value", kvp.Value); }); 451dict.OrderBy(kvp => kvp.Key), 452kvp => { Assert.Equal("age", kvp.Key); Assert.Equal(30, kvp.Value); }, 453kvp => { Assert.Equal("key", kvp.Key); Assert.Equal("value", kvp.Value); }); 723Assert.Collection(dict, kvp => { Assert.Equal("key", kvp.Key); Assert.Equal("value", kvp.Value); }); 744Assert.Collection(dict, kvp => { Assert.Equal("key", kvp.Key); Assert.Equal("value", kvp.Value); }); 788Assert.Collection(dict, kvp => { Assert.Equal("key", kvp.Key); Assert.Equal("value", kvp.Value); }); 871Assert.Collection(dict, kvp => { Assert.Equal("key", kvp.Key); Assert.Equal("value", kvp.Value); }); 1275Assert.Equal("key", storage[0].Key); 1277Assert.Equal("key3", storage[1].Key);
runtime\Http2\HPackDecoderTest.cs (2)
125Assert.Equal(":method", _handler.DecodedStaticHeaders[H2StaticTable.MethodGet].Key); 139Assert.Equal(_userAgentString, _handler.DecodedStaticHeaders[H2StaticTable.UserAgent].Key);
runtime\Http3\QPackDecoderTest.cs (4)
79Assert.Equal(":method", _handler.DecodedStaticHeaders[H3StaticTable.MethodGet].Key); 94Assert.Equal(_contentTypeString, _handler.DecodedStaticHeaders[H3StaticTable.ContentTypeApplicationDnsMessage].Key); 357Assert.Equal(expectedValue.Value, handler.DecodedHeaders[expectedValue.Key]); 361throw new InvalidOperationException($"Error when checking header '{expectedValue.Key}'.", ex);
src\Shared\Debugger\DictionaryItemDebugView.cs (1)
23Key = keyValue.Key;
src\Shared\Debugger\StringValuesDictionaryDebugView.cs (1)
28keyValuePairs.Add(new DictionaryItemDebugView<string, string>(kvp.Key, kvp.Value.ToString()));
src\Shared\Dictionary\AdaptiveCapacityDictionary.cs (7)
165keys[i] = array[i].Key; 207Add(item.Key, item.Value); 271return TryGetValue(item.Key, out var value) && EqualityComparer<object>.Default.Equals(value, item.Value); 355var index = FindIndex(item.Key); 522_dictionaryStorage[item.Key] = item.Value; 563if (_comparer.Equals(ArrayStorageSpan[i].Key, key)) 583if (_comparer.Equals(item.Key, key))
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\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.SignalR.Client.Core (2)
HubConnection.cs (2)
849kvp.Key.ToString(), 861kvp.Key.ToString(),
Microsoft.AspNetCore.SignalR.Client.FunctionalTests (2)
HubConnectionTests.cs (2)
3002yield return new object[] { protocol.Key, transport, hubPath }; 3027yield return new object[] { protocol.Key };
Microsoft.AspNetCore.SignalR.Client.Tests (6)
HubConnectionTests.Tracing.cs (6)
47Assert.Equal("example.com", clientActivity.TagObjects.Single(t => t.Key == "server.address").Value); 159Assert.Equal("example.net", clientActivity.TagObjects.Single(t => t.Key == "server.address").Value); 199Assert.Equal("example.com", clientActivity.TagObjects.Single(t => t.Key == "server.address").Value); 200Assert.Equal(80, (int)clientActivity.TagObjects.Single(t => t.Key == "server.port").Value); 209Assert.Equal("example.net", clientActivity.TagObjects.Single(t => t.Key == "server.address").Value); 210Assert.Equal(5050, (int)clientActivity.TagObjects.Single(t => t.Key == "server.port").Value);
Microsoft.AspNetCore.SignalR.Common.Tests (1)
Internal\Protocol\HubMessageHelpers.cs (1)
21hubMessage.Headers[header.Key] = header.Value;
Microsoft.AspNetCore.SignalR.Core (2)
src\Shared\Diagnostics\ActivityCreator.cs (2)
79activity.AddTag(tag.Key, tag.Value); 117activity.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.SignalR.Tests (5)
HttpHeaderConnectionHandler.cs (1)
26var headerValues = headers.FirstOrDefault(h => string.Equals(h.Key, headerName, StringComparison.OrdinalIgnoreCase)).Value.ToArray();
HubConnectionHandlerTests.Activity.cs (4)
504Assert.Equal("error.type", tags[3].Key); 513Assert.Equal("rpc.method", tags[0].Key); 515Assert.Equal("rpc.system", tags[1].Key); 517Assert.Equal("rpc.service", tags[2].Key);
Microsoft.AspNetCore.SignalR.Tests.Utils (2)
src\Shared\SignalR\WrappingLoggerFactory.cs (2)
107if (logScope.FirstOrDefault(kv => kv.Key == "TransportConnectionId" || kv.Key == "ClientConnectionId").Value is string id)
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 (10)
.packages\microsoft.extensions.hostfactoryresolver.sources\10.0.0-preview.2.25107.7\contentFiles\cs\netstandard2.0\HostFactoryResolver.cs (2)
331if (value.Key == "HostBuilding") 336if (value.Key == "HostBuilt")
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;
Microsoft.AspNetCore.TestHost.Tests (2)
ClientHandlerTests.cs (2)
252Assert.Equal("StartTrailer", kvp.Key); 257Assert.Equal("EndTrailer", kvp.Key);
Microsoft.AspNetCore.Tests (1)
WebApplicationTests.cs (1)
3011if (value.Key == "HostBuilding")
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.AspNetCore.WebUtilities.Tests (2)
FormReaderTests.cs (2)
165Assert.Equal("foo", pair.Key); 170Assert.Equal("baz", pair.Key);
Microsoft.Build (274)
BackEnd\BuildManager\BuildManager.cs (1)
2320result.AddResultsForTarget(cacheResultInner.Key, cacheResultInner.Value);
BackEnd\BuildManager\BuildParameters.cs (2)
470_globalProperties[property.Key] = ProjectPropertyInstance.Create(property.Key, property.Value);
BackEnd\BuildManager\BuildRequestData.cs (1)
153GlobalPropertiesDictionary.Set(ProjectPropertyInstance.Create(propertyPair.Key, propertyPair.Value));
BackEnd\BuildManager\GlobalPropertiesLookup.cs (1)
37.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)
512envVars[pair.Key] = pair.Value;
BackEnd\Components\BuildRequestEngine\BuildRequestEntry.cs (1)
434_outstandingResults[requestEntry.Key] = new BuildResult(requestEntry.Value, new BuildAbortedException());
BackEnd\Components\Caching\ConfigCache.cs (3)
215return _configurations.OrderBy(kvp => kvp.Key).First().Key; 247configurationIdsByMetadataToKeep.Add(metadata.Key, metadata.Value);
BackEnd\Components\Logging\LoggingService.cs (6)
1212sinkId = sinkPair.Key; 1704loggingEventKeyValuePair = new KeyValuePair<int, BuildEventArgs>(loggingEventKeyValuePair.Key, buildEventArgs); 1719bool gotSink = _eventSinkDictionary.TryGetValue(nodeEvent.Key, out IBuildEventSink sink); 1723sink.Consume(nodeEvent.Value, nodeEvent.Key); 1759sink.Consume(eventArg, pair.Key); 1777sink.Consume(eventArg, (int)pair.Key);
BackEnd\Components\ProjectCache\ProjectCacheDescriptorEqualityComparer.cs (1)
55dictHash ^= (pluginSetting.Key.GetHashCode() * -1521134295) + pluginSetting.Value.GetHashCode();
BackEnd\Components\ProjectCache\ProxyTargets.cs (1)
38_proxyTargetToRealTargetMap = proxyTargetToRealTargetMap.ToDictionary(kvp => kvp.Key, kvp => kvp.Value, StringComparer.OrdinalIgnoreCase);
BackEnd\Components\RequestBuilder\BatchingEngine.cs (2)
315string itemName = entry.Key; 396string metadataQualifiedName = consumedMetadataReference.Key;
BackEnd\Components\RequestBuilder\IntrinsicTasks\ItemGroupLoggingHelper.cs (3)
227keyValuePairList.Sort((l, r) => StringComparer.OrdinalIgnoreCase.Compare(l.Key, r.Key)); 234sb.Append(kvp.Key);
BackEnd\Components\RequestBuilder\IntrinsicTasks\MSBuild.cs (3)
622if (!additionalProjectPropertiesTable.ContainsKey(entry.Key)) 624combinedTable.Add(entry.Key, entry.Value); 631combinedTable.Add(entry.Key, entry.Value);
BackEnd\Components\RequestBuilder\Lookup.cs (15)
343if (SecondaryModifyTable.TryGetValue(entry.Key, out modifiesOfType)) 353SecondaryModifyTable.Add(entry.Key, entry.Value); 398ApplyModificationsToTable(SecondaryTable, entry.Key, entry.Value); 819ProjectItemInstance originalItem = modify.Key; 826ProjectItemInstance cloneItem = modify.Key.DeepClone(); 861itemToModify.RemoveMetadata(modificationPair.Key); 865itemToModify.SetMetadata(modificationPair.Key, modificationPair.Value.NewValue); 899if (table.Contains(kvPair.Key)) 901var itemToModify = kvPair.Key; 920if (modifiesOfType.TryGetValue(modify.Key, out existingMetadataChanges)) 936if (!existingMetadataChanges.ContainsExplicitModification(metadataChange.Key)) 938existingMetadataChanges[metadataChange.Key] = metadataChange.Value; 945modifiesOfType.Add(modify.Key, modify.Value); 1108if (modificationPair.Value.KeepValue && _modifications.TryGetValue(modificationPair.Key, out existingModification)) 1119_modifications[modificationPair.Key] = modificationPair.Value;
BackEnd\Components\RequestBuilder\RequestBuilder.cs (5)
1240var proxyTarget = proxyMapping.Key; 1347if (!savedEnvironment.ContainsKey(entry.Key)) 1349Environment.SetEnvironmentVariable(entry.Key, null); 1365if (!currentEnvironment.TryGetValue(entry.Key, out value) || !String.Equals(entry.Value, value, StringComparison.Ordinal)) 1367Environment.SetEnvironmentVariable(entry.Key, entry.Value);
BackEnd\Components\RequestBuilder\TargetUpToDateChecker.cs (2)
868if (GetItemSpecsFromItemVectors(itemVectors, item.Key, item.Value).Any()) 888itemSpecs.AddRange(GetItemSpecsFromItemVectors(itemVectors, item.Key, item.Value));
BackEnd\Components\RequestBuilder\TaskHost.cs (2)
307targetOutputsPerProject[i].Add(output.Key, output.Value); 1239targetOutputsPerProject[i][resultEntry.Key] = clonedTaskItem;
BackEnd\Components\Scheduler\Scheduler.cs (1)
1770config.GlobalProperties.ToDictionary().Select(kvp => $"{kvp.Key}={kvp.Value}"));
BackEnd\Components\Scheduler\SchedulingPlan.cs (6)
114configurationsInOrder.Sort((KeyValuePair<int, double> l, KeyValuePair<int, double> 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 (4)
130if (result._propertiesToAdd[propertyToAdd.Key] != propertyToAdd.Value) 141if (!result._itemsToAdd[itemToAdd.Key].Equals(itemToAdd.Value)) 174hashCode = (hashCode * -1521134295) + propertyToAdd.Key.GetHashCode(); 182hashCode = (hashCode * -1521134295) + itemToAdd.Key.GetHashCode();
BackEnd\Node\OutOfProcNode.cs (1)
725Environment.SetEnvironmentVariable(environmentPair.Key, environmentPair.Value);
BackEnd\Shared\BuildResult.cs (2)
587_resultsByTarget![targetResult.Key] = targetResult.Value; 701targetResultPair.Value.CacheItems(ConfigurationId, targetResultPair.Key);
BackEnd\Shared\ConfigurationMetadata.cs (2)
42_globalProperties[entry.Key] = ProjectPropertyInstance.Create(entry.Key, entry.Value);
BackEnd\TaskExecutionHost\TaskExecutionHost.cs (5)
372success = SetTaskParameter(parameter.Key, parameter.Value.Item1, parameter.Value.Item2, requiredParameters.ContainsKey(parameter.Key), out taskParameterSet); 394setParameters[parameter.Key] = String.Empty; 409setParameters.ContainsKey(requiredParameter.Key), 413requiredParameter.Key);
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)
182=> 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)
88resultingDictionary[property.Key] = property.Value;
CollectionHelpers.cs (1)
67if (!b.TryGetValue(aKvp.Key, out var bValue))
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)
274((IDictionary<string, T>)this).Add(item.Key, item.Value); 282if (_backing.TryGetValue(item.Key, out T value)) 303ErrorUtilities.VerifyThrow(item.Key == item.Value.Key, "Key must match value's key"); 304return Remove(item.Key);
Collections\HashTableUtility.cs (1)
53comparison = String.Compare(h1Entry.Value, h2[h1Entry.Key],
Collections\ItemDictionary.cs (1)
187yield return (itemTypeBucket.Key, itemTypeBucket.Value);
Collections\PropertyDictionary.cs (4)
397((IDictionary<string, T>)this).Add(item.Key, item.Value); 415if (_properties.TryGetValue(item.Key, out T value)) 437ErrorUtilities.VerifyThrow(item.Key == item.Value.Key, "Key must match value's key"); 440return ((IDictionary<string, T>)this).Remove(item.Key);
Collections\ReadOnlyConvertingDictionary.cs (1)
206return new KeyValuePair<K, N>(original.Key, _converter(original.Value));
Collections\RetrievableEntryHashSet\RetrievableEntryHashSet.cs (3)
287Debug.Assert(String.Equals(entry.Key, entry.Value.Key, StringComparison.Ordinal)); 401Debug.Assert(String.Equals(entry.Key, entry.Value.Key, StringComparison.Ordinal)); 607Debug.Assert(String.Equals(entry.Key, entry.Value.Key, StringComparison.Ordinal));
Collections\WeakValueDictionary.cs (4)
70keys.Add(pair.Key); 213remove.Add(entry.Key); 244yield return new KeyValuePair<K, V>(kvp.Key, null); 248yield return new KeyValuePair<K, V>(kvp.Key, target);
CommunicationsUtilities.cs (4)
423if (!newEnvironment.ContainsKey(entry.Key)) 425SetEnvironmentVariable(entry.Key, null); 432if (!currentEnvironment.TryGetValue(entry.Key, out string currentValue) || currentValue != entry.Value) 434SetEnvironmentVariable(entry.Key, entry.Value);
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)
446ParseAspNetCompilerProperty(proj, property.Key, property.Value);
CopyOnWriteDictionary.cs (3)
258_backing = _backing.SetItem(item.Key, item.Value); 292_backing = _backing.Remove(item.Key); 363array.SetValue(new DictionaryEntry(entry.Key, entry.Value), index + i);
Definition\Project.cs (4)
3617item.SetMetadataValue(metadatum.Key, metadatum.Value); 3781if (String.Equals(pair.Key, Constants.SubToolsetVersionPropertyName, StringComparison.OrdinalIgnoreCase) && subToolsetVersion != null) 3786globalPropertiesCollection.Set(ProjectPropertyInstance.Create(pair.Key, subToolsetVersion)); 3790globalPropertiesCollection.Set(ProjectPropertyInstance.Create(pair.Key, pair.Value));
Definition\ProjectCollection.cs (3)
348_globalProperties.Set(ProjectPropertyInstance.Create(pair.Key, pair.Value)); 1177if (!globalProperties.ContainsKey(globalProperty.Key)) 2627if (!globalProperties.TryGetValue(leftProperty.Key, out var rightValue))
Definition\ProjectItem.cs (1)
1034item.SetMetadata(metadatum.Key, metadatum.Value);
Definition\Toolset.cs (1)
257_properties.Set(ProjectPropertyInstance.Create(keyValuePair.Key, keyValuePair.Value, true));
Evaluation\Evaluator.cs (6)
733_usingTaskElements.Select(p => (p.Value, p.Key)), 1891propertiesAndItemsHash = (propertiesAndItemsHash * -1521134295) + property.Key.GetHashCode(); 1904propertiesAndItemsHash = (propertiesAndItemsHash * -1521134295) + item.Key.GetHashCode(); 1928propertyGroup.AddProperty(propertyNameAndValue.Key, EscapingUtilities.Escape(propertyNameAndValue.Value)); 1944escapedMetadata[metadata.Key] = EscapingUtilities.Escape(metadata.Value); 1948itemGroup.AddItem(item.Key, EscapingUtilities.Escape(item.Value.ItemSpec), escapedMetadata);
Evaluation\Expander.cs (31)
1949var itemSpec = itemTuple.Key; 2056if (!string.IsNullOrEmpty(itemTuple.Key) && (options & ExpanderOptions.BreakOnNotEmpty) != 0) 2067var joinedItems = string.Join(expressionCapture.Separator, itemsFromCapture.Select(i => i.Key)); 2211if (!string.IsNullOrEmpty(item.Key) && currentLength + item.Key.Length > CharacterLimitPerExpansion) 2216builder.Append(item.Key, 0, truncateIndex); 2222builder.Append(item.Key); 2354if (String.IsNullOrEmpty(item.Key)) 2369result = FileUtilities.ItemSpecModifiers.GetItemSpecModifier(directoryToUse, item.Key, definingProjectEscaped, functionName); 2375ProjectErrorUtilities.ThrowInvalidProject(elementLocation, "InvalidItemFunctionExpression", functionName, item.Key, e.Message); 2400if (String.IsNullOrEmpty(item.Key)) 2406string unescapedPath = EscapingUtilities.UnescapeAll(item.Key); 2428ProjectErrorUtilities.ThrowInvalidProject(elementLocation, "InvalidItemFunctionExpression", functionName, item.Key, e.Message); 2449if (String.IsNullOrEmpty(item.Key)) 2455string unescapedPath = EscapingUtilities.UnescapeAll(item.Key); 2475if (String.IsNullOrEmpty(item.Key)) 2483string unescapedPath = EscapingUtilities.UnescapeAll(item.Key); 2512ProjectErrorUtilities.ThrowInvalidProject(elementLocation, "InvalidItemFunctionExpression", functionName, item.Key, e.Message); 2551if (String.IsNullOrEmpty(item.Key)) 2557if (!directoryNameTable.TryGetValue(item.Key, out directoryName)) 2560string unescapedPath = EscapingUtilities.UnescapeAll(item.Key); 2585ProjectErrorUtilities.ThrowInvalidProject(elementLocation, "InvalidItemFunctionExpression", functionName, item.Key, e.Message); 2689if (item.Key != null && seenItems.Add(item.Key)) 2720if (item.Key != null) 2722matchEvaluator = new MetadataMatchEvaluator(item.Key, item.Value, elementLocation); 2762item.Key, 2763item.Key, 2772object result = function.Execute(item.Key, expander._properties, ExpanderOptions.ExpandAll, elementLocation); 2797if (includeNullEntries || item.Key != null) 2799yield return new KeyValuePair<string, S>(item.Key, null);
Evaluation\ItemSpec.cs (3)
128itemsFromCapture.Select(i => new ReferencedItem(i.Value, new ValueFragment(i.Key, ProjectDirectory))).ToList(); 363if (fragment.IsMatchNormalized(kvp.Key)) 366matches.Add(kvp.Key);
Evaluation\LazyItemEvaluator.LazyItemOperation.cs (1)
112: string.Join(";", CapturedItems.Select(kvp => $"{kvp.Key} : {kvp.Value.EvaluatedInclude}"));
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)
491_weakCache[kvp.Key] = kvp.Value;
Graph\GraphBuilder.cs (5)
220var referencingProjectPath = solutionDependency.Key; 638propertyDictionary[entry.Key] = ProjectPropertyInstance.Create(entry.Key, entry.Value); 707kvp => (kvp.Key.Item1.ToConfigurationMetadata(), kvp.Key.Item2.ToConfigurationMetadata()),
Graph\ParallelWorkSet.cs (1)
57completedWork[kvp.Key] = workItem.Value;
Graph\ProjectGraph.cs (5)
464: string.Join(", ", e.GlobalProperties.Select(kvp => $"{kvp.Key} = {kvp.Value}")); 521node.ProjectInstance.GlobalProperties.OrderBy(kvp => kvp.Key) 522.Select(kvp => $"{kvp.Key}={kvp.Value}")); 774entriesToUpdate.Add(new KeyValuePair<ProjectGraphNode, ImmutableList<string>>(pair.Key, targetList)); 781targetLists[pair.Key] = pair.Value;
Graph\ProjectInterpretation.cs (2)
418destination[pair.Key] = ProjectPropertyInstance.Create(pair.Key, pair.Value);
Instance\HostServices.cs (3)
363translator.Writer.Write(pair.Key); 364translator.Writer.Write(hostObjectMapPair.Key._targetName); 365translator.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)
107itemTypeCallback(kvp.Key, new ListConverter(kvp.Key, kvp.Value, _getInstance));
Instance\ImmutableProjectCollections\ImmutablePropertyCollectionConverter.cs (1)
50if (!otherImmutableDict._projectElements.TryGetValue(propKvp.Key, out TCached? otherProperty) ||
Instance\ProjectInstance.cs (7)
392_globalProperties.Set(ProjectPropertyInstance.Create(property.Key, property.Value)); 566_globalProperties[property.Key] = ProjectPropertyInstance.Create(property.Key, property.Value, false /* may not be reserved */, _isImmutable); 815foreach (var actualItem in that.GetItems(itemFilter.Key)) 3148if (String.Equals(globalProperty.Key, Constants.SubToolsetVersionPropertyName, StringComparison.OrdinalIgnoreCase) && explicitSubToolsetVersion != null) 3153_globalProperties.Set(ProjectPropertyInstance.Create(globalProperty.Key, explicitSubToolsetVersion, false /* may not be reserved */, _isImmutable)); 3157_globalProperties.Set(ProjectPropertyInstance.Create(globalProperty.Key, globalProperty.Value, false /* may not be reserved */, _isImmutable));
Instance\ProjectItemInstance.cs (7)
129IEnumerable<ProjectMetadataInstance> directMetadataInstances = directMetadata.Select(metadatum => new ProjectMetadataInstance(metadatum.Key, metadatum.Value)); 608IEnumerable<ProjectMetadataInstance> projectMetadataInstances = metadataList.Select(metadatum => new ProjectMetadataInstance(metadatum.Key, metadatum.Value)); 1085_directMetadata.ImportProperties(metadata.Select(kvp => new ProjectMetadataInstance(kvp.Key, kvp.Value, allowItemSpecModifiers: true))); 1714SetMetadata(metadataEntry.Key, metadataEntry.Value); 1894.Where(item => !FileUtilities.ItemSpecModifiers.IsDerivableItemSpecModifier(item.Key)) 1895.Select(item => new ProjectMetadataInstance(item.Key, item.Value, true /* may be built-in metadata name */)); 2063IEnumerable<ProjectMetadataInstance> projectMetadataInstances = metadataList.Select(metadatum => new ProjectMetadataInstance(metadatum.Key.Name, metadatum.Value));
Instance\ProjectTargetInstance.cs (1)
489taskElement.SetParameter(taskParameterEntry.Key, taskParameterEntry.Value);
Instance\ProjectTaskInstance.cs (1)
241filteredParameters[parameter.Key] = parameter.Value.Item1;
Instance\TaskFactories\TaskHostTask.cs (1)
497_setParameters[outputParam.Key] = outputParam.Value?.WrappedParameter;
Instance\TaskRegistry.cs (2)
672.Where(tp => RegisteredTaskIdentity.RegisteredTaskIdentityComparer.IsPartialMatch(taskIdentity, tp.Key)) 1000if (y.TryGetValue(param.Key, out value))
Logging\BaseConsoleLogger.cs (3)
500Internal.Utilities.EnumerateProperties(properties, list, static (list, kvp) => list.Add(new DictionaryEntry(kvp.Key, kvp.Value))); 521WritePretty(String.Format(CultureInfo.CurrentCulture, "{0,-30} = ", entry.Key)); 642WriteMetadata(metadatum.Key, metadatum.Value);
Logging\BinaryLogger\BuildEventArgsReader.cs (2)
1256kvp => kvp.Key, 1448list[i] = new DictionaryEntry(property.Key, property.Value);
Logging\BinaryLogger\BuildEventArgsWriter.cs (4)
298Write(e.BuildEnvironment?.Where(kvp => EnvironmentUtilities.IsWellKnownEnvironmentDerivedProperty(kvp.Key))); 366Write(item.Key); 1153Write(kvp.Key); 1177var (keyIndex, keyHash) = HashString(kvp.Key);
Logging\ParallelLogger\ParallelConsoleLogger.cs (10)
240WriteEnvironment(e.BuildEnvironment?.Where(kvp => EnvironmentUtilities.IsWellKnownEnvironmentDerivedProperty(kvp.Key)).ToDictionary(kvp => kvp.Key, kvp => kvp.Value)); 469if (previousEntryPoint != valuePair.Key.EntryPointContext) 472foreach (string s in _buildEventManager.ProjectCallStackFromProject(valuePair.Key.EntryPointContext)) 476previousEntryPoint = valuePair.Key.EntryPointContext; 481if (!String.Equals(previousTarget, valuePair.Key.TargetName, StringComparison.OrdinalIgnoreCase)) 484if (!string.IsNullOrEmpty(valuePair.Key.TargetName)) 486WriteMessageAligned(ResourceUtilities.FormatResourceStringStripCodeAndKeyword("ErrorWarningInTarget", valuePair.Key.TargetName), false); 488previousTarget = valuePair.Key.TargetName; 784string environmentMessage = String.Format(CultureInfo.CurrentCulture, "{0} = {1}", 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;
Logging\SerialConsoleLogger.cs (2)
113WriteEnvironment(e.BuildEnvironment?.Where(kvp => EnvironmentUtilities.IsWellKnownEnvironmentDerivedProperty(kvp.Key)).ToDictionary(kvp => kvp.Key, kvp => kvp.Value));
LogMessagePacketBase.cs (4)
329_sinkId = nodeBuildEvent.Value.Key; 1037WriteEvaluationLocation(translator, item.Key); 1118writer.Write(item.Key); 1188writer.Write(kvp.Key ?? string.Empty);
TaskHostConfiguration.cs (1)
204_taskParameters[parameter.Key] = new TaskParameter(parameter.Value);
TaskHostTaskComplete.cs (1)
123_taskOutputParameters[parameter.Key] = new TaskParameter(parameter.Value);
TaskParameter.cs (7)
449escapedGenericWrappedMetadata[entry.Key] = entry.Value == null ? entry.Value : EscapingUtilities.Escape(entry.Value); 898string value = destinationItem.GetMetadata(entry.Key); 902destinationItem.SetMetadata(entry.Key, entry.Value); 930clonedMetadata.Add(metadatum.Key, EscapingUtilities.UnescapeAll(metadatum.Value)); 1013var unescaped = new KeyValuePair<string, string>(kvp.Key, EscapingUtilities.UnescapeAll(kvp.Value)); 1029var unescaped = new KeyValuePair<string, string>(kvp.Key, EscapingUtilities.UnescapeAll(kvp.Value)); 1038SetMetadata(kvp.Key, kvp.Value);
Tracing.cs (3)
98Slot(tag, value.Key.ToString() + "=" + value.Key.ToString()); 151Trace.WriteLine("# " + count.Key + "=" + count.Value);
TypeLoader.cs (1)
368if (typeName.Length == 0 || TypeLoader.IsPartialTypeNameMatch(desiredTypeInAssembly.Key, typeName))
Utilities\Utilities.cs (3)
568string environmentVariableName = environmentVariable.Key; 666yield return new(kvp.Key, kvp.Value); 670yield return new(keyTimeSpanValue.Key, keyTimeSpanValue.Value.Ticks.ToString());
Microsoft.Build.BuildCheck.UnitTests (1)
EndToEndTests.cs (1)
147resource.Key.ShouldBeEquivalentTo($"{culture}/ReferencedProject.resources.dll",
Microsoft.Build.CommandLine.UnitTests (4)
CommandLineSwitches_Tests.cs (2)
1555Assert.True(helpMessageLines[i].Length <= 80, $"Line {i + 1} of '{item.Key}' should be no longer than 80 characters."); 1577if (item.Key.Contains("Examples"))
XMake_Tests.cs (2)
2824File.WriteAllText(Path.Combine(testProject.TestRoot, item.Key), item.Value); 2832_env.SetEnvironmentVariable(env.Key, env.Value);
Microsoft.Build.Engine.OM.UnitTests (15)
Construction\ElementLocationPublic_Tests.cs (1)
133values.ForEach(value => attributeLocations.Add(value.Key + ":" + value.Value.LocationString));
Instance\ProjectItemInstance_Tests.cs (6)
376if (pair.Key.Equals("m")) 381if (pair.Key.Equals("m;")) 386if (pair.Key.Equals("OriginalItemSpec")) 397if (pair.Key.Equals("m")) 402if (pair.Key.Equals("m;")) 407if (pair.Key.Equals("OriginalItemSpec"))
ObjectModelRemoting\Helpers\ViewValidation.construction.cs (2)
691Assert.Equal(rkvp.Key, vkvp.Key);
ObjectModelRemoting\Helpers\ViewValidation.cs (2)
289Assert.True(hasMetadata(md.Key)); 292Assert.Equal(md.Value, getMetadata(md.Key));
ObjectModelRemoting\Helpers\ViewValidation.evaluation.cs (2)
42Assert.True(result.HasMetadata(m.Key)); 43var md = result.GetMetadata(m.Key);
ObjectModelRemoting\RemoteProjectsProviderMock\CollectionsHelpers.cs (2)
116result.Add(sRemoter.Key, value); 135result.Add(s.Key, valueRemoter);
Microsoft.Build.Engine.UnitTests (70)
BackEnd\BuildManager_Tests.cs (1)
3546static (dict, kvp) => dict.Add(kvp.Key, kvp.Value));
BackEnd\BuildResult_Tests.cs (3)
269if (resultPair.Key == "foo") 289if (resultPair.Key == "foo") 295if (resultPair.Key == "bar")
BackEnd\LoggingServicesLogMethod_Tests.cs (2)
1300Assert.Equal(expectedEventArgs.Properties.OrderBy(kvp => kvp.Key, StringComparer.Ordinal), actualEventArgs.Properties.OrderBy(kvp => kvp.Key, StringComparer.OrdinalIgnoreCase));
BackEnd\ResultsCache_Tests.cs (2)
486if (!AreResultsIdenticalForTarget(a, b, targetResult.Key)) 494if (!AreResultsIdenticalForTarget(a, b, targetResult.Key))
BackEnd\SdkResolverService_Tests.cs (2)
380resolver.ResolvedCalls.First().Key.ShouldBe("foo"); 630result.Key.ShouldBe(sdk.Name);
BackEnd\TaskHost_Tests.cs (1)
731mockLogger.AssertLogContains($"{item.Key}: '{item.Value}'");
BackEnd\TranslationHelpers.cs (1)
225return string.Join(";", dictionary.Select(kvp => kvp.Key + "=" + kvp.Value));
BuildEventArgsDataEnumeration.cs (6)
78metadata[0].Key.ShouldBe("metadat1"); 80metadata[1].Key.ShouldBe("metadat2"); 120metadata[0].Key.ShouldBe("metadat41"); 122metadata[1].Key.ShouldBe("metadat42"); 133metadata[0].Key.ShouldBe("metadat1"); 135metadata[1].Key.ShouldBe("metadat2");
BuildEventArgsSerialization_Tests.cs (1)
1211sb.AppendLine(item.Key.ToString());
Collections\OMcollections_tests.cs (1)
285Assert.Equal(convertedValues[value.Key], value.Value);
ConsoleLogger_Tests.cs (2)
1639message = String.Format(CultureInfo.CurrentCulture, "{0} = {1}", kvp.Key, kvp.Value); 1643message = String.Format(CultureInfo.CurrentCulture, "{0,-30} = {1}", kvp.Key, kvp.Value);
Definition\ProjectEvaluationContext_Tests.cs (4)
119fileSystem.ExistenceChecks.OrderBy(kvp => kvp.Key) 125}.OrderBy(kvp => kvp.Key)); 178directoryCache.ExistenceChecks.OrderBy(kvp => kvp.Key).ShouldBe( 183}.OrderBy(kvp => kvp.Key));
Evaluation\ItemSpec_Tests.cs (1)
109itemDictionary.Add(new ProjectItemInstance(dummyProject, itemType.Key, item, dummyProject.FullPath));
ExpressionTree_Tests.cs (1)
395Console.Write(" {0}:\t", entry.Key);
Graph\GraphLoadedFromSolution_tests.cs (3)
564graphFromSolutionEdges.Keys.ShouldContain(graphEdge.Key); 641return edgeInfos.Where(e => e.Key.Item1.Equals(node.ToConfigurationMetadata())).Select(e => e.Value); 646return edgeInfos.Where(e => e.Key.Item2.Equals(node.ToConfigurationMetadata())).Select(e => e.Value);
Graph\GraphTestingUtilities.cs (1)
236var node = GetFirstNodeWithProjectNumber(graph, kvp.Key);
Graph\ProjectGraph_Tests.cs (1)
1862dot.ShouldMatch($@"{nodeId}\s*\[.*{targets}.*{globalProperty.Key}.*{globalProperty.Value}.*\]");
Instance\ProjectInstance_Internal_Tests.cs (1)
1037template.Properties.ToDictionary(p => p.Key, p => p.Value.EvaluatedValue),
Instance\ProjectTaskInstance_Internal_Tests.cs (1)
75parametersCopy[param.Key] = (param.Value.Item1, param.Value.Item2);
InternalEngineHelpers.cs (3)
118sdkResultItems.Add(item.Key, new SdkResultItem(item.Value.ItemSpec, newMetadata)); 170a.Key.ShouldBe(b.Key);
ProjectCache\ProjectCacheTests.cs (3)
164GraphEdges.Select(e => $"{Node(e.Key)}->{FormatChildren(e.Value)}")); 1012graphResult.ResultsByNode.First(r => GetProjectNumber(r.Key) == 2).Value.ShouldHaveSucceeded(); 1013graphResult.ResultsByNode.First(r => GetProjectNumber(r.Key) == 1).Value.ShouldHaveFailed();
SolutionFileBuilder.cs (5)
106kvp => kvp.Key, 108kvp.Key, 135p => p.Key, 192foreach (var configurationMapping in ProjectConfigurations[project.Key]) 194var solutionConfiguration = configurationMapping.Key;
TerminalLoggerConfiguration_Tests.cs (6)
71output.ShouldContain($"{expectedTelemetry.EventName}:{pair.Key}={pair.Value}"); 101output.ShouldContain($"{expectedTelemetry.EventName}:{pair.Key}={pair.Value}"); 128output.ShouldContain($"{expectedTelemetry.EventName}:{pair.Key}={pair.Value}"); 157output.ShouldContain($"{expectedTelemetry.EventName}:{pair.Key}={pair.Value}"); 185output.ShouldContain($"{expectedTelemetry.EventName}:{pair.Key}={pair.Value}"); 215output.ShouldContain($"{expectedTelemetry.EventName}:{pair.Key}={pair.Value}");
TestComparers\ProjectInstanceModelTestComparers.cs (8)
39Assert.Equal(xPair.Key, yPair.Key); 61Assert.Equal(xPair.Key, yPair.Key); 70Assert.Equal(xPair.Key, yPair.Key); 350Assert.Equal(xPair.Key, yPair.Key);
TestComparers\TaskRegistryComparers.cs (8)
30Assert.Equal(xp.Key, yp.Key, TaskRegistry.RegisteredTaskIdentity.RegisteredTaskIdentityComparer.Exact); 58Assert.Equal(xp.Key, yp.Key); 85Assert.Equal(xp.Key, yp.Key); 136Assert.Equal(xp.Key, yp.Key);
WarningsAsMessagesAndErrors_Tests.cs (2)
262{(customProperties != null ? String.Join(Environment.NewLine, customProperties.Select(i => $"<{i.Key}>{i.Value}</{i.Key}>")) : "")}
Microsoft.Build.Framework (41)
BinaryTranslator.cs (8)
1369string key = pair.Key; 1381string key = pair.Key; 1401string key = pair.Key; 1424K key = pair.Key; 1451string key = pair.Key; 1479string key = pair.Key; 1508string key = pair.Key; 1531string key = kvp.Key;
BinaryWriterExtensions.cs (1)
127writer.Write(kvp.Key);
BuildCheck\BuildCheckEventArgs.cs (1)
52writer.Write(kvp.Key);
BuildCheck\EnumerableExtensions.cs (3)
89if (!dict.TryGetValue(pair.Key, out TValue? value)) 91dict[pair.Key] = pair.Value; 95dict[pair.Key] = mergeValues(value, pair.Value);
BuildException\BuildExceptionBase.cs (1)
107writer.Write(pair.Key);
BuildSubmissionStartedEventArgs.cs (1)
60writer.Write((string)entry.Key);
ImmutableSegmentedDictionary`2.cs (3)
173dictionary.Add(pair.Key, pair.Value); 195return TryGetValue(pair.Key, out var value) 250result[item.Key] = item.Value;
ImmutableSegmentedDictionary`2+Builder.cs (4)
110=> Add(item.Key, item.Value); 118Add(pair.Key, pair.Value); 134return TryGetValue(item.Key, out var value) 180GetOrCreateMutableDictionary().Remove(item.Key);
ImmutableSegmentedDictionary`2+Enumerator.cs (2)
47DictionaryEntry IDictionaryEnumerator.Entry => new(Current.Key, Current.Value); 49object IDictionaryEnumerator.Key => Current.Key;
ImmutableSegmentedDictionary`2+KeyCollection+Enumerator.cs (1)
23public TKey Current => _enumerator.Current.Key;
NativeMethods.cs (1)
1358KillTree(childProcessInfo.Key);
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);
SegmentedDictionary`2.cs (10)
134Add(pair.Key, pair.Value); 153Add(pair.Key, pair.Value); 206=> Add(keyValuePair.Key, keyValuePair.Value); 210ref var value = ref FindValue(keyValuePair.Key); 221ref var value = ref FindValue(keyValuePair.Key); 224Remove(keyValuePair.Key); 1198return new DictionaryEntry(_current.Key, _current.Value); 1201return new KeyValuePair<TKey, TValue>(_current.Key, _current.Value); 1225return new DictionaryEntry(_current.Key, _current.Value); 1238return _current.Key;
TaskItemData.cs (1)
44dictionary.Add(item.Key, item.Value);
TaskParameterEventArgs.cs (1)
258writer.Write(kvp.Key);
TelemetryEventArgs.cs (1)
42writer.Write(kvp.Key);
Microsoft.Build.Tasks.CodeAnalysis.UnitTests (3)
IntegrationTests.cs (2)
47if (!vars.Where(kvp => kvp.Key == "RoslynCommandLineLogFile").Any()) 80TempFile file = currentDirectory.CreateFile(pair.Key);
TargetTests.cs (1)
964taskParams.AddParameter(kvp.Key, string.Empty, string.Empty, kvp.Value);
Microsoft.Build.Tasks.Core (58)
AssemblyDependency\GenerateBindingRedirects.cs (11)
97new XAttribute("name", redirect.Key.Name), 98new XAttribute("publicKeyToken", ResolveAssemblyReference.ByteArrayToString(redirect.Key.GetPublicKeyToken())), 99new XAttribute("culture", String.IsNullOrEmpty(redirect.Key.CultureName) ? "neutral" : redirect.Key.CultureName)), 281if (IsMatch(entry.Key, nameValue, cultureValue, publicKeyTokenValue)) 289var newName = entry.Key.Name; 290var newCulture = entry.Key.CultureName; 291var newPublicKeyToken = entry.Key.GetPublicKeyToken(); 292var newProcessorArchitecture = entry.Key.ProcessorArchitecture; 313redirects.Remove(entry.Key); 315Log.LogWarningWithCodeFromResources("GenerateBindingRedirects.OverlappingBindingRedirect", entry.Key.ToString(), bindingRedirect.ToString());
AssemblyDependency\ReferenceTable.cs (8)
1384AssemblyNameExtension assemblyName = assembly.Key; 1552return assembly.Key; 1772AddReference(newEntry.Key, newEntry.Value); 1790ResolveReference(assembly.Key, null, reference); 2181AssemblyNameExtension assemblyName = assemblyNameWithReference.Key; 2210toRemove.Add(kvp.Key); 2600AssemblyNameExtension assemblyName = kvp.Key; 3157AssemblyNameExtension assemblyName = assembly.Key;
AssemblyDependency\ResolveAssemblyReference.cs (3)
1082AssemblyNameExtension assemblyName = assembly.Key; 1095AssemblyNameExtension assemblyName = assembly.Key; 1108AssemblyNameExtension assemblyName = assembly.Key;
AssemblyFoldersEx.cs (1)
438versionStrings.Add(new ExtensionFoldersRegistryKey(s, entry.Key));
BootstrapperUtil\BootstrapperBuilder.cs (4)
232resourceUpdater.AddStringResource(44, de.Key, data); 1529eulaAttribute.Value = eulaInfo.Key; 1863results?.AddMessage(BuildMessage.CreateMessage(BuildMessageSeverity.Warning, "GenerateBootstrapper.UsingResourcesCulture", ci.Name, altCulturePair.Key)); 1865GetCodePage(altCulturePair.Key, ref codepage);
CopyOnWriteDictionary.cs (3)
258_backing = _backing.SetItem(item.Key, item.Value); 292_backing = _backing.Remove(item.Key); 363array.SetValue(new DictionaryEntry(entry.Key, entry.Value), index + i);
CreateItem.cs (4)
118if ((!PreserveExistingMetadata) || String.IsNullOrEmpty(newItem.GetMetadata(nameAndValue.Key))) 120if (FileUtilities.ItemSpecModifiers.IsItemSpecModifier(nameAndValue.Key)) 123Log.LogErrorWithCodeFromResources("CreateItem.AdditionalMetadataError", nameAndValue.Key); 127newItem.SetMetadata(nameAndValue.Key, nameAndValue.Value);
GetInstalledSDKLocations.cs (2)
164string sdkInfo = ResourceUtilities.FormatResourceStringIgnoreCodeAndKeyword("GetInstalledSDKs.SDKNameAndLocation", sdk.Key, sdk.Value.Item1); 168item.SetMetadata("SDKName", sdk.Key);
GetSDKReferenceFiles.cs (1)
622if (FileUtilities.EnsureTrailingSlash(directoryToFileList.Key).StartsWith(FileUtilities.EnsureTrailingSlash(redistFilePath), StringComparison.OrdinalIgnoreCase))
MSBuild.cs (3)
570if (!additionalProjectPropertiesTable.ContainsKey(entry.Key)) 572combinedTable.Add(entry.Key, entry.Value); 579combinedTable.Add(entry.Key, entry.Value);
ResolveSDKReference.cs (8)
1042if (!FrameworkIdentitiesFromManifest.ContainsKey(kvp.Key)) 1044FrameworkIdentitiesFromManifest.Add(kvp.Key, kvp.Value); 1059if (!AppxLocationsFromManifest.ContainsKey(kvp.Key)) 1061AppxLocationsFromManifest.Add(kvp.Key, kvp.Value); 1348if (!String.IsNullOrEmpty(appxLocation.Key)) 1350string[] appxComponents = appxLocation.Key.Split(s_appxSplitChar, StringSplitOptions.RemoveEmptyEntries).Select(x => x.Trim()).ToArray(); 1392AddStatusMessage("ResolveSDKReference.FoundAppxLocation", appxLocation.Key + "=" + appxLocation.Value); 1406appxLocationComponents.Add(location.Key);
RoslynCodeTaskFactory\RoslynCodeTaskFactory.cs (1)
488taskInfo.CodeLanguage = validLanguage.Key;
system.design\stronglytypedresourcebuilder.cs (4)
127resourceTypes.Add(resource.Key, data); 240String propertyName = entry.Key; 729String key = entry.Key; 796errors.Add(entry.Key);
SystemState.cs (2)
585string relativePath = kvp.Key; 613instanceLocalOutgoingFileStateCache = instanceLocalFileStateCache.ToDictionary(kvp => FileUtilities.MakeRelative(Path.GetDirectoryName(stateFile), kvp.Key), kvp => kvp.Value);
Tracing.cs (3)
98Slot(tag, value.Key.ToString() + "=" + value.Key.ToString()); 151Trace.WriteLine("# " + count.Key + "=" + count.Value);
Microsoft.Build.Tasks.UnitTests (12)
AssemblyDependency\ResolveAssemblyReferenceTestFixture.cs (3)
323string path = (string)entry.Key; 344string path = (string)entry.Key; 356string path = (string)entry.Key;
Copy_Tests.cs (5)
2025filesActuallyCopied.Select(f => Path.GetFileName(f.Key.Name)).ShouldBe(new[] { "a.cs", "b.cs" }, ignoreOrder: true); 2095Assert.Equal(Path.Combine(tempPath, "a.cs"), xaCopies[0].Key.Name); 2096Assert.Equal(Path.Combine(tempPath, "b.cs"), xaCopies[1].Key.Name); 2097Assert.Equal(Path.Combine(tempPath, "a.cs"), xaCopies[2].Key.Name); 2102Assert.Equal(Path.Combine(tempPath, "a.cs"), xbCopies[0].Key.Name);
XslTransformation_Tests.cs (4)
115XslTransformation.XmlInput.XmlModes xmlKey = xmlInputs[xmi].Key; 117XslTransformation.XsltInput.XslModes xslKey = xslInputs[xsi].Key; 179XslTransformation.XmlInput.XmlModes xmlKey = xmlInputs[xmi].Key; 225XslTransformation.XsltInput.XslModes xslKey = xslInputs[xsi].Key;
Microsoft.Build.UnitTests.Shared (10)
MockEngine.cs (2)
275targetOutputsPerProject[i].Add(output.Key, output.Value); 324targetOutputsPerProject[i][resultEntry.Key] = resultEntry.Value.Items;
MockLogger.cs (1)
430_fullLog.AppendLine($" {telemetryEventArgs.EventName}:{pair.Key}={pair.Value}");
ObjectModelHelpers.cs (7)
1035project.SetGlobalProperty(globalProperty.Key, globalProperty.Value); 1235dictionary.Add(item.Key, item.Value); 1295Assert.Equal(xPair.Key, yPair.Key); 1722sb.AppendFormat("<ProjectReferenceTargets Include=\"{0}\" Targets=\"{1}\" />", pair.Key, string.Join(";", pair.Value)); 1761var parent = nodeDependencies.Key; 1800? nodes.Where(n => entryPoints.Contains(n.Key)).Select(n => n.Value.ProjectPath)
Microsoft.Build.Utilities.Core (30)
AssemblyFoldersEx.cs (1)
438versionStrings.Add(new ExtensionFoldersRegistryKey(s, entry.Key));
CopyOnWriteDictionary.cs (3)
258_backing = _backing.SetItem(item.Key, item.Value); 292_backing = _backing.Remove(item.Key); 363array.SetValue(new DictionaryEntry(entry.Key, entry.Value), index + i);
MuxLogger.cs (2)
865Traits.LogAllEnvironmentVariables ? _buildStartedEvent.BuildEnvironment : _buildStartedEvent.BuildEnvironment?.Where(kvp => EnvironmentUtilities.IsWellKnownEnvironmentDerivedProperty(kvp.Key)).ToDictionary(kvp => kvp.Key, kvp => kvp.Value));
TaskItem.cs (9)
341copiedMetadata.SetItems(_metadata.Where(entry => !destinationAsTaskItem.Metadata.TryGetValue(entry.Key, out string val) || String.IsNullOrEmpty(val))); 353value = destinationAsITaskItem2.GetMetadataValueEscaped(entry.Key); 357destinationAsITaskItem2.SetMetadata(entry.Key, entry.Value); 362value = destinationItem.GetMetadata(entry.Key); 366destinationItem.SetMetadata(entry.Key, EscapingUtilities.Escape(entry.Value)); 406dictionary.Add(entry.Key, EscapingUtilities.UnescapeAll(entry.Value)); 508_metadata.SetItems(metadata.Select(kvp => new KeyValuePair<string, string>(kvp.Key, kvp.Value ?? string.Empty))); 523var unescaped = new KeyValuePair<string, string>(kvp.Key, EscapingUtilities.UnescapeAll(kvp.Value)); 539var unescaped = new KeyValuePair<string, string>(kvp.Key, EscapingUtilities.UnescapeAll(kvp.Value));
ToolLocationHelper.cs (8)
405extensionSDKs[extension.Key] = extension.Value; 452extensionSDKsAndVersions[extension.Key] = Tuple.Create<string, string>(extension.Value, moniker.TargetPlatformVersion.ToString()); 622ExtensionSDK extensionSDK = new ExtensionSDK(sdk.Key, sdk.Value); 627filteredExtensionSdks.Add(sdk.Key, sdk.Value); 2608if (rootPathWithIdentifier.Name.Equals(uapDirectoryName, StringComparison.OrdinalIgnoreCase) && directoryUnderRoot.Key.Major == uapVersion) 2610platformSDKKey = new TargetPlatformSDK(uapRegistryName, directoryUnderRoot.Key, null); 2614platformSDKKey = new TargetPlatformSDK(rootPathWithIdentifier.Name, directoryUnderRoot.Key, null); 2713TargetPlatformSDK platformSDKKey = new TargetPlatformSDK(platformIdentifier, registryVersions.Key, null);
ToolTask.cs (4)
677startInfo.Environment[entry.Key] = entry.Value; 687startInfo.Environment[variable.Key] = variable.Value; 1526alreadyLoggedEnvironmentHeader = LogEnvironmentVariable(alreadyLoggedEnvironmentHeader, entry.Key, entry.Value); 1536alreadyLoggedEnvironmentHeader = LogEnvironmentVariable(alreadyLoggedEnvironmentHeader, variable.Key, variable.Value);
Tracing.cs (3)
98Slot(tag, value.Key.ToString() + "=" + value.Key.ToString()); 151Trace.WriteLine("# " + count.Key + "=" + count.Value);
Microsoft.Build.Utilities.UnitTests (1)
TaskItem_Tests.cs (1)
341var actualMetadata = metadataContainer.EnumerateMetadata().OrderBy(metadata => metadata.Key).ToList();
Microsoft.Cci.Extensions (1)
Filters\BaselineDifferenceFilter.cs (1)
74return _ignoreDifferences.Where(i => !i.Value).Select(i => i.Key);
Microsoft.CodeAnalysis (145)
CodeGen\CompilationTestData.cs (2)
60return Methods.Single(p => predicate(p.Key)).Value.ILBuilder; 71var name = GetMethodName(pair.Key);
CodeGen\PrivateImplementationDetails.cs (6)
181_orderedSynthesizedMethods = _synthesizedMethods.OrderBy(kvp => kvp.Key).Select(kvp => kvp.Value).AsImmutable(); 184_orderedTopLevelTypes = _synthesizedTopLevelTypes.OrderBy(kvp => kvp.Key).Select(kvp => (Cci.INamespaceTypeDefinition)kvp.Value).AsImmutable(); 187_orderedNestedTypes = _dataFieldTypes.OrderBy(kvp => kvp.Key.Size).ThenBy(kvp => kvp.Key.Alignment).Select(kvp => kvp.Value).OfType<ExplicitSizeStruct>() 188.Concat<Cci.INestedTypeDefinition>(_dataSectionStringLiteralTypes.OrderBy(kvp => kvp.Key).Select(kvp => kvp.Value)).AsImmutable(); 433return _instrumentationPayloadRootFields.OrderBy(analysis => analysis.Key);
CodeGen\SwitchIntegralJumpTableEmitter.cs (5)
109if (sortedCaseLabels[0].Key != ConstantValue.Null) 141ConstantValue firstConstant = first.Key; 142ConstantValue secondConstant = second.Key; 327ConstantValue constant = c.Key; 386ConstantValue 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)
122_builder.MarkLabel(hashBucketLabelsMap[kvPair.Key]); 166this.EmitCondBranchForStringSwitch(kvPair.Key, kvPair.Value); 192ConstantValue stringConstant = kvPair.Key;
Collections\Grouping.cs (1)
28: this(pair.Key, pair.Value)
Collections\ImmutableArrayExtensions.cs (2)
1181result.Add(entry.Key, createMembers(entry.Value)); 1226dictionary.Add(entry.Key, namedTypes);
Collections\SmallDictionary.cs (1)
57this.Add(kv.Key, kv.Value);
CommandLine\AnalyzerConfigSet.cs (1)
557var result = dict.ToImmutableDictionary(d => d.Key, d => d.Value.value, Section.PropertiesKeyComparer);
CommandLine\CommandLineParser.cs (2)
1409=> pathMap.Sort((x, y) => -x.Key.Length.CompareTo(y.Key.Length));
CommandLine\ReportAnalyzerUtil.cs (3)
82.GroupBy(kvp => kvp.Key.GetType().Assembly) 96var analyzerIds = string.Join(", ", GetSupportedIds(kvp.Key).Distinct().OrderBy(id => id)); 97var 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)
164value = 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)
121if (excludedAnalyzers.Contains(diagnosticsByAnalyzer.Key)) 138if (excludedAnalyzers.Contains(diagnosticsByAnalyzer.Key))
DiagnosticAnalyzer\AnalysisResultBuilder.cs (5)
539var key = diagnosticsByTree.Key; 542if (analyzers.Contains(diagnosticsByAnalyzer.Key)) 547perTreeBuilder.Add(diagnosticsByAnalyzer.Key, diagnostics); 572if (analyzers.Contains(diagnosticsByAnalyzer.Key)) 577builder.Add(diagnosticsByAnalyzer.Key, diagnostics);
DiagnosticAnalyzer\AnalyzerAssemblyLoader.cs (1)
392.Select(x => (x.Key, x.Value?.RealAssemblyPath ?? ""))
DiagnosticAnalyzer\AnalyzerExecutor.cs (1)
185return _analyzerExecutionTimeMap.ToImmutableDictionary(pair => pair.Key, pair => TimeSpan.FromTicks(pair.Value.Value));
DiagnosticAnalyzer\AnalyzerFileReference.cs (1)
254return typeNameMap.ToImmutableSortedDictionary(g => g.Key, g => g.Value.ToImmutable(), StringComparer.OrdinalIgnoreCase);
DocumentationComments\DocumentationCommentIncludeCache.cs (1)
70return resolvedPath == pathAndDocument.Key;
Emit\CommonPEModuleBuilder.cs (2)
991builder.Add(entry.Key, entry.Value.GetAllMembers()); 999builder.Add(entry.Key, entry.Value.ToImmutableArray<ISymbolInternal>());
Emit\EditAndContinue\DeltaMetadataWriter.cs (3)
175addedOrChangedMethodsByIndex.Add(MetadataTokens.GetRowNumber(GetMethodDefinitionHandle(pair.Key)), pair.Value); 245result.Add(pair.Key, pair.Value); 268result[pair.Key] = pair.Value;
Emit\EditAndContinue\SymbolChanges.cs (2)
469keySelector: static e => e.Key, 473keySelector: static e => e.Key,
Emit\EditAndContinue\SymbolMatcher.cs (2)
82var key = (K?)MapDefinition(pair.Key); 102result.Add(pair.Key, pair.Value.MapTypes(this));
FileSystem\PathUtilities.cs (1)
713var 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)
61get { return _map.OrderBy(kv => kv.Value).Select(kv => kv.Key); }
InternalUtilities\KeyValuePairUtil.cs (1)
18key = keyValuePair.Key;
MetadataReader\MetadataHelpers.cs (4)
889names[nestedNamespaces[i].Key] = i; 897int keyIndex = names[pair.Key]; 902nestedNamespaces[keyIndex] = KeyValuePairUtil.Create(primaryPair.Key, primaryPair.Value.Concat(pair.Value)); 907int removed = nestedNamespaces.RemoveAll(pair => (object)pair.Key == null);
MetadataReader\PEModule.cs (4)
682result.Add(new Grouping<string, TypeDefinitionHandle>(pair.Key, pair.Value ?? SpecializedCollections.EmptyEnumerable<TypeDefinitionHandle>())); 762string @namespace = MetadataReader.GetString(kvp.Key); 1372if (namedArgValues is ({ Key: "IsOptional" }, isProperty: true, typeCode: SerializationTypeCode.Boolean, _)) 1532switch (namedArgValues.nameValuePair.Key)
MetadataReference\AssemblyIdentityMap.cs (3)
42AssemblyIdentity currentIdentity = sameName[i].Key; 58if (minHigherVersionCandidate == -1 || currentIdentity.Version < sameName[minHigherVersionCandidate].Key.Version) 83AssemblyIdentity currentIdentity = sameName[i].Key;
NativePdbWriter\PdbWriter.cs (2)
735GetDocumentIndex(kvp.Key), 783.OrderBy(kvp => kvp.Key))
Operations\ControlFlowGraphBuilder.ImplicitInstanceInfo.cs (1)
70AnonymousTypePropertyValues.Add(pair.Key, pair.Value);
PEWriter\MetadataWriter.cs (2)
1128return existing.Key; 1277return 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 => KeyValuePairUtil.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\Dependencies\Collections\ImmutableSegmentedDictionary`2.cs (2)
183return TryGetValue(pair.Key, out var value) 238result[item.Key] = item.Value;
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+Enumerator.cs (2)
47readonly DictionaryEntry IDictionaryEnumerator.Entry => new(Current.Key, Current.Value); 49readonly object IDictionaryEnumerator.Key => Current.Key;
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+KeyCollection+Enumerator.cs (1)
23public readonly TKey Current => _enumerator.Current.Key;
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+ValueBuilder.cs (6)
117=> Add(item.Key, item.Value); 125Add(pair.Key, pair.Value); 146return TryGetValue(item.Key, out var value) 190GetOrCreateMutableDictionary().Remove(item.Key); 211if (KeyComparer.Equals(pair.Key, equalKey)) 213actualKey = pair.Key;
src\Dependencies\Collections\SegmentedDictionary`2.cs (10)
208Add(pair.Key, pair.Value); 216Add(pair.Key, pair.Value); 269=> Add(keyValuePair.Key, keyValuePair.Value); 273ref var value = ref FindValue(keyValuePair.Key); 284ref var value = ref FindValue(keyValuePair.Key); 287Remove(keyValuePair.Key); 1232return new DictionaryEntry(_current.Key, _current.Value); 1235return new KeyValuePair<TKey, TValue>(_current.Key, _current.Value); 1259return new DictionaryEntry(_current.Key, _current.Value); 1272return _current.Key;
src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
556dictionary.Add(pair.Key, pair.Value.ToImmutableAndFree());
Symbols\Attributes\CommonAttributeData.cs (6)
183if (string.Equals(namedArguments[i].Key, name, StringComparison.Ordinal)) 438if (namedArg.Key == "MethodCodeType") 494switch (namedArg.Key) 510messageProvider.ReportInvalidNamedArgument(arguments.Diagnostics, arguments.AttributeSyntaxOpt, position, attribute.AttributeClass, namedArg.Key); 523messageProvider.ReportInvalidNamedArgument(arguments.Diagnostics, arguments.AttributeSyntaxOpt, position, attribute.AttributeClass, namedArg.Key); 533messageProvider.ReportInvalidNamedArgument(arguments.Diagnostics, arguments.AttributeSyntaxOpt, position, attribute.AttributeClass, namedArg.Key);
Symbols\Attributes\CommonAttributeDataComparer.cs (2)
70if (arg.Key != null) 72hash = Hash.Combine(arg.Key.GetHashCode(), hash);
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.CodeStyle (36)
src\Analyzers\Core\Analyzers\Helpers\DiagnosticHelper.cs (1)
217properties = properties.AddRange(tagIndices.Select(kvp => new KeyValuePair<string, string?>(kvp.Key, EncodeIndices(kvp.Value, additionalLocations.Count()))));
src\Compilers\Core\Portable\Collections\ImmutableArrayExtensions.cs (2)
1181result.Add(entry.Key, createMembers(entry.Value)); 1226dictionary.Add(entry.Key, namedTypes);
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (1)
713var oldPrefix = kv.Key;
src\Compilers\Core\Portable\InternalUtilities\ConcurrentSet.cs (2)
125public T Current => _kvpEnumerator.Current.Key; 157yield return kvp.Key;
src\Compilers\Core\Portable\InternalUtilities\KeyValuePairUtil.cs (1)
18key = keyValuePair.Key;
src\Dependencies\Collections\ImmutableSegmentedDictionary`2.cs (2)
183return TryGetValue(pair.Key, out var value) 238result[item.Key] = item.Value;
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+Enumerator.cs (2)
47readonly DictionaryEntry IDictionaryEnumerator.Entry => new(Current.Key, Current.Value); 49readonly object IDictionaryEnumerator.Key => Current.Key;
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+KeyCollection+Enumerator.cs (1)
23public readonly TKey Current => _enumerator.Current.Key;
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+ValueBuilder.cs (6)
117=> Add(item.Key, item.Value); 125Add(pair.Key, pair.Value); 146return TryGetValue(item.Key, out var value) 190GetOrCreateMutableDictionary().Remove(item.Key); 211if (KeyComparer.Equals(pair.Key, equalKey)) 213actualKey = pair.Key;
src\Dependencies\Collections\SegmentedDictionary`2.cs (10)
208Add(pair.Key, pair.Value); 216Add(pair.Key, pair.Value); 269=> Add(keyValuePair.Key, keyValuePair.Value); 273ref var value = ref FindValue(keyValuePair.Key); 284ref var value = ref FindValue(keyValuePair.Key); 287Remove(keyValuePair.Key); 1232return new DictionaryEntry(_current.Key, _current.Value); 1235return new KeyValuePair<TKey, TValue>(_current.Key, _current.Value); 1259return new DictionaryEntry(_current.Key, _current.Value); 1272return _current.Key;
src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
556dictionary.Add(pair.Key, pair.Value.ToImmutableAndFree());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamedTypeSymbolExtensions.cs (3)
598comparer.Equals(member.Name, kvp.Key.Name) && 599SignatureComparer.Instance.HaveSameSignature(member, kvp.Key, caseSensitive)); 603result.Remove(match.Key);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (1)
225foreach (var (symbol, write) in SymbolsWriteBuilder.Where(kvp => !kvp.Value).Select(kvp => kvp.Key).ToArray())
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BidirectionalMap.cs (1)
25backwardMap: ImmutableDictionary.CreateRange(valueComparer, pairs.Select(static p => KeyValuePairUtil.Create(p.Value, p.Key))))
Microsoft.CodeAnalysis.Collections.Package (21)
ImmutableSegmentedDictionary`2.cs (2)
183return TryGetValue(pair.Key, out var value) 238result[item.Key] = item.Value;
ImmutableSegmentedDictionary`2+Enumerator.cs (2)
47readonly DictionaryEntry IDictionaryEnumerator.Entry => new(Current.Key, Current.Value); 49readonly object IDictionaryEnumerator.Key => Current.Key;
ImmutableSegmentedDictionary`2+KeyCollection+Enumerator.cs (1)
23public readonly TKey Current => _enumerator.Current.Key;
ImmutableSegmentedDictionary`2+ValueBuilder.cs (6)
117=> Add(item.Key, item.Value); 125Add(pair.Key, pair.Value); 146return TryGetValue(item.Key, out var value) 190GetOrCreateMutableDictionary().Remove(item.Key); 211if (KeyComparer.Equals(pair.Key, equalKey)) 213actualKey = pair.Key;
SegmentedDictionary`2.cs (10)
208Add(pair.Key, pair.Value); 216Add(pair.Key, pair.Value); 269=> Add(keyValuePair.Key, keyValuePair.Value); 273ref var value = ref FindValue(keyValuePair.Key); 284ref var value = ref FindValue(keyValuePair.Key); 287Remove(keyValuePair.Key); 1232return new DictionaryEntry(_current.Key, _current.Value); 1235return new KeyValuePair<TKey, TValue>(_current.Key, _current.Value); 1259return new DictionaryEntry(_current.Key, _current.Value); 1272return _current.Key;
Microsoft.CodeAnalysis.CSharp (41)
Binder\Binder_Lambda.cs (1)
449diagnostics.Add(ErrorCode.INF_TooManyBoundLambdas, GetAnonymousFunctionLocation(pair.Key), truncatedToHundreds);
Binder\DecisionDagBuilder.cs (4)
761Debug.Assert(kvp.Key == kvp.Value); 762kvp.Key.ClearAndFree(); 854!existingState.RemainingValues.All(kv => newRemainingValues.TryGetValue(kv.Key, out IValueSet? values) && kv.Value.Equals(values))) 1683var remainingValues = state.RemainingValues.Select(kvp => $"{tempName(kvp.Key)}:{kvp.Value}");
Binder\Imports.cs (1)
76var name = pair.Key;
Binder\PatternExplainer.cs (1)
585var propertyString = needsPropertyString ? (deconstruction != null ? " {" : "{") + string.Join(", ", properties.Select(kvp => $" {kvp.Key.Name}: {kvp.Value}")) + " }" : null;
Binder\Semantics\OverloadResolution\OverloadResolution.cs (1)
1119NamedTypeSymbol otherType = pair.Key;
CommandLine\CSharpCommandLineParser.cs (2)
1380diagnosticOptions[o.Key] = o.Value; 1386diagnosticOptions[o.Key] = o.Value;
Compilation\CSharpCompilation.cs (1)
2659ImportInfo info = pair.Key;
Compiler\MethodCompiler.cs (1)
1238foreach (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.Variables.cs (2)
171var identifier = pair.Key; 179_variableTypes.Add(pair.Key, pair.Value);
Lowering\IteratorRewriter\IteratorMethodToStateMachineRewriter.cs (2)
266group ft.Key by ft.Value into g 445var destination = p.Key;
Lowering\LocalRewriter\LocalRewriter.PatternLocalRewriter.cs (1)
83builder.AppendLine(kv.Key.Dump());
Lowering\StateMachineRewriter\MethodToStateMachineRewriter.cs (2)
135this.proxies.Add(proxy.Key, proxy.Value); 250select F.SwitchSection(kv.Value.SelectAsArray(state => (int)state), F.Goto(kv.Key));
Symbols\Attributes\AttributeData.cs (2)
172stringBuilder.Append(namedArgument.Key); 523if (namedArg.Key == filePropName &&
Symbols\Compilation_WellKnownMembers.cs (1)
418var wellKnownMember = Binder.GetWellKnownTypeMember(this, arg.Key, useSiteInfo: out _, isOptional: true);
Symbols\Metadata\PE\PEModuleSymbol.cs (1)
768var name = MetadataTypeName.FromFullName(forwarder.Key);
Symbols\Metadata\PE\PENamespaceSymbol.cs (1)
261var c = new PENestedNamespaceSymbol(child.Key, this, child.Value);
Symbols\Metadata\PE\SymbolFactory.cs (3)
93if (arg.Key.Kind == SymbolKind.ErrorType && 94arg.Key is UnsupportedMetadataTypeSymbol) 131MetadataDecoder.IsOrClosedOverATypeFromAssemblies(arguments[i].Key, linkedAssemblies)))
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\SourceAssemblySymbol.cs (2)
741if (oneKey.Key.IsDefaultOrEmpty) 2543switch (namedArg.Key)
Symbols\Source\SourceMemberContainerSymbol.cs (1)
1999var name = pair.Key;
Symbols\Source\SourceMethodSymbolWithAttributes.cs (2)
875switch (namedArg.Key) 882diagnostics.Add(ErrorCode.ERR_InvalidNamedArgument, arguments.AttributeSyntaxOpt.ArgumentList.Arguments[position].Location, namedArg.Key);
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)
120return capturedParameters.OrderBy(static pair => pair.Key.Ordinal).Select(static pair => pair.Value);
Microsoft.CodeAnalysis.CSharp.CodeStyle (8)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\MemberDeclarationSyntaxExtensions.cs (1)
24return dictionary.ToDictionary(kvp => kvp.Key, kvp => kvp.Value.AsImmutable());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaRewriter.cs (7)
57if (pair.Key.Item1.RawKind != 0) 59_trailingTriviaMap.Add(pair.Key.Item1, trailingTrivia); 62if (pair.Key.Item2.RawKind != 0) 64_leadingTriviaMap.Add(pair.Key.Item2, leadingTrivia); 74if (pair.Key.Item1.RawKind == 0) 76return (default(SyntaxTriviaList), GetLeadingTriviaAtBeginningOfTree(pair.Key, pair.Value, cancellationToken)); 90var text = pair.Value.GetTextChanges(GetTextSpan(pair.Key)).Single().NewText ?? "";
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (3)
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider_DocComments.cs (1)
179var (removedMember, (memberDeclaration, _)) = removedMembers.FirstOrDefault(kvp => kvp.Key.Name == memberName);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\AttributeGenerator.cs (1)
95NameEquals(IdentifierName(argument.Key)),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ExpressionGenerator.cs (1)
283if (constant.Key.Equals(value))
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (7)
Intents\IntentTestsBase.cs (1)
70var documentBuffer = workspace.GetTestDocument(documentChange.Key)!.GetTextBuffer();
RawStringLiteral\RawStringLiteralCommandHandlerTests.cs (3)
67var virtualSpaces = spans.SingleOrDefault(kvp => kvp.Key.StartsWith("VirtualSpaces#")); 68if (virtualSpaces.Key != null) 70var virtualOffset = int.Parse(virtualSpaces.Key["VirtualSpaces-".Length..]);
StringCopyPaste\StringCopyPasteCommandHandlerTests.cs (3)
74var virtualSpaces = spans.SingleOrDefault(kvp => kvp.Key.StartsWith("VirtualSpaces#")); 75if (virtualSpaces.Key != null) 77var virtualOffset = int.Parse(virtualSpaces.Key["VirtualSpaces-".Length..]);
Microsoft.CodeAnalysis.CSharp.Features (1)
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider_DocComments.cs (1)
179var (removedMember, (memberDeclaration, _)) = removedMembers.FirstOrDefault(kvp => kvp.Key.Name == memberName);
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (1)
SimplifyTypeNames\SimplifyTypeNamesTests.cs (1)
1182var newContent = content.Replace(@"[||]", pair.Key);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (6)
SourceGeneration\GeneratorDriverTests.cs (6)
3243Assert.DoesNotContain(result.Results[0].HostOutputs, o => o.Key == "Host"); 3254Assert.Contains(result.Results[0].HostOutputs, o => o.Key == "Host"); 4729(r) => { var result = Assert.Single(r.HostOutputs); Assert.Equal("gen1", result.Key); Assert.Equal("value1", result.Value); }, 4730(r) => { var result = Assert.Single(r.HostOutputs); Assert.Equal("gen2", result.Key); Assert.Equal("value2", result.Value); } 4747(r) => { var result = Assert.Single(r.HostOutputs); Assert.Equal("gen", result.Key); Assert.Equal("value1", result.Value); }, 4748(r) => { var result = Assert.Single(r.HostOutputs); Assert.Equal("gen", result.Key); Assert.Equal("value2", result.Value); }
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (2)
Symbols\Metadata\PE\LoadingAttributes.cs (2)
572Assert.Equal(expected.Key, actual.Key.ToString());
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (2)
LexicalAndXml\RawStringLiteralLexingTests.cs (1)
221Assert.All(diagnostics, d => Assert.Equal(spans.Single().Key, d.Id));
Syntax\SyntaxNodeTests.cs (1)
4030action(SyntaxFactory.ParseCompilationUnit(test.Key), test.Value);
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
Extensions.cs (1)
413Assert.Equal(namedArg.Key, name);
Microsoft.CodeAnalysis.CSharp.Workspaces (10)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\MemberDeclarationSyntaxExtensions.cs (1)
24return dictionary.ToDictionary(kvp => kvp.Key, kvp => kvp.Value.AsImmutable());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaRewriter.cs (7)
57if (pair.Key.Item1.RawKind != 0) 59_trailingTriviaMap.Add(pair.Key.Item1, trailingTrivia); 62if (pair.Key.Item2.RawKind != 0) 64_leadingTriviaMap.Add(pair.Key.Item2, leadingTrivia); 74if (pair.Key.Item1.RawKind == 0) 76return (default(SyntaxTriviaList), GetLeadingTriviaAtBeginningOfTree(pair.Key, pair.Value, cancellationToken)); 90var text = pair.Value.GetTextChanges(GetTextSpan(pair.Key)).Single().NewText ?? "";
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\AttributeGenerator.cs (1)
95NameEquals(IdentifierName(argument.Key)),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ExpressionGenerator.cs (1)
283if (constant.Key.Equals(value))
Microsoft.CodeAnalysis.EditorFeatures (3)
InlineRename\InlineRenameSession.OpenTextBufferManager.cs (2)
688return Tuple.Create(kvp.Key, ss); 746: _openTextBufferManager._referenceSpanToLinkedRenameSpanMap.First(kvp => kvp.Key.OverlapsWith(span)).Value.TrackingSpan.GetEndPoint(snapshot);
Tagging\AbstractAsynchronousTaggerProvider.TagSource_TagsChanged.cs (1)
31if (change.Key != _subjectBuffer)
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (11)
Classification\FormattedClassification.cs (2)
51if (ClassificationName.StartsWith(kvp.Key)) 53var remainder = ClassificationName[kvp.Key.Length..];
CodeLens\AbstractCodeLensTest.cs (5)
29var isCapped = annotatedSpan.Key.StartsWith("capped"); 30var expected = int.Parse(annotatedSpan.Key[(isCapped ? 6 : 0)..]); 57var expected = int.Parse(annotatedSpan.Key); 83var expected = int.Parse(annotatedSpan.Key); 109var expected = annotatedSpan.Key;
Workspaces\EditorTestWorkspace.cs (4)
368var namedSpans = markupSpans.Where(kvp => kvp.Key != string.Empty); 370.ThenBy(kvp => markup.IndexOf("{|" + kvp.Key + ":", StringComparison.Ordinal)); 380var spanName = spanNameToListMap.Key; 503kvp => kvp.Key, kvp => kvp.Value.ToImmutableAndFree());
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (9)
CodeFixes\ExtensionOrderingTests.cs (1)
137var actualOrder = codeFixPriorityMap.OrderBy(kvp => kvp.Value).Select(kvp => kvp.Key).ToImmutableArray();
Collections\Immutable\Maps\MapTests.cs (2)
24Assert.Equal("1", v.Key); 30Assert.Equal("1", ((KeyValuePair<string, int>)v).Key);
Diagnostics\IDEDiagnosticIDConfigurationTests.cs (5)
161foreach (var kvp in expectedMap.OrderBy(kvp => kvp.Key)) 164extraEntitiesBuilder.AppendLine(kvp.Key); 743foreach (var entry in expectedMap.OrderBy(kvp => kvp.Key)) 745extraEntitiesBuilder.Add((entry.Key.diagnosticId, entry.Key.optionName, entry.Value));
Snippets\RoslynLSPSnippetConvertTests.cs (1)
506if (kvp.Key.Length > 0)
Microsoft.CodeAnalysis.ExternalAccess.Razor.UnitTests (3)
RazorPredefinedProviderNameTests.cs (3)
35if (!razorProviderNames.TryGetValue(roslynKvp.Key, out var razorValue)) 37failureMessage.AppendLine($"The Name '{roslynKvp.Key}' does not exist."); 42failureMessage.AppendLine($"The Value of '{roslynKvp.Key}' does not match.");
Microsoft.CodeAnalysis.Features (24)
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);
Diagnostics\DiagnosticAnalyzerExtensions.cs (2)
65=> analysisResult.Select(kv => new AnalyzerPerformanceInfo(kv.Key.GetAnalyzerId(), analyzerInfo.IsTelemetryCollectionAllowed(kv.Key), kv.Value.ExecutionTime));
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (4)
760map.Any(entry => IsGlobalStatement(entry.Key))) 1469map.ToDictionary(keySelector: entry => entry.Value, elementSelector: entry => entry.Key), 6591=> x.Key.Equals(y.Key) &&
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);
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingAsyncWorkItemQueue.cs (1)
255return pair.Key;
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingSemanticChangeProcessor.cs (1)
279var result = map.Remove(first.Key);
InlineMethod\AbstractInlineMethodRefactoringProvider.InlineContext.cs (2)
334.Select(parameterAndExpressionPair => (parameter: (ISymbol)parameterAndExpressionPair.Key, 342.Select(kvp => (parameter: kvp.Key, syntaxNode: syntaxGenerator.IdentifierName(kvp.Value)));
IntroduceParameter\AbstractIntroduceParameterCodeRefactoringProvider.cs (1)
246source: methodCallSites.GroupBy(kvp => kvp.Key.Project),
LanguageServices\AnonymousTypeDisplayService\AbstractStructuralTypeDisplayService.cs (1)
196var hasAtLeastOneTupleWhichAppearsMultipleTimes = transitiveReferences.Any(kvp => kvp.Key.IsTupleType && kvp.Value.count >= 2);
src\Analyzers\Core\Analyzers\Helpers\DiagnosticHelper.cs (1)
217properties = properties.AddRange(tagIndices.Select(kvp => new KeyValuePair<string, string?>(kvp.Key, EncodeIndices(kvp.Value, additionalLocations.Count()))));
UnusedReferences\ProjectAssets\ProjectAssetsReader.cs (3)
57.ToImmutableDictionary(t => t.Key, t => t.Value.ToImmutableDictionary(l => l.Key.Split('/')[0], l => l.Key));
Microsoft.CodeAnalysis.Features.Test.Utilities (10)
EditAndContinue\ActiveStatementsDescription.cs (1)
48documentPathMap: oldDocumentMap.ToImmutableDictionary(e => e.Key, e => e.Value.OrderBy(ActiveStatementsMap.Comparer).ToImmutableArray()),
EditAndContinue\ActiveStatementTestHelpers.cs (1)
108=> regions.OrderBy(r => r.Key.Token).Select(r => $"{r.Key.Method.GetDebuggerDisplay()} | {string.Join(", ", r.Value.Select(r => r.GetDebuggerDisplay()))}");
EditAndContinue\EditAndContinueTestVerifier.cs (6)
519Assert.Same(pair.Key, bodyMatch.OldRoot); 523result.Add(pair.Key, pair.Value); 530=> ToMatchingPairs(match.Matches.Where(partners => partners.Key != match.OldRoot)); 535.OrderBy(partners => partners.Key.GetLocation().SourceSpan.Start) 536.ThenByDescending(partners => partners.Key.Span.Length) 539Old = partners.Key.ToString().Replace("\r\n", " ").Replace("\n", " "),
EditAndContinue\SourceMarkers.cs (1)
78foreach (var (id, (start, end)) in tagMap.OrderBy(k => k.Key))
Snippets\AbstractSnippetProviderTests.cs (1)
75if (!int.TryParse(placeholderLocationPair.Key, out var locationIndex))
Microsoft.CodeAnalysis.Features.UnitTests (1)
FindUsages\DefinitionItemFactoryTests.cs (1)
65actual.Select(item => (key: item.Key, value: item.Value)).OrderBy(item => item.key),
Microsoft.CodeAnalysis.InteractiveHost (23)
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (1)
713var oldPrefix = kv.Key;
src\Dependencies\Collections\ImmutableSegmentedDictionary`2.cs (2)
183return TryGetValue(pair.Key, out var value) 238result[item.Key] = item.Value;
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+Enumerator.cs (2)
47readonly DictionaryEntry IDictionaryEnumerator.Entry => new(Current.Key, Current.Value); 49readonly object IDictionaryEnumerator.Key => Current.Key;
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+KeyCollection+Enumerator.cs (1)
23public readonly TKey Current => _enumerator.Current.Key;
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+ValueBuilder.cs (6)
117=> Add(item.Key, item.Value); 125Add(pair.Key, pair.Value); 146return TryGetValue(item.Key, out var value) 190GetOrCreateMutableDictionary().Remove(item.Key); 211if (KeyComparer.Equals(pair.Key, equalKey)) 213actualKey = pair.Key;
src\Dependencies\Collections\SegmentedDictionary`2.cs (10)
208Add(pair.Key, pair.Value); 216Add(pair.Key, pair.Value); 269=> Add(keyValuePair.Key, keyValuePair.Value); 273ref var value = ref FindValue(keyValuePair.Key); 284ref var value = ref FindValue(keyValuePair.Key); 287Remove(keyValuePair.Key); 1232return new DictionaryEntry(_current.Key, _current.Value); 1235return new KeyValuePair<TKey, TValue>(_current.Key, _current.Value); 1259return new DictionaryEntry(_current.Key, _current.Value); 1272return _current.Key;
src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
556dictionary.Add(pair.Key, pair.Value.ToImmutableAndFree());
Microsoft.CodeAnalysis.LanguageServer (3)
BrokeredServices\Services\BrokeredServiceBridgeManifest\BrokeredServiceBridgeManifestService.cs (1)
45.Select(s => s.Key)
HostWorkspace\ProjectTelemetry\ProjectLoadTelemetryReporter.cs (2)
53var projectFileInfo = firstInfo.Key; 116return fileCounts.ToImmutableDictionary(kvp => VsTfmAndFileExtHashingAlgorithm.HashInput(kvp.Key), kvp => kvp.Value);
Microsoft.CodeAnalysis.LanguageServer.Protocol (7)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.StateManager.HostStates.cs (1)
129var stateSetMap = StateSetMap.Where(kvp => !excludedAnalyzers.Contains(kvp.Key)).ToImmutableDictionary();
Features\Diagnostics\EngineV2\InProcOrRemoteHostAnalyzerRunner.cs (1)
146var result = builderMap.ToImmutableDictionary(kv => kv.Key, kv => DiagnosticAnalysisResult.CreateFromBuilder(kv.Value));
Protocol\Converters\FormattingOptionsConverter.cs (1)
140writer.WritePropertyName(item.Key);
Protocol\SumType.cs (1)
900=> dictionary.ToDictionary(kvp => kvp.Key, kvp => (object)kvp.Value);
RoslynLanguageServer.cs (1)
106keySelector: kvp => kvp.Key,
src\LanguageServer\Microsoft.CommonLanguageServerProtocol.Framework\RequestExecutionQueue.cs (2)
361await Task.WhenAll(concurrentlyExecutingTasksArray.Select(kvp => kvp.Key)).NoThrowAwaitable(captureContext: false); 364Debug.Assert(!concurrentlyExecutingTasks.Any(t => !t.Key.IsCompleted), "The tasks should have all been drained before continuing");
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (3)
SemanticTokens\AbstractSemanticTokensTests.cs (2)
103var kind = tokenTypeToIndex.Where(kvp => kvp.Value == tokens[i + 3]).Single().Key; 124var kind = tokenTypeToIndex.Single(kvp => kvp.Value == data[i + 3]).Key;
SpellCheck\SpellCheckTests.cs (1)
565.SelectMany(kvp => kvp.Value.Select(textSpan => (kind: kvp.Key, textSpan))
Microsoft.CodeAnalysis.PooledObjects.Package (1)
ArrayBuilder.cs (1)
556dictionary.Add(pair.Key, pair.Value.ToImmutableAndFree());
Microsoft.CodeAnalysis.Remote.ServiceHub (6)
Host\TestUtils.cs (5)
55var mismatch1 = assetMapFromNewSolution.Where(p => !allChecksumsFromRequest.Contains(p.Key)).ToList(); 59var mismatch2 = assetMapFromIncrementalSolution.Where(p => !allChecksumsFromRequest.Contains(p.Key)).ToList(); 63var mismatch3 = assetMapFromNewSolution.Where(p => !assetMapFromIncrementalSolution.ContainsKey(p.Key)).ToList(); 66var mismatch4 = assetMapFromIncrementalSolution.Where(p => !assetMapFromNewSolution.ContainsKey(p.Key)).ToList(); 95stringBuilder.AppendLine($"{kv.Key.ToString()}, {kv.Value?.ToString()}");
Services\DiagnosticAnalyzer\PerformanceQueue.cs (1)
233reverseMap.Add(kv.Value, kv.Key);
Microsoft.CodeAnalysis.Remote.ServiceHub.UnitTests (2)
TelemetryLoggerTests.cs (2)
67=> @event.Properties.Select(p => $"{p.Key}={(keyToIgnoreValueInspection == p.Key ? string.Empty : InspectPropertyValue(p.Value))}");
Microsoft.CodeAnalysis.Test.Utilities (12)
Compilation\ControlFlowGraphVerifier.cs (2)
340Assert.Same(pair.Value, graph.GetAnonymousFunctionControlFlowGraph(pair.Key)); 341Assert.Same(pair.Value, graph.GetAnonymousFunctionControlFlowGraphInScope(pair.Key));
Diagnostics\CommonDiagnosticAnalyzers.cs (3)
86foreach (var kvp in s_properties.OrderBy(kvp => kvp.Key)) 94""{0}"": ""{1}""", kvp.Key, kvp.Value); 2143OperationAnalysisContext operationContext = kvp.Key;
Diagnostics\OptionsDiagnosticAnalyzer.cs (1)
69_mismatchedOptions.Aggregate("Mismatched calls: ", (s, m) => s + "\r\nfrom : " + m.Key + ", options :" + m.Value));
FX\ProcessUtilities.cs (1)
54startInfo.Environment[entry.Key] = entry.Value;
MarkedSource\MarkupTestFile.cs (2)
177spans = tempSpans.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); 227spans = dictionary.ToDictionary(kvp => kvp.Key, kvp => kvp.Value.ToImmutableAndFree());
Mocks\TestSourceReferenceResolver.cs (3)
22return new TestSourceReferenceResolver(sources.ToDictionary(p => p.Key, p => (object)p.Value)); 27return new TestSourceReferenceResolver(sources.ToDictionary(p => p.Key, p => p.Value)); 32return new TestSourceReferenceResolver(sources.ToDictionary(p => p.Key, p => (object)p.Value));
Microsoft.CodeAnalysis.Threading.Package (22)
src\Dependencies\Collections\ImmutableSegmentedDictionary`2.cs (2)
183return TryGetValue(pair.Key, out var value) 238result[item.Key] = item.Value;
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+Enumerator.cs (2)
47readonly DictionaryEntry IDictionaryEnumerator.Entry => new(Current.Key, Current.Value); 49readonly object IDictionaryEnumerator.Key => Current.Key;
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+KeyCollection+Enumerator.cs (1)
23public readonly TKey Current => _enumerator.Current.Key;
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+ValueBuilder.cs (6)
117=> Add(item.Key, item.Value); 125Add(pair.Key, pair.Value); 146return TryGetValue(item.Key, out var value) 190GetOrCreateMutableDictionary().Remove(item.Key); 211if (KeyComparer.Equals(pair.Key, equalKey)) 213actualKey = pair.Key;
src\Dependencies\Collections\SegmentedDictionary`2.cs (10)
208Add(pair.Key, pair.Value); 216Add(pair.Key, pair.Value); 269=> Add(keyValuePair.Key, keyValuePair.Value); 273ref var value = ref FindValue(keyValuePair.Key); 284ref var value = ref FindValue(keyValuePair.Key); 287Remove(keyValuePair.Key); 1232return new DictionaryEntry(_current.Key, _current.Value); 1235return new KeyValuePair<TKey, TValue>(_current.Key, _current.Value); 1259return new DictionaryEntry(_current.Key, _current.Value); 1272return _current.Key;
src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
556dictionary.Add(pair.Key, pair.Value.ToImmutableAndFree());
Microsoft.CodeAnalysis.UnitTests (11)
Collections\ImmutableDictionaryTestBase.nonnetstandard.cs (2)
92CollectionAssertAreEquivalent(map.Select(kv => kv.Key).ToList(), Enumerable.Range(1, 100).ToList()); 240Assert.Equal(j, pair.Key);
Diagnostics\DiagnosticLocalizationTests.cs (1)
171_resourceSetMap.Add(kvp.Key, resourceSet);
MetadataReferences\MetadataHelpersTests.cs (8)
451Assert.False(nestedNamespaces.GroupBy(pair => pair.Key).Where(g => g.Count() > 1).Any()); 455Assert.Equal("", array[0].Key); 457Assert.Equal("-", array[1].Key); 459Assert.Equal("a", array[2].Key); 492Assert.Equal("", nestedNS.Key); 497nestedNS.Key.Length, 503Assert.Equal("a", nestedNamespaces.ElementAt(0).Key); 504Assert.Equal("b", nestedNamespaces.ElementAt(1).Key);
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)
1820result(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)
1437If oneKey.Key.IsDefaultOrEmpty Then
Symbols\Source\SourceFieldSymbol.vb (1)
400Dim 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.ExpressionCompiler (1)
Symbols\EEMethodSymbol.vb (1)
169newDisplayClassVariables.Add(pair.Key, variable)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (1)
Serialization\VisualBasicOptionsSerializationService.vb (1)
50writer.WriteString(kv.Key)
Microsoft.CodeAnalysis.Workspaces (79)
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)
69var triggerDocument = diagnosticsToFix.First().Key; 91var triggerProject = diagnosticsToFix.First().Key;
CodeRefactorings\FixAllOccurences\FixAllState.cs (1)
103return spansByDocument.Select(kvp => KeyValuePairUtil.Create(kvp.Key, new Optional<ImmutableArray<TextSpan>>(kvp.Value)))
Diagnostics\DiagnosticAnalysisResultBuilder.cs (1)
198: map.ToImmutableDictionary(kv => kv.Key, kv => kv.Value.ToImmutableArray());
Diagnostics\HostDiagnosticAnalyzers.cs (1)
234builder.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)
1025.Concat(attribute.NamedArguments.Select(n => this.AttributeArgument(n.Key, this.TypedConstantExpression(n.Value))))
FindSymbols\FindReferences\DependentTypeFinder_ProjectIndex.cs (1)
62regularDocumentStates.States.Select(kvp => (kvp.Key, kvp.Value)).Concat(
FindSymbols\FindReferences\FindReferencesSearchEngine.cs (1)
254ProcessDocumentAsync(kvp.Key, kvp.Value, symbolToGlobalAliases, onReferenceFound, cancellationToken)).ConfigureAwait(false);
FindSymbols\SymbolFinder.FindReferencesServerCallback.cs (1)
62_definitionMap[pair.Key] = pair.Value;
FindSymbols\SymbolFinder_Helpers.cs (2)
134Contract.ThrowIfFalse(equivalentTypesWithDifferingAssemblies.All(kvp => !SymbolEquivalenceComparer.Instance.Equals(kvp.Key.ContainingAssembly, kvp.Value.ContainingAssembly))); 137Contract.ThrowIfFalse(equivalentTypesWithDifferingAssemblies.All(kvp => kvp.Key.ContainingType == null));
FindSymbols\TopLevelSyntaxTree\TopLevelSyntaxTreeIndex_Create.cs (1)
32static kvp => kvp.Key,
Log\AbstractLogAggregator.cs (1)
42=> _map.Select(static kvp => KeyValuePairUtil.Create((TKey)kvp.Key, kvp.Value)).GetEnumerator();
Log\KeyValueLogMessage.cs (1)
100Append(builder, entry.Key);
SemanticModelReuse\AbstractSemanticModelReuseLanguageService.cs (1)
39m[kv.Key.ToString()] = kv.Value.GetCount();
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 => KeyValuePairUtil.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\Compilers\Core\Portable\Collections\ImmutableArrayExtensions.cs (2)
1181result.Add(entry.Key, createMembers(entry.Value)); 1226dictionary.Add(entry.Key, namedTypes);
src\Compilers\Core\Portable\DiagnosticAnalyzer\AnalyzerAssemblyLoader.cs (1)
392.Select(x => (x.Key, x.Value?.RealAssemblyPath ?? ""))
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (1)
713var oldPrefix = kv.Key;
src\Compilers\Core\Portable\InternalUtilities\ConcurrentSet.cs (2)
125public T Current => _kvpEnumerator.Current.Key; 157yield return kvp.Key;
src\Compilers\Core\Portable\InternalUtilities\KeyValuePairUtil.cs (1)
18key = keyValuePair.Key;
src\Dependencies\Collections\ImmutableSegmentedDictionary`2.cs (2)
183return TryGetValue(pair.Key, out var value) 238result[item.Key] = item.Value;
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+Enumerator.cs (2)
47readonly DictionaryEntry IDictionaryEnumerator.Entry => new(Current.Key, Current.Value); 49readonly object IDictionaryEnumerator.Key => Current.Key;
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+KeyCollection+Enumerator.cs (1)
23public readonly TKey Current => _enumerator.Current.Key;
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+ValueBuilder.cs (6)
117=> Add(item.Key, item.Value); 125Add(pair.Key, pair.Value); 146return TryGetValue(item.Key, out var value) 190GetOrCreateMutableDictionary().Remove(item.Key); 211if (KeyComparer.Equals(pair.Key, equalKey)) 213actualKey = pair.Key;
src\Dependencies\Collections\SegmentedDictionary`2.cs (10)
208Add(pair.Key, pair.Value); 216Add(pair.Key, pair.Value); 269=> Add(keyValuePair.Key, keyValuePair.Value); 273ref var value = ref FindValue(keyValuePair.Key); 284ref var value = ref FindValue(keyValuePair.Key); 287Remove(keyValuePair.Key); 1232return new DictionaryEntry(_current.Key, _current.Value); 1235return new KeyValuePair<TKey, TValue>(_current.Key, _current.Value); 1259return new DictionaryEntry(_current.Key, _current.Value); 1272return _current.Key;
src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
556dictionary.Add(pair.Key, pair.Value.ToImmutableAndFree());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamedTypeSymbolExtensions.cs (3)
598comparer.Equals(member.Name, kvp.Key.Name) && 599SignatureComparer.Instance.HaveSameSignature(member, kvp.Key, caseSensitive)); 603result.Remove(match.Key);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (1)
225foreach (var (symbol, write) in SymbolsWriteBuilder.Where(kvp => !kvp.Value).Select(kvp => kvp.Key).ToArray())
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BidirectionalMap.cs (1)
25backwardMap: ImmutableDictionary.CreateRange(valueComparer, pairs.Select(static p => KeyValuePairUtil.Create(p.Value, p.Key))))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (1)
242var importsToAdd = importToSyntax.Where(kvp => safeImportsToAdd.Contains(kvp.Key)).Select(kvp => kvp.Value).ToImmutableArray();
Workspace\ProjectSystem\ProjectSystemProject.BatchingDocumentCollection.cs (2)
328if (entry.Key != null) 330_documentPathsToDocumentIds.Remove(entry.Key);
Workspace\Solution\SolutionCompilationState.cs (3)
108Contract.ThrowIfTrue(_projectIdToTrackerMap.Any(kvp => kvp.Key != kvp.Value.ProjectState.Id)); 112.Select(kvp => kvp.Key) 1659missingDocumentStates.SelectAsArray(kvp => (kvp.Key, kvp.Value.ToImmutableAndFree())),
Workspace\Solution\SolutionState.cs (1)
909keySelector: static entry => entry.Key,
Workspace\Workspace.cs (1)
398var relatedDocumentIdsAndStatesArray = relatedDocumentIdsAndStates.SelectAsArray(static kvp => (kvp.Key, kvp.Value));
Workspace\Workspace_Editor.cs (1)
282return _bufferToAssociatedDocumentsMap.Where(kvp => kvp.Value.Contains(documentId)).Select(kvp => kvp.Key).FirstOrDefault();
Microsoft.CodeAnalysis.Workspaces.MSBuild (1)
MSBuild\BuildHostProcessManager.cs (1)
244AddArgument(processStartInfo, globalMSBuildProperty.Key + '=' + globalMSBuildProperty.Value);
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (30)
src\Compilers\Core\Portable\Collections\ImmutableArrayExtensions.cs (2)
1181result.Add(entry.Key, createMembers(entry.Value)); 1226dictionary.Add(entry.Key, namedTypes);
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (1)
713var oldPrefix = kv.Key;
src\Compilers\Core\Portable\InternalUtilities\ConcurrentLruCache.cs (1)
55this.UnsafeAdd(kvp.Key, kvp.Value, true);
src\Compilers\Core\Portable\InternalUtilities\ConcurrentSet.cs (2)
125public T Current => _kvpEnumerator.Current.Key; 157yield return kvp.Key;
src\Compilers\Core\Portable\InternalUtilities\ImmutableSetWithInsertionOrder`1.cs (1)
61get { return _map.OrderBy(kv => kv.Value).Select(kv => kv.Key); }
src\Compilers\Core\Portable\InternalUtilities\KeyValuePairUtil.cs (1)
18key = keyValuePair.Key;
src\Dependencies\Collections\ImmutableSegmentedDictionary`2.cs (2)
183return TryGetValue(pair.Key, out var value) 238result[item.Key] = item.Value;
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+Enumerator.cs (2)
47readonly DictionaryEntry IDictionaryEnumerator.Entry => new(Current.Key, Current.Value); 49readonly object IDictionaryEnumerator.Key => Current.Key;
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+KeyCollection+Enumerator.cs (1)
23public readonly TKey Current => _enumerator.Current.Key;
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+ValueBuilder.cs (6)
117=> Add(item.Key, item.Value); 125Add(pair.Key, pair.Value); 146return TryGetValue(item.Key, out var value) 190GetOrCreateMutableDictionary().Remove(item.Key); 211if (KeyComparer.Equals(pair.Key, equalKey)) 213actualKey = pair.Key;
src\Dependencies\Collections\SegmentedDictionary`2.cs (10)
208Add(pair.Key, pair.Value); 216Add(pair.Key, pair.Value); 269=> Add(keyValuePair.Key, keyValuePair.Value); 273ref var value = ref FindValue(keyValuePair.Key); 284ref var value = ref FindValue(keyValuePair.Key); 287Remove(keyValuePair.Key); 1232return new DictionaryEntry(_current.Key, _current.Value); 1235return new KeyValuePair<TKey, TValue>(_current.Key, _current.Value); 1259return new DictionaryEntry(_current.Key, _current.Value); 1272return _current.Key;
src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
556dictionary.Add(pair.Key, pair.Value.ToImmutableAndFree());
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (3)
BuildHostProcessManagerTests.cs (1)
155return $"{property.Key}={property.Value}";
VisualStudioMSBuildWorkspaceTests.cs (2)
1870defines.Sort((x, y) => x.Key.CompareTo(y.Key));
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (4)
TestAnalyzerReferenceByLanguage.cs (2)
51kvp.Key, kvp.Key == language ? kvp.Value.AddRange(analyzers) : kvp.Value)));
Workspaces\TestHostDocument.cs (1)
121foreach (var namedSpanList in spans.Where(s => s.Key != string.Empty))
Workspaces\TestWorkspace_XmlCreation.cs (1)
127var value = string.Join(";", parseOptions.Features.Select(p => $"{p.Key}={p.Value}"));
Microsoft.CodeAnalysis.Workspaces.UnitTests (1)
Differencing\LongestCommonSubsequenceTests.cs (1)
38sb.AppendFormat("[{0},{1}]", actPair.Key, actPair.Value);
Microsoft.CommonLanguageServerProtocol.Framework.Package (2)
RequestExecutionQueue.cs (2)
361await Task.WhenAll(concurrentlyExecutingTasksArray.Select(kvp => kvp.Key)).NoThrowAwaitable(captureContext: false); 364Debug.Assert(!concurrentlyExecutingTasks.Any(t => !t.Key.IsCompleted), "The tasks should have all been drained before continuing");
Microsoft.CSharp (1)
Microsoft\CSharp\RuntimeBinder\DynamicDebuggerProxy.cs (1)
98pairArray[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.DotNet.Arcade.Sdk (6)
src\InstallDotNetCore.cs (6)
82if (runtimeItems.SelectMany(r => r.Value).Select(r => r.Key).FirstOrDefault(f => !SemanticVersion.TryParse(f, out SemanticVersion version)) != null) 110if (!SemanticVersion.TryParse(item.Key, out version)) 112var propertyName = item.Key.Trim(s_keyTrimChars); 118Log.LogError($"Unable to find '{item.Key}' in properties defined in '{VersionsPropsPath}'"); 122Log.LogError($"Unable to parse '{item.Key}' from properties defined in '{VersionsPropsPath}'"); 128string arguments = $"-runtime \"{runtimeItem.Key}\" -version \"{version.ToNormalizedString()}\"";
Microsoft.DotNet.ArcadeLogging (1)
PipelinesLogger.cs (1)
248propertyCategory = e.GlobalProperties?.LastOrDefault(p => p.Key.ToString().Equals($"_{s_TelemetryMarker}")).Value;
Microsoft.DotNet.AsmDiff (3)
MefHelpers.cs (3)
47var subsetOfConstraints = contract.MetadataConstraints.Where(c => Metadata.ContainsKey(c.Key)).ToDictionary(c => c.Key, c => Metadata[c.Key]);
Microsoft.DotNet.Build.Tasks.Feed (4)
src\BuildModelFactory.cs (1)
200attributes[attribute.Key] = NormalizeAzureDevOpsUrl(attribute.Value);
src\PublishArtifactsInManifestBase.cs (3)
390var category = packagesPerCategory.Key; 781var category = packagesPerCategory.Key; 1005var category = blobsPerCategory.Key;
Microsoft.DotNet.Build.Tasks.Installers (1)
src\BuildFPMToolPreReqs.cs (1)
161Package_Name = pair.Key,
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)
283Log.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.Build.Tasks.Workloads (3)
CreateVisualStudioWorkload.wix.cs (1)
286string platform = kvp.Key;
Msi\MsiPayloadPackageProject.wix.cs (1)
62new XAttribute("Include", packageFile.Key),
Msi\WorkloadPackGroupMsi.wix.cs (1)
135candle.AddPreprocessorDefinition(kvp.Key, kvp.Value);
Microsoft.DotNet.Helix.Client (1)
generated-code\HelixApi.cs (1)
434builder.Append(UrlEncoder.Default.Encode(keyValuePair.Key));
Microsoft.DotNet.Helix.JobSender (1)
JobDefinition.cs (1)
181(await Task.WhenAll(CorrelationPayloads.Select(async p => (uri: await p.Key.UploadAsync(storageContainer, log, cancellationToken), destination: p.Value)))).ToDictionary(x => x.uri, x => x.destination);
Microsoft.DotNet.Helix.Sdk (2)
GetHelixWorkItems.cs (1)
72workItem.SetMetadataValueLiteral(entry.Key, entry.Value);
ProvisioningProfileProvider.cs (1)
85ApplePlatform platform = pair.Key;
Microsoft.DotNet.Open.Api.Tools.Tests (2)
ProcessEx.cs (1)
72startInfo.EnvironmentVariables[envVar.Key] = envVar.Value;
src\Tools\Shared\TestHelpers\TemporaryDirectory.cs (1)
92CreateFile(file.Key, file.Value);
Microsoft.DotNet.RemoteExecutor (1)
RemoteExecutor.cs (1)
539options.RuntimeConfigurationOptions.Select(kvp => $"\"{kvp.Key}\": {ToJsonString(kvp.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.SignTool (13)
src\BatchSignUtil.cs (5)
190new FileSignInfo(new PathWithHash(engine.Key.FileName, engine.Value.ContentHash), engine.Value.SignInfo))); 200_log.LogMessage(MessageImportance.Normal, $"Attaching engine {engine.Key.FileName} to {engine.Value.FullPath}"); 205$"-ab {engine.Key.FileName} {engine.Value.FullPath} -o {engine.Value.FullPath}", workingDirectory, 215File.Delete(engine.Key.FileName); 447var src = entry.Key;
src\Configuration.cs (4)
179switch (errorGroup.Key) 315extension = _fileExtensionSignInfo.OrderByDescending(o => o.Key.Length).FirstOrDefault(f => file.FileName.EndsWith(f.Key, StringComparison.OrdinalIgnoreCase)).Key ?? extension;
src\SignTool.cs (4)
112Arguments = $"-V -xk \"{item.Value}\" \"{Path.GetDirectoryName(item.Key)}\"", 120_log.LogError($"Failed to unzip file {item.Value} to {item.Key}"); 121throw new InvalidOperationException($"Failed to unzip file {item.Value} to {item.Key}"); 132ZipFile.ExtractToDirectory(item.Value, Path.GetDirectoryName(item.Key), true);
Microsoft.DotNet.SignTool.Tests (2)
SignToolTests.cs (2)
1649var tempFileExtensionSignInfo = s_fileExtensionSignInfo.Where(s => s.Key != ".symbols.nupkg").ToDictionary(e => e.Key, e => e.Value);
Microsoft.DotNet.SwaggerGenerator.CodeGenerator (7)
Modeler\KeyValuePairExtensions.cs (1)
15key = pair.Key;
Modeler\ServiceClientModelFactory.cs (6)
125.SelectMany(p => p.Value.Operations.Select(o => (path: p.Key, type: o.Key, operation: o.Value))) 179var selectedResponse = operation.Responses.Where(r => r.Key.StartsWith("2")).Select(p => p.Value).FirstOrDefault(); 423using (WithPropertyName(p.Key)) 426p.Key, 428requiredProperties?.Contains(p.Key) ?? false);
Microsoft.DotNet.VersionTools (15)
Automation\VersionsRepoUpdater.cs (4)
41.OrderBy(t => t.Key) 42.Select(t => $"{t.Key} {t.Value}")); 67if (!packages.ContainsKey(package.Key)) 69packages[package.Key] = package.Value;
BuildManifest\Model\ArtifactModel.cs (3)
90if (other.Attributes.GetOrDefault(localAttr.Key) != null) 96other.Attributes.GetOrDefault(localAttr.Key), 114hash *= (item.Key, item.Value).GetHashCode();
BuildManifest\Model\PdbArtifactModel.cs (1)
27hash *= (item.Key, item.Value).GetHashCode();
BuildManifest\Model\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))
BuildManifest\VersionIdentifier.cs (1)
244replacementIterationResult = replacementIterationResult.Replace(sequence.Key, sequence.Value);
Dependencies\BuildOutput\BuildDependencyInfo.cs (3)
42.Where(pair => !disabledPackages.Contains(pair.Key)) 43.ToDictionary(pair => pair.Key, pair => pair.Value); 46.Select(pair => new PackageIdentity(pair.Key, new NuGetVersion(pair.Value)))
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 (5)
ChatCompletion\OpenTelemetryChatClient.cs (2)
301OpenTelemetryConsts.GenAI.Request.PerProvider(_system, JsonNamingPolicy.SnakeCaseLower.ConvertName(prop.Key)), 403OpenTelemetryConsts.GenAI.Response.PerProvider(_system, JsonNamingPolicy.SnakeCaseLower.ConvertName(prop.Key)),
Embeddings\OpenTelemetryEmbeddingGenerator.cs (2)
166OpenTelemetryConsts.GenAI.Request.PerProvider(_system, JsonNamingPolicy.SnakeCaseLower.ConvertName(prop.Key)), 245OpenTelemetryConsts.GenAI.Response.PerProvider(_system, JsonNamingPolicy.SnakeCaseLower.ConvertName(prop.Key)),
Functions\AIFunctionFactory.cs (1)
308ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
Microsoft.Extensions.AI.Abstractions (14)
AdditionalPropertiesDictionary{TValue}.cs (2)
51_dictionary.Add(item.Key, item.Value); 246public AdditionalProperty[] Items => (from p in _properties select new AdditionalProperty(p.Key, p.Value)).ToArray();
ChatCompletion\StreamingChatCompletionUpdateExtensions.cs (2)
125_ = message.AdditionalProperties.TryAdd(entry.Key, entry.Value); 158foreach (var entry in messages.OrderBy(entry => entry.Key))
src\Shared\JsonSchemaExporter\JsonSchemaExporter.cs (3)
257(required = new()).Add(typeDiscriminatorPair.Key); 392Required = parentPolymorphicTypeContainsTypesWithoutDiscriminator ? new() { typeDiscriminator.Value.Key } : null, 409dictRequired = new() { dictDiscriminator.Key };
src\Shared\JsonSchemaExporter\JsonSchemaExporter.JsonSchema.cs (1)
386properties.Add(property.Key, property.Value.ToJsonNode(options));
UsageDetails.cs (3)
49AdditionalCounts[kvp.Key] = AdditionalCounts.TryGetValue(kvp.Key, out var existingValue) ? 84parts.Add($"{entry.Key} = {entry.Value}");
Utilities\AIJsonUtilities.Schema.cs (3)
253requiredArray = [.. propertiesObj.Select(prop => (JsonNode)prop.Key)]; 384jsonObject[entry.Key] = entry.Value; 395if (string.Equals(entry.Key, key, StringComparison.Ordinal))
Microsoft.Extensions.AI.Abstractions.Tests (16)
AdditionalPropertiesDictionaryTests.cs (1)
127Assert.Equal($"key{count}", item.Key);
AssertExtensions.cs (5)
30if (!actual.TryGetValue(expectedEntry.Key, out object? actualValue)) 32throw new XunitException($"Expected parameter '{expectedEntry.Key}' not found in actual value."); 35AreJsonEquivalentValues(expectedEntry.Value, actualValue, options, propertyName: expectedEntry.Key); 41.Where(e => !expected.ContainsKey(e.Key)) 42.Select(e => $"'{e.Key}'")
Contents\FunctionCallContentTests..cs (9)
166""", TestJsonSerializerContext.Default.Options)!.ToDictionary(k => k.Key, k => (object?)k.Value); 187""", TestJsonSerializerContext.Default.Options)!.ToDictionary(k => k.Key, k => (object?)k.Value); 206""", TestJsonSerializerContext.Default.Options)!.ToDictionary(k => k.Key, k => (object?)k.Value); 242""", TestJsonSerializerContext.Default.Options)!.ToDictionary(k => k.Key, k => (object?)k.Value); 288Assert.Equal("Key1", kvp.Key); 293Assert.Equal("Key2", kvp.Key); 298Assert.Equal("Key3", kvp.Key); 303Assert.Equal("Key4", kvp.Key); 308Assert.Equal("Key5", kvp.Key);
test\Shared\JsonSchemaExporter\SchemaTestHelpers.cs (1)
38.SelectMany(d => d.Errors!.Select(error => $"Path:${d.InstanceLocation} {error.Key}:{error.Value}"));
Microsoft.Extensions.AI.AzureAIInference (4)
AzureAIInferenceChatClient.cs (3)
246entry.Key, 321switch (prop.Key) 328result.AdditionalProperties[prop.Key] = new BinaryData(data);
AzureAIInferenceEmbeddingGenerator.cs (1)
177result.AdditionalProperties[prop.Key] = new BinaryData(data);
Microsoft.Extensions.AI.AzureAIInference.Tests (5)
test\Libraries\Microsoft.Extensions.AI.Abstractions.Tests\AssertExtensions.cs (5)
30if (!actual.TryGetValue(expectedEntry.Key, out object? actualValue)) 32throw new XunitException($"Expected parameter '{expectedEntry.Key}' not found in actual value."); 35AreJsonEquivalentValues(expectedEntry.Value, actualValue, options, propertyName: expectedEntry.Key); 41.Where(e => !expected.ContainsKey(e.Key)) 42.Select(e => $"'{e.Key}'")
Microsoft.Extensions.AI.Integration.Tests (1)
PromptBasedFunctionCallingChatClient.cs (1)
140arguments[kvp.Key] = jsonElement.ValueKind switch
Microsoft.Extensions.AI.Ollama.Tests (5)
test\Libraries\Microsoft.Extensions.AI.Abstractions.Tests\AssertExtensions.cs (5)
30if (!actual.TryGetValue(expectedEntry.Key, out object? actualValue)) 32throw new XunitException($"Expected parameter '{expectedEntry.Key}' not found in actual value."); 35AreJsonEquivalentValues(expectedEntry.Value, actualValue, options, propertyName: expectedEntry.Key); 41.Where(e => !expected.ContainsKey(e.Key)) 42.Select(e => $"'{e.Key}'")
Microsoft.Extensions.AI.OpenAI (4)
OpenAIModelMapper.ChatCompletion.cs (4)
281result.LogitBiases[kvp.Key] = kvp.Value; 299result.Metadata[kvp.Key] = kvp.Value; 364parameters.Add(new(property.Key) 366IsRequired = openAiChatTool.Required.Contains(property.Key),
Microsoft.Extensions.AI.OpenAI.Tests (6)
OpenAISerializationTests.cs (1)
375Assert.Equal("Strict", Assert.Single(function.Metadata.AdditionalProperties).Key);
test\Libraries\Microsoft.Extensions.AI.Abstractions.Tests\AssertExtensions.cs (5)
30if (!actual.TryGetValue(expectedEntry.Key, out object? actualValue)) 32throw new XunitException($"Expected parameter '{expectedEntry.Key}' not found in actual value."); 35AreJsonEquivalentValues(expectedEntry.Value, actualValue, options, propertyName: expectedEntry.Key); 41.Where(e => !expected.ContainsKey(e.Key)) 42.Select(e => $"'{e.Key}'")
Microsoft.Extensions.AI.Tests (5)
test\Libraries\Microsoft.Extensions.AI.Abstractions.Tests\AssertExtensions.cs (5)
30if (!actual.TryGetValue(expectedEntry.Key, out object? actualValue)) 32throw new XunitException($"Expected parameter '{expectedEntry.Key}' not found in actual value."); 35AreJsonEquivalentValues(expectedEntry.Value, actualValue, options, propertyName: expectedEntry.Key); 41.Where(e => !expected.ContainsKey(e.Key)) 42.Select(e => $"'{e.Key}'")
Microsoft.Extensions.ApiDescription.Client.Tests (2)
src\Shared\Process\ProcessEx.cs (1)
118startInfo.EnvironmentVariables[envVar.Key] = envVar.Value;
src\Tools\Shared\TestHelpers\TemporaryDirectory.cs (1)
92CreateFile(file.Key, file.Value);
Microsoft.Extensions.ApiDescription.Tool.Tests (1)
src\Tools\Shared\TestHelpers\TemporaryDirectory.cs (1)
92CreateFile(file.Key, file.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)
708yield return pairs.Key; 712yield 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 (6)
CommandLineConfigurationProvider.cs (6)
144if (!mapping.Key.StartsWith("-") && !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.DependencyInjection (3)
ServiceLookup\CallSiteChain.cs (1)
56ServiceIdentifier serviceIdentifier = pair.Key;
ServiceLookup\CallSiteFactory.cs (2)
339callSitesByIndex.Sort((a, b) => a.Key.CompareTo(b.Key));
Microsoft.Extensions.Diagnostics (5)
Metrics\Configuration\MetricsConfigureOptions.cs (1)
101var instrumentName = instrumentPair.Key;
src\libraries\Common\src\System\Diagnostics\DiagnosticsHelper.cs (4)
60int compareResult = string.CompareOrdinal(pair.Key, pair1.Key); 99int compareResult = string.CompareOrdinal(pair.Key, pair1.Key);
Microsoft.Extensions.Diagnostics.HealthChecks (1)
DefaultHealthCheckService.cs (1)
325builder.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.HealthChecks.Tests (32)
DefaultHealthCheckServiceTest.cs (29)
84results.Entries.OrderBy(kvp => kvp.Key), 87Assert.Equal("DegradedCheck", actual.Key); 96Assert.Equal("HealthyCheck", actual.Key); 102Assert.Equal(DataKey, item.Key); 109Assert.Equal("UnhealthyCheck", actual.Key); 138results.Entries.OrderBy(kvp => kvp.Key), 141Assert.Equal("ExceptionCheck", actual.Key); 150Assert.Equal("OperationExceptionCheck", actual.Key); 189Assert.Equal("HealthyCheck", actual.Key); 195Assert.Equal(DataKey, item.Key); 223Assert.Equal("A", actual.Key); 230Assert.Equal("B", actual.Key); 237Assert.Equal("C", actual.Key); 295Assert.Equal("Throws", actual.Key); 302Assert.Equal("Faults", actual.Key); 309Assert.Equal("Succeeds", actual.Key); 330Assert.Equal("HealthCheckName", item.Key); 352Assert.Equal("TestScope", actual.Key); 376Assert.Equal("Test", actual.Key); 400Assert.Equal("Test", actual.Key); 426Assert.Equal("Test", actual.Key); 431Assert.Equal("Test2", actual.Key); 480Assert.Equal("Test", actual.Key); 523Assert.Equal("test1", entry.Key); 528Assert.Equal("test2", entry.Key); 554Assert.Equal("timeout", actual.Key); 611Assert.Equal("degraded", actual.Key); 616Assert.Equal("healthy", actual.Key); 621Assert.Equal("unhealthy", actual.Key);
HealthCheckPublisherHostedServiceTest.cs (3)
386var entries = publisher.Entries.SelectMany(e => e.report.Entries.Select(e2 => e2.Key)).OrderBy(k => k).ToArray(); 641var entries = publishers[i].Entries.SelectMany(e => e.report.Entries.Select(e2 => e2.Key)).OrderBy(k => k).ToArray(); 657var entries = publishers[i].Entries.SelectMany(e => e.report.Entries.Select(e2 => e2.Key)).OrderBy(k => k).ToArray();
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (6)
Linux\Resources\HardcodedValueFileSystem.cs (1)
27_fileContent = fileContent.ToDictionary(static x => x.Key.FullName, static y => y.Value, StringComparer.OrdinalIgnoreCase);
Linux\Resources\TestResources.cs (5)
58if (!File.Exists(files.Key)) 62File.Create(files.Key).Close(); 63_set.Add(files.Key); 67using var sw = File.CreateText(files.Key); 70_set.Add(files.Key);
Microsoft.Extensions.Diagnostics.Testing (6)
Logging\FakeLogger.cs (2)
119l.Add(new KeyValuePair<string, string?>(pair.Key, ConvertToString(pair))); 123l.Add(new KeyValuePair<string, string?>(pair.Key, null));
Logging\FakeLoggerProvider.cs (1)
99internal string FirstLoggerName => _loggers.First().Key;
Logging\FakeLogRecord.cs (1)
84if (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)
88var ss = logger.LatestRecord.StructuredState!.ToDictionary(x => x.Key, x => x.Value); 104ss = 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\Shared\Debugger\DictionaryItemDebugView.cs (1)
23Key = keyValue.Key;
Microsoft.Extensions.FileProviders.Physical (2)
PhysicalFilesWatcher.cs (2)
388_wildcardTokenLookup.TryRemove(wildCardEntry.Key, out matchInfo)) 477IPollingChangeToken token = item.Key;
Microsoft.Extensions.FileSystemGlobbing (1)
InMemoryDirectoryInfo.cs (1)
116yield return new InMemoryDirectoryInfo(item.Key, item.Value, true);
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 (4)
Logging\HttpHeadersLogValue.cs (4)
43values.Add(new KeyValuePair<string, object>(kvp.Key, kvp.Value)); 50values.Add(new KeyValuePair<string, object>(kvp.Key, kvp.Value)); 96builder.Append(kvp.Key); 99if (_shouldRedactHeaderValue(kvp.Key))
Microsoft.Extensions.Http.Diagnostics (8)
Http\DownstreamDependencyMetadataManager.cs (1)
177finalArrayDict.Add(dep.Key, finalArray);
Logging\Internal\HttpHeadersReader.cs (3)
87if (headersToLog.TryGetValue(header.Key, out var classification)) 89destination.Add(new(header.Key, _redactor.Redact(header.Value, classification))); 100var header = kvp.Key;
Logging\Internal\HttpResponseBodyReader.cs (1)
124_ = newContent.Headers.TryAddWithoutValidation(header.Key, header.Value);
Logging\Internal\Log.cs (1)
171if (kvp.Key == HttpClientLoggingTagNames.Method)
Logging\Internal\LoggerMessageStateExtensions.cs (2)
29items[i].Key, 48items[i].Key,
Microsoft.Extensions.Http.Diagnostics.Tests (66)
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 (20)
254logRecordState.Contains(testEnricher.KvpRequest.Key, expectedLogRecord.GetEnrichmentProperty(testEnricher.KvpRequest.Key)); 346logRecordRequest.NotContains(testEnricher.KvpRequest.Key); 358logRecordFull.Contains(testEnricher.KvpRequest.Key, expectedLogRecord.GetEnrichmentProperty(testEnricher.KvpRequest.Key)); 359logRecordFull.Contains(testEnricher.KvpResponse.Key, expectedLogRecord.GetEnrichmentProperty(testEnricher.KvpResponse.Key)); 452logRecordState.Contains(testEnricher.KvpRequest.Key, expectedLogRecord.GetEnrichmentProperty(testEnricher.KvpRequest.Key)); 453logRecordState.NotContains(testEnricher.KvpResponse.Key); 455Assert.DoesNotContain(logRecordState, kvp => kvp.Key.StartsWith(HttpClientLoggingTagNames.ResponseHeaderPrefix)); 567logRecordState.Contains(testEnricher.KvpRequest.Key, expectedLogRecord.GetEnrichmentProperty(testEnricher.KvpRequest.Key)); 568logRecordState.Contains(testEnricher.KvpResponse.Key, expectedLogRecord.GetEnrichmentProperty(testEnricher.KvpResponse.Key)); 570Assert.DoesNotContain(logRecordState, kvp => kvp.Key.StartsWith(HttpClientLoggingTagNames.ResponseHeaderPrefix)); 659logRecordState.Contains(testEnricher.KvpRequest.Key, expectedLogRecord.GetEnrichmentProperty(testEnricher.KvpRequest.Key)); 932logRecord.Contains(testEnricher.KvpRequest.Key, expectedLogRecord.GetEnrichmentProperty(testEnricher.KvpRequest.Key));
Logging\HttpRequestReaderTest.cs (30)
61RequestHeadersDataClasses = new Dictionary<string, DataClassification> { { header1.Key, FakeTaxonomy.PrivateData }, { header3.Key, FakeTaxonomy.PrivateData } }, 62ResponseHeadersDataClasses = new Dictionary<string, DataClassification> { { header2.Key, FakeTaxonomy.PrivateData }, { header3.Key, FakeTaxonomy.PrivateData } }, 87httpRequestMessage.Headers.Add(header1.Key, header1.Value); 88httpRequestMessage.Headers.Add(header3.Key, header3.Value); 96httpResponseMessage.Headers.Add(header2.Key, header2.Value); 97httpResponseMessage.Headers.Add(header3.Key, header3.Value); 187RequestHeadersDataClasses = new Dictionary<string, DataClassification> { { header1.Key, FakeTaxonomy.PrivateData } }, 188ResponseHeadersDataClasses = new Dictionary<string, DataClassification> { { header2.Key, FakeTaxonomy.PrivateData } }, 213httpRequestMessage.Headers.Add(header1.Key, header1.Value); 225httpResponseMessage.Headers.Add(header2.Key, header2.Value); 261RequestHeadersDataClasses = new Dictionary<string, DataClassification> { { header1.Key, FakeTaxonomy.PrivateData } }, 262ResponseHeadersDataClasses = new Dictionary<string, DataClassification> { { header2.Key, FakeTaxonomy.PrivateData } }, 288httpRequestMessage.Headers.Add(header1.Key, header1.Value); 300httpResponseMessage.Headers.Add(header2.Key, header2.Value); 335RequestHeadersDataClasses = new Dictionary<string, DataClassification> { { header1.Key, FakeTaxonomy.PrivateData } }, 360httpRequestMessage.Headers.Add(header1.Key, header1.Value); 392RequestHeadersDataClasses = new Dictionary<string, DataClassification> { { header1.Key, FakeTaxonomy.PrivateData } }, 393ResponseHeadersDataClasses = new Dictionary<string, DataClassification> { { header2.Key, FakeTaxonomy.PrivateData } }, 418httpRequestMessage.Headers.Add(header1.Key, header1.Value); 430httpResponseMessage.Headers.Add(header2.Key, header2.Value); 463RequestHeadersDataClasses = new Dictionary<string, DataClassification> { { header1.Key, FakeTaxonomy.PrivateData } }, 464ResponseHeadersDataClasses = new Dictionary<string, DataClassification> { { header2.Key, FakeTaxonomy.PrivateData } }, 489httpRequestMessage.Headers.Add(header1.Key, header1.Value); 497httpResponseMessage.Headers.Add(header2.Key, header2.Value); 530RequestHeadersDataClasses = new Dictionary<string, DataClassification> { { header1.Key, FakeTaxonomy.PrivateData } }, 531ResponseHeadersDataClasses = new Dictionary<string, DataClassification> { { header2.Key, FakeTaxonomy.PrivateData } }, 556httpRequestMessage.Headers.Add(header1.Key, header1.Value); 565httpResponseMessage.Headers.Add(header2.Key, header2.Value);
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 (2)
Internal\RequestMessageSnapshot.cs (2)
43_ = clone.Options.TryAdd(prop.Key, prop.Value); 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)
1623results.Add(f.Key);
Microsoft.Extensions.Logging (6)
LoggerFactory.cs (1)
188loggerInformation[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)
168var 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)
248arguments[i] = new KeyValuePair<string, string?>(keyValuePair.Key, keyValuePair.Value?.ToString()); 264writer.WriteString(keyValue.Key, keyValue.Value);
Microsoft.Extensions.Logging.Generators (9)
LoggerMessageGenerator.Emitter.cs (3)
222ReadOnlySpan<char> template = RemoveSpecialSymbol(t.Key.AsSpan()); 237_builder.AppendLine($" {nestedIndentation}var {t.Key} = " 244_builder.AppendLine($" {nestedIndentation}var {t.Key} = this.{NormalizeSpecialSymbol(lm.TemplateParameters[index].CodeName)};");
LoggerMessageGenerator.Parser.cs (6)
204switch (namedArgument.Key) 483if (t.Key.Equals(p.Name, StringComparison.OrdinalIgnoreCase) || 484t.Key.Equals(p.CodeName, StringComparison.OrdinalIgnoreCase) || 485t.Key[0] == '@' && t.Key.Substring(1).Equals(p.CodeName, StringComparison.OrdinalIgnoreCase)) 494Diag(DiagnosticDescriptors.TemplateHasNoCorrespondingArgument, ma.GetLocation(), t.Key);
Microsoft.Extensions.Options.SourceGeneration (16)
Emitter.cs (13)
620var attributesData = _optionsSourceGenContext.AttributesToGenerate.OrderBy(static kvp => kvp.Key, StringComparer.Ordinal).ToArray(); 627if (attributeData.Key == _symbolHolder.MaxLengthAttributeSymbol.Name) 630EmitMaxLengthAttribute(_optionsSourceGenContext.ClassModifier, Emitter.StaticAttributeClassNamePrefix, attributeData.Key, linesToInsert, _optionsSourceGenContext.Suffix); 632else if (attributeData.Key == _symbolHolder.MinLengthAttributeSymbol.Name) 635EmitMinLengthAttribute(_optionsSourceGenContext.ClassModifier, Emitter.StaticAttributeClassNamePrefix, attributeData.Key, linesToInsert, _optionsSourceGenContext.Suffix); 637else if (_symbolHolder.LengthAttributeSymbol is not null && attributeData.Key == _symbolHolder.LengthAttributeSymbol.Name) 640EmitLengthAttribute(_optionsSourceGenContext.ClassModifier, Emitter.StaticAttributeClassNamePrefix, attributeData.Key, linesToInsert, _optionsSourceGenContext.Suffix); 642else if (attributeData.Key == _symbolHolder.CompareAttributeSymbol.Name && attributeData.Value is not null) 645EmitCompareAttribute(_optionsSourceGenContext.ClassModifier, Emitter.StaticAttributeClassNamePrefix, attributeData.Key, linesToInsert: linesToInsert, _optionsSourceGenContext.Suffix); 647else if (attributeData.Key == _symbolHolder.RangeAttributeSymbol.Name) 649EmitRangeAttribute(_optionsSourceGenContext.ClassModifier, Emitter.StaticAttributeClassNamePrefix, attributeData.Key, _optionsSourceGenContext.Suffix, attributeData.Value is not null); 783.OrderBy(p => p.Key) 790attrInstantiationStatementLines.Add($"{GetPaddingString(1)}{prop.Key} = {prop.Value}{(notLast ? "," : string.Empty)}");
Parser.cs (3)
524bool isParams = lastParameterDeclaredWithParamsKeyword && namedArgument.Key == parameters[parameters.Length - 1].Name; 525validationAttr.Properties.Add(namedArgument.Key, GetArrayArgumentExpression(namedArgument.Value.Values, isParams)); 529validationAttr.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.SecretManager.Tools.Tests (11)
SecretManagerTests.cs (10)
107new string[] { "set", secret.Key, secret.Value, "--verbose" } : 108new string[] { "set", secret.Key, secret.Value, "-p", projectPath, "--verbose" }; 115string.Format(CultureInfo.InvariantCulture, "Successfully saved {0} to the secret store.", keyValue.Key), 127string.Format(CultureInfo.InvariantCulture, "{0} = {1}", keyValue.Key, keyValue.Value), 136new string[] { "remove", secret.Key, "--verbose" } : 137new string[] { "remove", secret.Key, "-p", projectPath, "--verbose" }; 294new string[] { "set", secret.Key, secret.Value, "--verbose" } : 295new string[] { "set", secret.Key, secret.Value, "-p", projectPath, "--verbose" }; 302string.Format(CultureInfo.InvariantCulture, "Successfully saved {0} to the secret store.", keyValue.Key), 315string.Format(CultureInfo.InvariantCulture, "{0} = {1}", keyValue.Key, keyValue.Value),
src\Tools\Shared\TestHelpers\TemporaryDirectory.cs (1)
92CreateFile(file.Key, file.Value);
Microsoft.Extensions.Telemetry (7)
Enrichment\ApplicationLogEnricher.cs (1)
30collector.Add(kvp.Key, kvp.Value);
Logging\ExtendedLoggerFactory.cs (1)
169loggerInformation[newLoggerIndex] = new LoggerInformation(provider, existingLogger.Key);
Logging\Import\LoggerFactoryScopeProvider.cs (5)
208sb.Append(_items[0].Key); 215sb.Append(_items[i].Key); 266_stringBuilder.Append(enumerator.Current.Key); 273_stringBuilder.Append(enumerator.Current.Key); 294new KeyValuePair<string, object?>(_enumerator.Current.Key, _enumerator.Current.Value);
Microsoft.Extensions.Telemetry.Abstractions (3)
Logging\LoggerMessageHelper.cs (2)
116if (typeof(TKey).IsValueType || kvp.Key is not null) 119_ = sb.Append(CultureInfo.InvariantCulture, $"\"{kvp.Key}\"=");
Logging\LoggerMessageState.cs (1)
140_ = 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 (7)
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 (5)
507Assert.DoesNotContain(state!, x => x.Key == "exception.message"); 906enrichmentPropertyBag.Add(kvp.Key, kvp.Value!); 929collector.Add(kvp.Key, kvp.Value); 938a[i++] = new(kvp.Key, (string)kvp.Value!); 943collector.Add(kvp.Key, kvp.Value);
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)
Parsing\AttributeProcessors.cs (5)
70switch (a.Key) 139if (a.Key == SkipNullProperties) 146else if (a.Key == OmitReferenceName) 153else if (a.Key == Transitive) 177if (a.Key == OmitReferenceName)
Microsoft.Gen.Logging.Generated.Tests (14)
LoggerMessageAttributeTests.cs (1)
163Assert.Contains(collector.LatestRecord.StructuredState, x => x.Key == key && x.Value == value);
LogMethodTests.cs (5)
383Assert.Equal("p1", logRecord.StructuredState![0].Key); 741Assert.Contains(record.StructuredState, x => x.Key == "event"); 742Assert.DoesNotContain(record.StructuredState, x => x.Key == "@event"); 932Assert.Equal(kvp.Value, rol.GetValue(kvp.Key)); 948Assert.Equal(kvp.Value, rol!.GetValue(kvp.Key));
LogPropertiesTests.cs (3)
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);
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 (7)
src\Generators\Microsoft.Gen.ComplianceReports\Parser.cs (1)
266if (namedArg.Key == "Notes")
src\Generators\Microsoft.Gen.Metrics\Emitter.cs (2)
35foreach (var entry in metricClassesDict.OrderBy(static x => x.Key)) 38GenTypeByNamespace(entry.Key, entry.Value, cancellationToken);
src\Generators\Microsoft.Gen.Metrics\MetricFactoryEmitter.cs (2)
31foreach (var entry in metricClassesDict.OrderBy(static x => x.Key)) 33GenMetricFactoryByNamespace(entry.Key, entry.Value, cancellationToken);
src\Generators\Microsoft.Gen.Metrics\Parser.cs (2)
288arg.Key is "MetricName" or "Name") 613if (namedArgument is { Key: "Name", Value.Value: { } })
Microsoft.Gen.Metrics (6)
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 (2)
288arg.Key is "MetricName" or "Name") 613if (namedArgument is { Key: "Name", Value.Value: { } })
Microsoft.Gen.Metrics.Generated.Tests (30)
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)));
Microsoft.Gen.MetricsReports (2)
src\Generators\Microsoft.Gen.Metrics\Parser.cs (2)
288arg.Key is "MetricName" or "Name") 613if (namedArgument is { Key: "Name", Value.Value: { } })
Microsoft.Interop.ComInterfaceGenerator (3)
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)
301if (arg.Key == CallConvsField)
Microsoft.Interop.LibraryImportGenerator (4)
Analyzers\CustomMarshallerAttributeFixer.cs (1)
62var (marshallerType, managedType, isLinearCollectionMarshaller) = marshallerInfo.Key;
LibraryImportGenerator.cs (1)
127if (arg.Key == CallConvsField)
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 (8)
ManualTypeMarshallingHelper.cs (1)
40hash = HashCode.Combine(hash, mode.Key, mode.Value);
MarshalAsParser.cs (3)
171switch (namedArg.Key) 179_diagnostics.ReportConfigurationNotSupported(attributeData, $"{attributeData.AttributeClass!.Name}{Type.Delimiter}{namedArg.Key}"); 184_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)
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 (2)
Debugger\DebuggerDisplayHelpers.cs (1)
61 sb.Append(kvp.Key);
HotReload\HotReloadHelper.cs (1)
180 var view = pair.Key;
Microsoft.Maui.Controls (70)
Application\Application.cs (2)
352 innerKeys.Add(c.Key); 355 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)
1519 innerKeys.Add(c.Key); 1522 if (innerKeys.Add(value.Key)) 1524 else if (value.Key.StartsWith(Style.StyleClassPrefix, StringComparison.Ordinal)) 1526 var mergedClassStyles = new List<Style>(Resources[value.Key] as List<Style>); 1528 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)
396var 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 (114)
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\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;
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)
191if (pair.Key != AnnotationUtils.Kinds.ScoreColumnKind)
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);
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 (5)
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);
Microsoft.ML.Fairlearn (1)
Metrics\FairlearnMetricCatalog.cs (1)
96var groupMetric = res.Select(kv => (kv.Key, _context.BinaryClassification.EvaluateNonCalibrated(kv.Value)))
Microsoft.ML.FastTree (40)
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 (30)
1684rowHasMissing.Set(kv.Key, true); 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)
477GbmOptions[pair.Key] = pair.Value;
WrappedLightGbmInterface.cs (1)
255res.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 (6)
FactorizationMachine\FieldAwareFactorizationMachineUtils.cs (1)
39featureIndexBuffer[count] = bias + pair.Key;
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 (31)
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 (5)
253VocabReverse.Add(kvp.Value, kvp.Key.Data!); 259_specialTokens = specialTokens.ToDictionary(kvp => new StringSpanOrdinalKey(kvp.Key), kvp => (kvp.Value, kvp.Key)); 260_specialTokensReverse = specialTokens.ToDictionary(kvp => kvp.Value, kvp => kvp.Key); 609public IReadOnlyDictionary<string, int> Vocabulary => _vocabOriginal ??= new ReadOnlyDictionary<string, int>(_vocab.ToDictionary(kvp => kvp.Key.Data!, kvp => kvp.Value));
Model\CodeGenTokenizer.cs (3)
134_specialTokens = specialTokens.ToDictionary(kvp => new StringSpanOrdinalKey(kvp.Key), kvp => (kvp.Value, kvp.Key)); 135_specialTokensReverse = specialTokens.ToDictionary(kvp => kvp.Value, kvp => kvp.Key);
Model\EnglishRobertaTokenizer.cs (1)
242vocab.Add(item.Key.ToString(), item.Value);
Model\SentencePieceTokenizer.cs (3)
85_specialTokens.Add(new StringSpanOrdinalKey(item.Key), item.Value); 86_specialTokensReverse.Add(item.Value, item.Key); 179vocab.Add(item.Key.ToString(), item.Value.Id);
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); 1215tiktokenConfiguration.SpecialTokens.Add(extraSpecialToken.Key, extraSpecialToken.Value); 1375tiktokenConfiguration.SpecialTokens.Add(extraSpecialToken.Key, extraSpecialToken.Value); 1415tiktokenConfiguration.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)
183var token = kvp.Key; 218var token = kvp.Key;
Utils\ByteToUnicodeEncoding.cs (1)
36UnicodeToByte = ByteToUnicode.ToDictionary(kv => kv.Value, kv => kv.Key);
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 (12)
BpeTests.cs (1)
272var reverseVocabulary = bpe.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}");
TiktokenTests.cs (1)
125Assert.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)
601srcTaggedCols.Select(kvp => (kvp.Value, kvp.Key)))), ref view);
Microsoft.NET.StringTools (5)
WeakStringCache.Concurrent.cs (2)
112if (!entry.Value.IsUsed && _stringsByHashCode.TryRemove(entry.Key, out StringWeakHandle? removedHandle)) 118if (!removedHandle.IsUsed || !_stringsByHashCode.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.NET.StringTools.net35 (4)
WeakStringCache.Locking.cs (1)
92keysToRemove.Add(entry.Key);
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.VisualStudio.LanguageServices (11)
ColorSchemes\ColorSchemeApplier.cs (1)
103kvp => kvp.Key, kvp => RegistryItemConverter.Convert(kvp.Value));
Diagnostics\VisualStudioDiagnosticAnalyzerService.cs (1)
147return map.ToDictionary(kv => kv.Key, kv => (IEnumerable<DiagnosticDescriptor>)kv.Value);
Interop\CleanableWeakComHandleTable.cs (1)
98_deadKeySet.Add(pair.Key);
Progression\GraphProvider.cs (1)
182if (nodes.Any(n => n.Properties.Any(p => p.Key == DgmlNodeProperties.ContainsChildren)) ||
Progression\IconHelper.cs (2)
83var localGroup = groupKvp.Key; 84var localItem = itemKvp.Key;
ProjectSystem\BrokeredService\WorkspaceProject.cs (1)
163_project.SetProperty(property.Key, property.Value);
ProjectSystem\RuleSets\VisualStudioRuleSetManager.RuleSetFile.cs (1)
135specificDiagnosticOptions.Add(rule.Key, rule.Value);
src\Compilers\Core\Portable\InternalUtilities\ConcurrentLruCache.cs (1)
55this.UnsafeAdd(kvp.Key, kvp.Value, true);
TableDataSource\Suppression\VisualStudioSuppressionFixService.cs (2)
475foreach (var group in builder.GroupBy(kvp => kvp.Key.ProjectId)) 502var document = project.GetDocument(documentDiagnostics.Key);
Microsoft.VisualStudio.LanguageServices.CSharp (2)
CodeModel\ModifierFlagsExtensions.cs (1)
114if ((flags & modifierDefinition.Key) != 0)
ProjectSystemShim\CSharpProjectShim.OptionsProcessor.cs (1)
98diagnosticOptions[pair.Key] = ReportDiagnostic.Error;
Microsoft.VisualStudio.LanguageServices.DevKit (1)
Logging\VSCodeTelemetryLogger.cs (1)
174sb.AppendFormat("\"{0}\":{1},", keyValue.Key, keyValue.Value);
MSBuild (40)
CollectionHelpers.cs (1)
67if (!b.TryGetValue(aKvp.Key, out var bValue))
CommunicationsUtilities.cs (4)
423if (!newEnvironment.ContainsKey(entry.Key)) 425SetEnvironmentVariable(entry.Key, null); 432if (!currentEnvironment.TryGetValue(entry.Key, out string currentValue) || currentValue != entry.Value) 434SetEnvironmentVariable(entry.Key, entry.Value);
CopyOnWriteDictionary.cs (3)
258_backing = _backing.SetItem(item.Key, item.Value); 292_backing = _backing.Remove(item.Key); 363array.SetValue(new DictionaryEntry(entry.Key, entry.Value), index + i);
LogMessagePacketBase.cs (1)
329_sinkId = nodeBuildEvent.Value.Key;
OutOfProcTaskAppDomainWrapperBase.cs (2)
328PropertyInfo paramInfo = wrappedTask.GetType().GetProperty(param.Key, BindingFlags.Instance | BindingFlags.Public); 338[param.Key, param.Value.ToString(), taskName]);
OutOfProcTaskHostNode.cs (15)
1023string oldValue = variable.Value.Key; 1030environment.TryGetValue(variable.Key, out environmentValue); 1048LogMessageFromResource(MessageImportance.Low, "ModifyingTaskHostEnvironmentVariable", variable.Key, newValue, environmentValue ?? String.Empty); 1051updatedEnvironment[variable.Key] = newValue; 1055updatedEnvironment.Remove(variable.Key); 1091string newValue = variable.Value.Key; 1097environment.TryGetValue(variable.Key, out environmentValue); 1105updatedEnvironment[variable.Key] = newValue; 1109updatedEnvironment.Remove(variable.Key); 1146if (!environment.TryGetValue(variable.Key, out newValue)) 1148s_mismatchedEnvironmentValues[variable.Key] = new KeyValuePair<string, string>(null, oldValue); 1154s_mismatchedEnvironmentValues[variable.Key] = new KeyValuePair<string, string>(newValue, oldValue); 1163if (!_savedEnvironment.TryGetValue(variable.Key, out oldValue)) 1165s_mismatchedEnvironmentValues[variable.Key] = new KeyValuePair<string, string>(newValue, null); 1171s_mismatchedEnvironmentValues[variable.Key] = new KeyValuePair<string, string>(newValue, oldValue);
TaskHostConfiguration.cs (1)
204_taskParameters[parameter.Key] = new TaskParameter(parameter.Value);
TaskHostTaskComplete.cs (1)
123_taskOutputParameters[parameter.Key] = new TaskParameter(parameter.Value);
TaskParameter.cs (7)
449escapedGenericWrappedMetadata[entry.Key] = entry.Value == null ? entry.Value : EscapingUtilities.Escape(entry.Value); 898string value = destinationItem.GetMetadata(entry.Key); 902destinationItem.SetMetadata(entry.Key, entry.Value); 930clonedMetadata.Add(metadatum.Key, EscapingUtilities.UnescapeAll(metadatum.Value)); 1013var unescaped = new KeyValuePair<string, string>(kvp.Key, EscapingUtilities.UnescapeAll(kvp.Value)); 1029var unescaped = new KeyValuePair<string, string>(kvp.Key, EscapingUtilities.UnescapeAll(kvp.Value)); 1038SetMetadata(kvp.Key, kvp.Value);
TypeLoader.cs (1)
368if (typeName.Length == 0 || TypeLoader.IsPartialTypeNameMatch(desiredTypeInAssembly.Key, typeName))
XMake.cs (4)
1621nodeResultKvp.Key.ProjectInstance.FullPath.Equals(entryPoint.ProjectFile) && 1622nodeResultKvp.Key.ProjectInstance.GlobalProperties.Count == entryPoint.GlobalProperties.Count && 1623nodeResultKvp.Key.ProjectInstance.GlobalProperties.All(propertyKvp => entryPoint.GlobalProperties.TryGetValue(propertyKvp.Key, out string entryValue) &&
MSBuildTaskHost (49)
BinaryTranslator.cs (8)
1369string key = pair.Key; 1381string key = pair.Key; 1401string key = pair.Key; 1424K key = pair.Key; 1451string key = pair.Key; 1479string key = pair.Key; 1508string key = pair.Key; 1531string key = kvp.Key;
BinaryWriterExtensions.cs (1)
127writer.Write(kvp.Key);
BuildExceptionBase.cs (1)
107writer.Write(pair.Key);
CommunicationsUtilities.cs (4)
423if (!newEnvironment.ContainsKey(entry.Key)) 425SetEnvironmentVariable(entry.Key, null); 432if (!currentEnvironment.TryGetValue(entry.Key, out string currentValue) || currentValue != entry.Value) 434SetEnvironmentVariable(entry.Key, entry.Value);
CopyOnWriteDictionary.cs (3)
258_backing = _backing.SetItem(item.Key, item.Value); 292_backing = _backing.Remove(item.Key); 363array.SetValue(new DictionaryEntry(entry.Key, entry.Value), index + i);
Immutable\ImmutableDictionary.cs (3)
106array.SetValue(new DictionaryEntry(item.Key, item.Value), arrayIndex++); 148clone._backing[item.Key] = item.Value; 215n.Add(item.Key, item.Value);
LogMessagePacketBase.cs (1)
329_sinkId = nodeBuildEvent.Value.Key;
NativeMethods.cs (1)
1358KillTree(childProcessInfo.Key);
OutOfProcTaskAppDomainWrapperBase.cs (2)
328PropertyInfo paramInfo = wrappedTask.GetType().GetProperty(param.Key, BindingFlags.Instance | BindingFlags.Public); 338[param.Key, param.Value.ToString(), taskName]);
OutOfProcTaskHostNode.cs (15)
1023string oldValue = variable.Value.Key; 1030environment.TryGetValue(variable.Key, out environmentValue); 1048LogMessageFromResource(MessageImportance.Low, "ModifyingTaskHostEnvironmentVariable", variable.Key, newValue, environmentValue ?? String.Empty); 1051updatedEnvironment[variable.Key] = newValue; 1055updatedEnvironment.Remove(variable.Key); 1091string newValue = variable.Value.Key; 1097environment.TryGetValue(variable.Key, out environmentValue); 1105updatedEnvironment[variable.Key] = newValue; 1109updatedEnvironment.Remove(variable.Key); 1146if (!environment.TryGetValue(variable.Key, out newValue)) 1148s_mismatchedEnvironmentValues[variable.Key] = new KeyValuePair<string, string>(null, oldValue); 1154s_mismatchedEnvironmentValues[variable.Key] = new KeyValuePair<string, string>(newValue, oldValue); 1163if (!_savedEnvironment.TryGetValue(variable.Key, out oldValue)) 1165s_mismatchedEnvironmentValues[variable.Key] = new KeyValuePair<string, string>(newValue, null); 1171s_mismatchedEnvironmentValues[variable.Key] = new KeyValuePair<string, string>(newValue, oldValue);
TaskHostConfiguration.cs (1)
204_taskParameters[parameter.Key] = new TaskParameter(parameter.Value);
TaskHostTaskComplete.cs (1)
123_taskOutputParameters[parameter.Key] = new TaskParameter(parameter.Value);
TaskParameter.cs (7)
449escapedGenericWrappedMetadata[entry.Key] = entry.Value == null ? entry.Value : EscapingUtilities.Escape(entry.Value); 898string value = destinationItem.GetMetadata(entry.Key); 902destinationItem.SetMetadata(entry.Key, entry.Value); 930clonedMetadata.Add(metadatum.Key, EscapingUtilities.UnescapeAll(metadatum.Value)); 1013var unescaped = new KeyValuePair<string, string>(kvp.Key, EscapingUtilities.UnescapeAll(kvp.Value)); 1029var unescaped = new KeyValuePair<string, string>(kvp.Key, EscapingUtilities.UnescapeAll(kvp.Value)); 1038SetMetadata(kvp.Key, kvp.Value);
TypeLoader.cs (1)
277if (typeName.Length == 0 || TypeLoader.IsPartialTypeNameMatch(desiredTypeInAssembly.Key, typeName))
Mvc.RoutingWebSite (6)
Controllers\LG1Controller.cs (1)
130return new RouteValueDictionary(query.ToDictionary(kvp => kvp.Key, kvp => kvp.Value.ToString()));
Controllers\LinkParserController.cs (1)
51obj.Add(kvp.Key, new JValue(kvp.Value.ToString()));
src\Mvc\test\WebSites\Common\TestResponseGenerator.cs (4)
31.Where(kvp => kvp.Key != "link" && kvp.Key != "link_action" && kvp.Key != "link_controller") 32.ToDictionary(kvp => kvp.Key.Substring("link_".Length), kvp => (object)kvp.Value[0]);
NativeIISSample (1)
Startup.cs (1)
67await context.Response.WriteAsync(header.Key + ": " + header.Value + Environment.NewLine);
PrepareTests (2)
MinimizeUtil.cs (2)
109CreateHardLink(getPeFilePath(pair.Key), pair.Value[0].FullPath); 129.SelectMany(pair => pair.Value.Select(fp => (Id: pair.Key, FilePath: fp)))
PresentationBuildTasks (1)
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\XmlCompatibilityReader.cs (1)
136keysToUpdate.Add(pair.Key);
PresentationCore (19)
MS\Internal\FontCache\FontFaceLayoutInfo.cs (1)
712return ContainsKey(item.Key);
MS\Internal\FontFace\PhysicalFontFamily.cs (1)
48XmlLanguage language = XmlLanguage.GetLanguage(pair.Key.Name);
System\Windows\Media\CharacterMetricsDictionary.cs (9)
87item.Key, 108return item.Value != null && item.Value.Equals(GetValue(item.Key)); 159return item.Value != null && RemoveValue(item.Key, item.Value); 190typedArray[index++] = new SC.DictionaryEntry(item.Key, item.Value); 206array.SetValue(new SC.DictionaryEntry(item.Key, item.Value), index++); 466result[i++] = pair.Key; 559return new SC.DictionaryEntry(entry.Key, entry.Value); 585return new SC.DictionaryEntry(entry.Key, entry.Value); 593return GetCurrentEntry().Key;
System\Windows\Media\CultureSpecificStringDictionary.cs (6)
83Add(item.Key, item.Value); 159typedArray[index++] = new SC.DictionaryEntry(item.Key, item.Value); 175array.SetValue(new SC.DictionaryEntry(item.Key, item.Value), index++); 393if (entry.Key == null) 404return new SC.DictionaryEntry(entry.Key, entry.Value); 412return GetCurrentEntry().Key;
System\Windows\Media\GlyphTypeface.cs (2)
391adjustedLanguageFaceNames[XmlLanguage.GetLanguage(pair.Key.IetfLanguageTag)] = pair.Value; 1805return ContainsKey(item.Key);
PresentationFramework (48)
MS\Internal\Annotations\Storage\StoreAnnotationsMap.cs (1)
173annotations.Add(annotKV.Key, annotKV.Value.Annotation);
MS\Internal\Data\AccessorTable.cs (1)
116_table.Remove(entry.Key);
MS\Internal\Data\CollectionViewGroupInternal.cs (2)
545_nameToGroupMap.Remove(item.Key); 591_nameToGroupMap.Remove(item.Key);
MS\Internal\Globalization\BamlTreeMap.cs (1)
494return pair.Key;
MS\Internal\Globalization\BamlTreeUpdater.cs (3)
49if (!ApplyChangeToBamlTree(item.Key, item.Value, updateMap)) 63ApplyChangeToBamlTree(entry.Key, entry.Value, updateMap); 72BamlLocalizableResourceKey key = item.Key;
MS\Internal\Helper.cs (6)
759if (itemValues[i].Key == dpIndex) 787if (itemValues[j].Key == dpIndex) 812if (itemValues[i].Key == dpIndex) 890if (itemValues[i].Key == dpIndex) 1034if (itemValue.Key == ItemValueStorageField.GlobalIndex) 1041if (itemValue.Key == dpIndices[j])
MS\Internal\Ink\ClipboardProcessor.cs (2)
188InkCanvasClipboardFormat format = pair.Key; 257yield return pair.Key;
MS\Internal\WeakDictionary.cs (4)
268this.Add(item.Key, item.Value); 278if (!_hashTable.ContainsKey(item.Key)) 283if (object.Equals(_hashTable[item.Key], item.Value)) 324return this.Remove(item.Key);
System\Windows\Annotations\LocatorPart.cs (3)
109if (!part._nameValues.TryGetValue(k_v.Key, out otherValue)) 143newPart.NameValuePairs.Add(k_v.Key, k_v.Value); 406res += $"@{AnnotationXmlConstants.Attributes.ItemName}=\"{k_v.Key}\" and @{AnnotationXmlConstants.Attributes.ItemValue}=\"{k_v.Value}\"]";
System\Windows\Annotations\LocatorPartList.cs (1)
172writer.WriteAttributeString(AnnotationXmlConstants.Attributes.ItemName, pair.Key);
System\Windows\Annotations\Storage\XmlStreamStore.cs (1)
854reader.DeclareNamespaceCompatibility(item.Key.ToString(), name.ToString());
System\Windows\Automation\Peers\ItemsControlAutomationPeer.cs (8)
593if (Object.Equals(item, pair.Key)) 653if (Object.Equals(item, pair.Key)) 682cleanUpItemsCollection.Add(dictionaryEntry.Key); 688cleanUpItemsCollection.Add(dictionaryEntry.Key); 693cleanUpItemsCollection.Add(dictionaryEntry.Key); 706cleanUpItemsCollection.Add(keyValuePair.Key); 712cleanUpItemsCollection.Add(keyValuePair.Key); 717cleanUpItemsCollection.Add(keyValuePair.Key);
System\Windows\Diagnostics\ResourceDictionaryDiagnostics.cs (2)
510if (kvp.Key.Item == null || !kvp.Value.TryGetTarget(out dict)) 516toRemove.Add(kvp.Key);
System\Windows\Documents\DocumentSequence.cs (1)
901notificationList.Add(ienum.Current.Key);
System\Windows\Documents\FixedDocument.cs (1)
1223completedRequests.Add(ienum.Current.Key);
System\Windows\Documents\WinRTSpellerInterop.cs (1)
520string ietfLanguageTag = items.Key;
System\Windows\Markup\Baml2006\Baml2006ReaderFrame.cs (1)
73prefix = pair.Key;
System\Windows\Markup\Localizer\BamlLocalizationDictionary.cs (2)
311DictionaryEntry entry = new(pair.Key, pair.Value); 393newDictionary.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)
314newDict.Add(kvp.Key, kvp.Value);
System\Windows\Shell\WindowChromeWorker.cs (1)
353if (handlePair.Key == message)
System\Windows\SystemResources.cs (1)
2123deadKeys.Add(entry.Key);
System\Windows\VisualStateManager.cs (3)
384currentAnimations.Remove(pair.Key); 385newStateAnimations.Remove(pair.Key); 404currentAnimations.Remove(pair.Key);
ProjectCachePlugin (1)
AssemblyMockCache.cs (1)
32? string.Join("\n\t", ep.GlobalProperties.Select(gp => $"{gp.Key}:{gp.Value}"))
ReachFramework (2)
MS\Internal\Printing\MostFrequentlyUsedCache.cs (1)
69minUseCountKey = pair.Key;
PrintConfig\PrintSchemaShim.cs (1)
1164setter(pair.Key);
Roslyn.Compilers.Extension (4)
CompilerPackage.cs (4)
118var parentDirectory = new DirectoryInfo(Path.GetDirectoryName(fileAndContents.Key)); 122if (File.Exists(fileAndContents.Key) && File.ReadAllText(fileAndContents.Key) == fileAndContents.Value) 127File.WriteAllText(fileAndContents.Key, fileAndContents.Value);
Roslyn.Test.PdbUtilities (1)
EditAndContinue\EditAndContinueTest.GenerationVerifier.cs (1)
137.Single(e => e.Key.ToString() == typeName).Value.Where(s => s.Kind == SymbolKind.Field)
Roslyn.VisualStudio.Next.UnitTests (5)
Services\PerformanceTrackerServiceTests.cs (1)
183yield return new AnalyzerPerformanceInfo(kv.Key, true, TimeSpan.FromMilliseconds(timeSpan));
TestUtils.cs (1)
28Assert.True(storage.TryGetAsset(kv.Key, out object? _));
UnifiedSettings\UnifiedSettingsTests.cs (3)
135var propertyToCategory = categories.ToDictionary(kvp => kvp.Key, kvp => kvp.Value.Deserialize<Category>()); 237var propertyToCategory = categories.ToDictionary(kvp => kvp.Key, kvp => kvp.Value.Deserialize<Category>()); 262.Where(jsonObject => jsonObject.Key.StartsWith(prefix))
RunTests (4)
AssemblyScheduler.cs (3)
46ConsoleUtil.WriteLine($"\tAssembly: {Path.GetFileName(kvp.Key)}, Test Type Count: {typeCount}, Test Count: {testCount}"); 83.OrderBy(kvp => kvp.Key) 109kvp => kvp.Key,
ProcessRunner.cs (1)
199processStartInfo.EnvironmentVariables[pair.Key] = pair.Value;
ScenarioTests.Common.Tests (1)
ScenarioTestTypes.cs (1)
231workItem.Key(workItem.Value);
Shared (4)
JsonSchemaExporter\JsonSchemaExporter.cs (3)
257(required = new()).Add(typeDiscriminatorPair.Key); 392Required = parentPolymorphicTypeContainsTypesWithoutDiscriminator ? new() { typeDiscriminator.Value.Key } : null, 409dictRequired = new() { dictDiscriminator.Key };
JsonSchemaExporter\JsonSchemaExporter.JsonSchema.cs (1)
386properties.Add(property.Key, property.Value.ToJsonNode(options));
Shared.Tests (1)
JsonSchemaExporter\SchemaTestHelpers.cs (1)
38.SelectMany(d => d.Errors!.Select(error => $"Path:${d.InstanceLocation} {error.Key}:{error.Value}"));
SocialSample (1)
Startup.cs (1)
227await context.Response.WriteAsync($"-{ HtmlEncoder.Default.Encode(pair.Key)}={ HtmlEncoder.Default.Encode(pair.Value)}<br>");
Stress.TelemetryService (1)
TelemetryStresser.cs (1)
110point.Attributes.Add(new KeyValue { Key = attribute.Key, Value = new AnyValue { StringValue = attribute.Value } });
System.Collections (36)
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\DebugViewDictionaryItem.cs (1)
22Key = keyValue.Key;
System\Collections\Generic\OrderedDictionary.cs (22)
303SetAt(index, tpair.Key, tpair.Value); 353set => SetAt(index, value.Key, value.Value); 521Add(pair.Key, pair.Value); 528Add(pair.Key, pair.Value); 1169ThrowIfNull(item.Key, nameof(item)); 1171int index = IndexOf(item.Key); 1185void IList<KeyValuePair<TKey, TValue>>.Insert(int index, KeyValuePair<TKey, TValue> item) => Insert(index, item.Key, item.Value); 1188void ICollection<KeyValuePair<TKey, TValue>>.Add(KeyValuePair<TKey, TValue> item) => Add(item.Key, item.Value); 1193ThrowIfNull(item.Key, nameof(item)); 1196TryGetValue(item.Key, out TValue? value) && 1219TryGetValue(item.Key, out TValue? value) && 1221Remove(item.Key); 1330Add(pair.Key, pair.Value); 1337TryGetValue(pair.Key, out TValue? v) && 1359Insert(index, pair.Key, pair.Value); 1410new DictionaryEntry(Current.Key, Current.Value) : 1414readonly DictionaryEntry IDictionaryEnumerator.Entry => new(Current.Key, Current.Value); 1417readonly object IDictionaryEnumerator.Key => Current.Key; 1568get => _dictionary.GetAt(index).Key; 1575get => _dictionary.GetAt(index).Key; 1580TKey IReadOnlyList<TKey>.this[int index] => _dictionary.GetAt(index).Key; 1640public TKey Current => _enumerator.Current.Key;
System\Collections\Generic\SortedDictionary.cs (10)
131node.Item = new KeyValuePair<TKey, TValue>(node.Item.Key, value); 466return new DictionaryEntry(Current.Key, Current.Value); 470return new KeyValuePair<TKey, TValue>(Current.Key, Current.Value); 484return Current.Key; 510return new DictionaryEntry(Current.Key, Current.Value); 547_dictionary._set.InOrderTreeWalk(delegate (TreeSet<KeyValuePair<TKey, TValue>>.Node node) { array[index++] = node.Item.Key; return true; }); 580_dictionary._set.InOrderTreeWalk(delegate (TreeSet<KeyValuePair<TKey, TValue>>.Node node) { objects[index++] = node.Item.Key; return true; }); 652return _dictEnum.Current.Key; 849return 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 (10)
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\DebugViewDictionaryItem.cs (1)
22Key = keyValue.Key;
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); 1627void ICollection<KeyValuePair<TKey, TValue>>.Add(KeyValuePair<TKey, TValue> keyValuePair) => ((IDictionary<TKey, TValue>)this).Add(keyValuePair.Key, keyValuePair.Value); 1639TryGetValue(keyValuePair.Key, out TValue? value) && 2326public DictionaryEntry Entry => new DictionaryEntry(_enumerator.Current.Key, _enumerator.Current.Value); 2328public object Key => _enumerator.Current.Key;
System.Collections.Immutable (54)
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\DebugViewDictionaryItem.cs (1)
22Key = keyValue.Key;
System\Collections\Frozen\FrozenDictionary.cs (5)
96newDictionary[pair.Key] = pair.Value; 383pairs[index++] = new KeyValuePair<TKey, TValue>(item.Key, item.Value); 390dictEntryArray[index++] = new DictionaryEntry(item.Key, item.Value); 404objects[index++] = new KeyValuePair<TKey, TValue>(item.Key, item.Value); 557TryGetValue(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)
163yield return item.Key; 351array.SetValue(new DictionaryEntry(item.Key, item.Value), arrayIndex++); 611this.Add(item.Key, item.Value); 666return 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 (8)
174yield return item.Key; 757array.SetValue(new DictionaryEntry(item.Key, item.Value), arrayIndex++); 883int hashCode = origin.KeyComparer.GetHashCode(keyValuePair.Key); 888return bucket.TryGetValue(keyValuePair.Key, origin.Comparers, out value!) 958Requires.NotNullAllowStructs(pair.Key, nameof(pair.Key)); 959int hashCode = origin.KeyComparer.GetHashCode(pair.Key); 962ImmutableDictionary<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)
311newRoot = newRoot.Add(item.Key, item.Value, value, _valueComparer, out mutated); 485this.Add(item.Key, item.Value); 520return 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\libraries\System.Private.CoreLib\src\System\Collections\Generic\DebugViewDictionaryItem.cs (1)
22Key = keyValue.Key;
System.ComponentModel.Annotations (5)
System\ComponentModel\DataAnnotations\UIHintAttribute.cs (2)
152return leftParams.OrderBy(p => p.Key).SequenceEqual(rightParams.OrderBy(p => p.Key));
System\ComponentModel\DataAnnotations\Validator.cs (3)
470var attributes = _store.GetPropertyValidationAttributes(property.Key); 475errors.AddRange(GetValidationErrors(property.Value, property.Key, attributes, breakOnFirstError)); 486var 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)
252_values![index].Key, _values[index].Value); 272if (_values![index].Key == key) 295if (_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 (3)
System\ComponentModel\ComponentResourceManager.cs (1)
142string key = kvp.Key;
System\ComponentModel\ReflectTypeDescriptionProvider.cs (2)
867if (kvp.Key.Module == module && kvp.Value!.IsPopulated) 869typeList.Add(kvp.Key);
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)}"))); 188if (!second.TryGetValue(firstItem.Key, out object secondValue)) 222result ^= 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)
443string 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\libraries\Common\src\System\Data\Common\DbConnectionOptions.Common.cs (1)
500string keyname = entry.Key;
System\Data\Common\DbConnectionStringBuilder.cs (1)
323if (!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\libraries\Common\src\System\Data\Common\DbConnectionOptions.Common.cs (1)
500string keyname = entry.Key;
src\libraries\Common\src\System\Data\ProviderBase\DbConnectionFactory.cs (2)
224newConnectionPoolGroups.Add(entry.Key, entry.Value); 320newConnectionPoolGroups.Add(entry.Key, entry.Value);
src\libraries\Common\src\System\Data\ProviderBase\DbConnectionPoolGroup.cs (1)
261newPoolCollection.TryAdd(entry.Key, entry.Value);
System.Diagnostics.DiagnosticSource (52)
src\libraries\Common\src\System\Diagnostics\DiagnosticsHelper.cs (4)
60int compareResult = string.CompareOrdinal(pair.Key, pair1.Key); 99int compareResult = string.CompareOrdinal(pair.Key, pair1.Key);
System\Diagnostics\Activity.cs (18)
434if (key == keyValue.Key) 574if (exceptionTags[i].Key == ExceptionMessageTag) 578else if (exceptionTags[i].Key == ExceptionStackTraceTag) 582else if (exceptionTags[i].Key == ExceptionTypeTag) 1577Remove(value.Key); 1586if (current.Value.Key == value.Key) 1610if (_first.Value.Key == key) 1620if (previous.Next.Value.Key == key) 1710if (current.Value.Key == key) 1729if (_first.Value.Key == key) 1743if (previous.Next.Value.Key == key) 1761Remove(value.Key); 1770if (current.Value.Key == value.Key) 1805yield return new KeyValuePair<string, string?>(current.Value.Key, (string?)current.Value.Value); 1822_stringBuilder.Append(_first.Value.Key); 1830_stringBuilder.Append(current.Value.Key);
System\Diagnostics\ActivityLink.netcoreapp.cs (1)
24hashCode.Add(kvp.Key);
System\Diagnostics\ActivitySource.cs (2)
47tagList.Sort((left, right) => string.Compare(left.Key, right.Key, StringComparison.Ordinal));
System\Diagnostics\ActivityTagsCollection.cs (7)
46if (kvp.Key != null) 48this[kvp.Key] = kvp.Value; 107list.Add(kvp.Key); 167if (item.Key == null) 172int index = FindIndex(item.Key); 175throw new InvalidOperationException(SR.Format(SR.KeyAlreadyExist, item.Key)); 275if (_list[i].Key == key)
System\Diagnostics\DistributedContextPropagator.cs (1)
120baggageList.Append(WebUtility.UrlEncode(item.Key)).Append('=').Append(WebUtility.UrlEncode(item.Value)).Append(CommaWithSpace);
System\Diagnostics\DsesFilterAndTransform.cs (2)
512if (eventNameFilter != null && eventNameFilter != evnt.Key) 516var 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)
441kv.Value.Collect(kv.Key, (LabeledAggregationStatistics labeledAggStats) => 443_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)
85tagList.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)
282if (item.Key == tags[i].Key && item.Value.Equals(tags[i].Value)) 292if (item.Key == tags[i].Key && tags[i].Value is null)
System.Diagnostics.Process (6)
System\Collections\Specialized\DictionaryWrapper.cs (4)
44public void Add(KeyValuePair<string, string?> item) => Add(item.Key, item.Value); 52return _contents.ContainsKey(item.Key) && _contents[item.Key] == item.Value; 76return Remove(item.Key);
System\Collections\Specialized\StringDictionaryWrapper.cs (1)
57yield return new DictionaryEntry(keyValuePair.Key, keyValuePair.Value);
System\Diagnostics\Process.Unix.cs (1)
620envp[index++] = pair.Key + "=" + pair.Value;
System.Formats.Nrbf (1)
System\Formats\Nrbf\SystemClassWithMembersAndTypesRecord.cs (1)
53string memberName = structEnumerator.Current.Key;
System.Formats.Tar (7)
System\Formats\Tar\TarHeader.cs (6)
125int index = kvp.Key.AsSpan().IndexOfAny('=', '\n'); 128throw new ArgumentException(SR.Format(SR.TarExtAttrDisallowedKeyChar, kvp.Key, kvp.Key[index] == '\n' ? "\\n" : kvp.Key[index])); 132throw new ArgumentException(SR.Format(SR.TarExtAttrDisallowedValueChar, kvp.Key, "\\n")); 137_ea.Add(kvp.Key, kvp.Value);
System\Formats\Tar\TarHelpers.Unix.cs (1)
114File.SetUnixFileMode(dir.Key, dir.Value & ~umask);
System.IO.Packaging (5)
System\IO\Packaging\ContentType.cs (1)
197if (contentTypeEnumerator.Current.Key != null)
System\IO\Packaging\Package.cs (1)
1222_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 (12)
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\HeaderUtilities.cs (1)
347sb.Append(header.Key);
System\Net\Http\Headers\HttpHeaders.cs (1)
1395Key = entry.Key,
System\Net\Http\Headers\HttpHeadersNonValidated.cs (1)
103yield return header.Key;
System\Net\Http\MultipartContent.cs (4)
319Encoding headerValueEncoding = HeaderEncodingSelector?.Invoke(headerPair.Key, content) ?? HttpRuleParser.DefaultHttpEncoding; 321WriteToStream(stream, headerPair.Key); 374currentLength += headerPair.Key.Length + ColonSpaceLength; 376Encoding headerValueEncoding = HeaderEncodingSelector?.Invoke(headerPair.Key, content) ?? HttpRuleParser.DefaultHttpEncoding;
System\Net\Http\SocketsHttpHandler\Http2Connection.cs (2)
1093int streamId = kvp.Key; 1832int streamId = kvp.Key;
System\Net\Http\SocketsHttpHandler\HttpConnectionPoolManager.cs (1)
486_pools.TryRemove(entry.Key, out _);
System.Net.NameResolution (7)
System\Net\Dns.cs (5)
367KeyValuePair<IPAddress, AddressFamily> t => t.Key, 581KeyValuePair<string, AddressFamily> t => GetHostAddressesCore(t.Key, t.Value, activity), 583KeyValuePair<IPAddress, AddressFamily> t => GetHostAddressesCore(t.Key, t.Value, activity), 592KeyValuePair<string, AddressFamily> t => GetHostEntryCore(t.Key, t.Value, activity), 594KeyValuePair<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)
279NetworkAddressChangedEventHandler handler = subscriber.Key; 321NetworkAvailabilityChangedEventHandler 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 (4)
System\Net\NegotiateAuthenticationPal.ManagedSpnego.cs (1)
177_optimisticMechanism = CreateMechanismForPackage(packageAndOid.Key);
System\Net\Security\SslSessionsCache.cs (3)
218s_cachedCreds.TryRemove(toRemoveAttempt[i].Key, out _); 226s_cachedCreds[toRemoveAttempt[i].Key] = cached; 230s_cachedCreds.TryRemove(toRemoveAttempt[i].Key, out _);
System.Net.WebSockets.Client (3)
System\Net\WebSockets\HttpResponseHeadersReadOnlyCollection.cs (2)
25yield return header.Key; 49yield return new KeyValuePair<string, IEnumerable<string>>(header.Key, header.Value);
System\Net\WebSockets\WebSocketHandle.Managed.cs (1)
393request.Headers.TryAddWithoutValidation(HttpKnownHeaderNames.SecWebSocketKey, secKeyAndSecWebSocketAccept.Key);
System.Private.CoreLib (67)
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\libraries\System.Private.CoreLib\src\System\Buffers\SharedArrayPool.cs (3)
214Array.Clear(tlsBuckets.Key); 221SharedArrayPoolThreadLocalArray[] buckets = tlsBuckets.Key; 246SharedArrayPoolThreadLocalArray[] buckets = tlsBuckets.Key;
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\DebugViewDictionaryItem.cs (1)
22Key = keyValue.Key;
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\Dictionary.cs (8)
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); 1228if (array[i].Key == null) 1233Add(array[i].Key, array[i].Value);
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\KeyValuePair.cs (2)
47return KeyValuePair.PairToString(Key, Value); 53key = Key;
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\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\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventSource.cs (2)
5474channelMask[item.Key] = item.Value.Keywords; 5662int channel = kvpair.Key;
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\EventPayload.cs (1)
66return ContainsKey(entry.Key);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\NameInfo.cs (1)
60return this.Compare(key.Key, key.Value & Statics.EventTagsMask);
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\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\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskScheduler.cs (1)
499schedulers.Add(item.Key);
System.Private.CoreLib.Generators (1)
EventSourceGenerator.Parser.cs (1)
52string argName = arg.Key;
System.Private.DataContractSerialization (6)
System\Runtime\Serialization\CollectionDataContract.cs (1)
1640return new KeyValue<K, V>(current.Key, current.Value);
System\Runtime\Serialization\DataContractSet.cs (2)
46InternalAdd(pair.Key, pair.Value); 53ProcessedContracts.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)
959xmlAttributes.Add(AddNamespaceDeclaration(prefixNsPair.Key, prefixNsPair.Value));
System.Private.Windows.Core (1)
System\Private\Windows\BinaryFormat\Deserializer\Deserializer.cs (1)
362SerializationRecordId incompleteId = pair.Key;
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)
2145defaultPrefix = pair.Key;
System\Xml\Serialization\CodeGenerator.cs (1)
1584(Type, string) key = (item.Value.LocalType, item.Key);
System\Xml\Serialization\Types.cs (2)
1134replaceList.Add(pair.Key, replacedInfo); 1142memberInfos[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)
436_pdbBuilder.AddMethodDebugInformation(GetDocument(enumerator.Current.Key), _pdbBuilder.GetOrAddBlob(spBlobBuilder)); 456spBlobBuilder.WriteCompressedInteger(MetadataTokens.GetRowNumber(GetDocument(pair.Key))); 465spBlobBuilder.WriteCompressedInteger(MetadataTokens.GetRowNumber(GetDocument(pair.Key))); 613if (pair.Key is MemberInfo member) 618if (pair.Key is KeyValuePair<MethodInfo, Type[]> pair2) 620pair.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)
558if (prev.EndsWith(entry.Key, StringComparison.Ordinal) && !BlobUtilities.IsLowSurrogateChar(entry.Key[0])) 561stringVirtualIndexToHeapOffsetMap[entry.Value.GetWriterVirtualIndex()] = position - (BlobUtilities.GetUTF8ByteCount(entry.Key) + 1); 566heapBuilder.WriteUTF8(entry.Key, allowUnpairedSurrogates: false); 570prev = entry.Key; 586string x = xPair.Key; 587string y = yPair.Key; 629var 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)
1452nestedTypesMap.Add(group.Key, group.Value.ToImmutable());
System.Resources.Extensions (4)
src\libraries\Common\src\System\Resources\ResourceWriter.cs (3)
327_resourceList.Add(entry.Key, entry.Value); 335nameHashes[curNameNumber] = FastResourceComparer.HashFunction(item.Key); 337names.Write(item.Key); // key
System\Resources\Extensions\BinaryFormat\Deserializer\Deserializer.cs (1)
367SerializationRecordId incompleteId = pair.Key;
System.Resources.Writer (3)
src\libraries\Common\src\System\Resources\ResourceWriter.cs (3)
327_resourceList.Add(entry.Key, entry.Value); 335nameHashes[curNameNumber] = FastResourceComparer.HashFunction(item.Key); 337names.Write(item.Key); // key
System.Runtime.Serialization.Schema (4)
System\Runtime\Serialization\Schema\CodeExporter.cs (4)
74string dataContractNamespace = pair.Key; 977if (classDataContract.XmlName != pair.Key && !classDataContract.KnownDataContracts.ContainsKey(pair.Key) && !pair.Value.IsBuiltInDataContract) 978classDataContract.KnownDataContracts.Add(pair.Key, pair.Value);
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)
548if (unprotectedHeaders.ContainsKey(kvp.Key))
System.ServiceModel.NetFramingBase (1)
System\ServiceModel\Channels\ConnectionPool.cs (1)
100endpointKeysToRemove.Add(poolEntry.Key);
System.ServiceModel.Primitives.Tests (1)
ServiceModel\MessageContractTest.4.4.0.cs (1)
163properties[property.Key] = property.Value.ToString();
System.Text.Json (22)
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; 152writer.WritePropertyName(entry.Key); 190otherDict.TryGetValue(item.Key, out JsonNode? jsonNode); 227string propertyName = FindValue(child)!.Value.Key; 324properties[i].PropertyName = item.Key;
System\Text\Json\Nodes\JsonObject.IDictionary.cs (2)
49public void Add(KeyValuePair<string, JsonNode?> property) => Add(property.Key, property.Value); 170bool ICollection<KeyValuePair<string, JsonNode?>>.Remove(KeyValuePair<string, JsonNode?> item) => Remove(item.Key);
System\Text\Json\Nodes\JsonObject.IList.cs (2)
98set => SetAt(index, value.Key, value.Value); 105void IList<KeyValuePair<string, JsonNode?>>.Insert(int index, KeyValuePair<string, JsonNode?> item) => Insert(index, item.Key, item.Value);
System\Text\Json\Schema\JsonSchema.cs (1)
195properties.Add(property.Key, property.Value.ToJsonNode(options));
System\Text\Json\Schema\JsonSchemaExporter.cs (3)
223(required ??= []).Add(typeDiscriminatorPair.Key); 318Required = parentPolymorphicTypeContainsTypesWithoutDiscriminator ? [typeDiscriminator.Value.Key] : null, 334dictRequired = [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)
55TKey key = enumerator.Current.Key; 74TKey key = enumerator.Current.Key;
System\Text\Json\Serialization\JsonSerializer.Read.HandleMetadata.cs (2)
433else if (property.Key == "$id") 445else if (property.Key == "$ref")
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.SourceGeneration (3)
JsonSourceGenerator.Emitter.cs (1)
1427writer.WriteLine($$"""private static readonly {{JsonEncodedTextTypeRef}} {{name_varName_pair.Value}} = {{JsonEncodedTextTypeRef}}.Encode({{FormatStringLiteral(name_varName_pair.Key)}});""");
JsonSourceGenerator.Parser.cs (2)
299switch (namedArg.Key) 466switch (namedArg.Key)
System.Text.RegularExpressions (15)
System\Text\RegularExpressions\RegexCharClass.cs (2)
1862return temp.ConvertAll(kvp => kvp.Key).ToArray(); 1983desc.Append(equalsGroup ? @"\p{" : @"\P{").Append(kvp.Key).Append('}');
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)
1316if (matcher.GetState(matcher.GetCoreStateId(nfaState.Key)).StartsWithLineAnchor) 1330if (matcher.GetState(matcher.GetCoreStateId(nfaState.Key)).IsNullableFor(nextCharKind)) 1359foreach (int nextState in GetNextStates(sourceStates.Values[0].Key, mintermId, matcher)) 1375foreach (int nextState in GetNextStates(sourceState.Key, mintermId, matcher)) 1382int coreStateId = matcher.GetCoreStateId(sourceState.Key); 1429flags |= 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)
184if (!requiredHelpers.ContainsKey(helper.Key)) 186requiredHelpers.Add(helper.Key, helper.Value); 266foreach (KeyValuePair<string, string[]> helper in requiredHelpers.OrderBy(h => h.Key, StringComparer.Ordinal))
RegexGenerator.Emitter.cs (1)
1557foreach (KeyValuePair<string, string[]> localFunctions in additionalLocalFunctions.OrderBy(k => k.Key))
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexCharClass.cs (2)
1862return temp.ConvertAll(kvp => kvp.Key).ToArray(); 1983desc.Append(equalsGroup ? @"\p{" : @"\P{").Append(kvp.Key).Append('}');
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 (1)
System\Threading\Channels\AsyncOperation.cs (1)
286t.Key(t.Value);
System.Threading.RateLimiting (1)
System\Threading\RateLimiting\DefaultPartitionedRateLimiter.cs (1)
246_limiters.Remove(rateLimiter.Key);
System.Threading.Tasks.Dataflow (58)
Blocks\ActionBlock.cs (3)
139action(messageWithId.Key); 167task = action(messageWithId.Key); 178Common.StoreDataflowMessageValueIntoExceptionData(caughtException, messageWithId.Key);
Blocks\BatchBlock.cs (18)
793if (sourceAndMessage.Key.ReserveMessage(sourceAndMessage.Value, _owningBatch)) 796var reservedSourceAndMessage = new KeyValuePair<ISourceBlock<T>, KeyValuePair<DataflowMessageHeader, T>>(sourceAndMessage.Key, reservedMessage); 811if (sourceAndMessage.Key.ReserveMessage(sourceAndMessage.Value, _owningBatch)) 814var reservedSourceAndMessage = new KeyValuePair<ISourceBlock<T>, KeyValuePair<DataflowMessageHeader, T>>(sourceAndMessage.Key, reservedMessage); 911var reservedSourceAndMessage = new KeyValuePair<ISourceBlock<T>, KeyValuePair<DataflowMessageHeader, T>>(sourceAndMessage.Key, reservedMessage); 927var reservedSourceAndMessage = new KeyValuePair<ISourceBlock<T>, KeyValuePair<DataflowMessageHeader, T>>(sourceAndMessage.Key, reservedMessage); 999T? consumedValue = sourceAndMessage.Key.ConsumeMessage(sourceAndMessage.Value.Key, _owningBatch, out consumed); 1009var consumedMessage = new KeyValuePair<DataflowMessageHeader, T>(sourceAndMessage.Value.Key, consumedValue!); 1010var consumedSourceAndMessage = new KeyValuePair<ISourceBlock<T>, KeyValuePair<DataflowMessageHeader, T>>(sourceAndMessage.Key, consumedMessage); 1051T? consumedValue = sourceAndMessage.Key.ConsumeMessage(sourceAndMessage.Value.Key, _owningBatch, out consumed); 1054var consumedMessage = new KeyValuePair<DataflowMessageHeader, T>(sourceAndMessage.Value.Key, consumedValue!); 1055var consumedSourceAndMessage = new KeyValuePair<ISourceBlock<T>, KeyValuePair<DataflowMessageHeader, T>>(sourceAndMessage.Key, consumedMessage); 1071if (sourceAndMessage.Key != null) _messages.Enqueue(sourceAndMessage.Value.Value); 1096ISourceBlock<T> source = sourceAndMessage.Key; 1098if (source != null && message.Key.IsValid) 1100try { source.ReleaseReservation(message.Key, _owningBatch); }
Blocks\BroadcastBlock.cs (1)
356T? consumedValue = sourceAndMessage.Key.ConsumeMessage(sourceAndMessage.Value, this, out consumed);
Blocks\BufferBlock.cs (1)
359T? consumedValue = sourceAndMessage.Key.ConsumeMessage(sourceAndMessage.Value, this, out consumed);
Blocks\JoinBlock.cs (12)
536Debug.Assert(_nonGreedy!.ConsumedMessage.Key, "A message must have been consumed by this point."); 566return _nonGreedy!.ConsumedMessage.Key; 632if (next.Key.ReserveMessage(next.Value, this)) 654Debug.Assert(_nonGreedy!.ReservedMessage.Key != null, "This target must have a reserved message"); 657T? consumedValue = _nonGreedy.ReservedMessage.Key.ConsumeMessage(_nonGreedy.ReservedMessage.Value, this, out consumed); 680Debug.Assert(!_nonGreedy.ConsumedMessage.Key, "There must be no other consumed message"); 718T? consumedValue = next.Key.ConsumeMessage(next.Value, this, out consumed); 743_nonGreedy!.ConsumedMessage.Key ? 1 : 0; 768if (_nonGreedy != null && _nonGreedy.ReservedMessage.Key != null) 771try { _nonGreedy.ReservedMessage.Key.ReleaseReservation(_nonGreedy.ReservedMessage.Value, this); } 791Debug.Assert(_nonGreedy == null || _nonGreedy.ReservedMessage.Key == null, 953private int InputCountForDebugger { get { return _messages != null ? _messages.Count : _nonGreedy!.ConsumedMessage.Key ? 1 : 0; } }
Blocks\TransformBlock.cs (4)
181outputItem = transform(messageWithId.Key); 235task = transform(messageWithId.Key); 246Common.StoreDataflowMessageValueIntoExceptionData(caughtException, messageWithId.Key); 291Common.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.IAsyncEnumerable.cs (2)
62IAsyncEnumerable<TOutput> outputItems = transformFunction(messageWithId.Key); 74Common.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)
2648long 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\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)
92return item.Key;
System\Windows\Forms\DataBinding\BindingContext.cs (1)
327cleanupList.Add(de.Key);
System\Windows\Forms\ErrorProvider\ErrorProvider.cs (1)
508SetError(entry.Key, entry.Value);
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); 489resxWriter.AddMetadata(de.Key, de.Value);
System\Resources\Tools\StronglyTypedResourceBuilder.cs (2)
870string key = entry.Key; 931errors.Add(entry.Key);
System.Windows.Forms.Tests (3)
misc\CollectionHelperTests.cs (2)
80Assert.Equal("key-one", firstTargetItem.Key); 85Assert.Equal("key-two", secondTargetItem.Key);
System\Resources\ResXResourceWriterTests.cs (1)
40Assert.Equal(key, pair.Key);
System.Xaml (37)
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\XmlCompatibilityReader.cs (1)
136keysToUpdate.Add(pair.Key);
System\Xaml\Context\ObjectWriterContext.cs (4)
1002if (allNamesAndValues.Exists(pair => pair.Key == nameValuePair.Key)) 1137if (allNamesAndValues.Exists(pair => pair.Key == nameValuePair.Key))
System\Xaml\Context\XamlCommonFrame.cs (2)
62Namespaces.Add(ns.Key, ns.Value); 83_namespaceDeclarations.Add(new NamespaceDeclaration(kvp.Value, kvp.Key));
System\Xaml\Context\XamlParserContext.cs (2)
105if (keys.Add(kvp.Key)) 107yield return new NamespaceDeclaration(kvp.Value, kvp.Key);
System\Xaml\InfosetObjects\XamlXmlReader.cs (1)
214xmlnsDictionary[ns.Key] = ns.Value;
System\Xaml\MS\Impl\XmlNsInfo.cs (1)
236string clrNsUri = ClrNamespaceUriParser.GetUri(clrToXmlNs.Key, assemblyName);
System\Xaml\NameScope.cs (6)
134if (item.Value != this[item.Key]) 139return Remove(item.Key); 144if (item.Key is null) 154Add(item.Key, item.Value); 159if (item.Key is null) 164return ContainsKey(item.Key);
System\Xaml\Runtime\ClrObjectRuntime.cs (1)
765yield return new DictionaryEntry(enumerator.Current.Key, enumerator.Current.Value);
System\Xaml\Schema\TypeReflector.cs (5)
674getter = candidates[0].Key; 1007string name = nameAndSetterList.Key; 1034string name = nameAndGetterList.Key; 1050string name = nameAndAdderList.Key; 1200listOfNulls.Add(pair.Key);
System\Xaml\Schema\XamlTypeInvoker.cs (1)
192if (contentType.CanAssignTo(pair.Key))
System\Xaml\XamlObjectReader.cs (6)
909throw new InvalidOperationException(SR.Format(SR.AttachedPropertyOnTypeConvertedOrStringProperty, property.Name, value.ToString(), props[0].Key.ToString())); 913throw new InvalidOperationException(SR.Format(SR.AttachedPropertyOnDictionaryKey, value.ToString(), props[0].Key.ToString())); 1876XamlType owningType = context.GetXamlType(ap.Key.DeclaringType); 1882XamlMember attachedProperty = owningType.GetAttachableMember(ap.Key.MemberName); 1886throw new XamlObjectReaderException(SR.Format(SR.ObjectReaderAttachedPropertyNotFound, owningType, ap.Key.MemberName)); 2555new NamespaceDeclaration(pair.Key, pair.Value)));
System\Xaml\XamlSchemaContext.cs (4)
119result.Add(ns.Key); 238if (!prefixDict.TryGetValue(nsToPrefix.Key, out existingPrefix)) 240existingPrefix = TryAdd(prefixDict, nsToPrefix.Key, preferredPrefix); 248existingPrefix = TryUpdate(prefixDict, nsToPrefix.Key, preferredPrefix, existingPrefix);
System\Xaml\XamlXmlWriter.cs (3)
539output.WriteAttributeString("xmlns", pair.Key, null, pair.Value); 778return string.Compare(x.Key, y.Key, false, TypeConverterHelper.InvariantEnglishUS);
Templates.Blazor.Tests (1)
src\Shared\Process\ProcessEx.cs (1)
118startInfo.EnvironmentVariables[envVar.Key] = envVar.Value;
Templates.Blazor.WebAssembly.Auth.Tests (1)
src\Shared\Process\ProcessEx.cs (1)
118startInfo.EnvironmentVariables[envVar.Key] = envVar.Value;
Templates.Blazor.WebAssembly.Tests (1)
src\Shared\Process\ProcessEx.cs (1)
118startInfo.EnvironmentVariables[envVar.Key] = envVar.Value;
Templates.Mvc.Tests (1)
src\Shared\Process\ProcessEx.cs (1)
118startInfo.EnvironmentVariables[envVar.Key] = envVar.Value;
Templates.Tests (1)
src\Shared\Process\ProcessEx.cs (1)
118startInfo.EnvironmentVariables[envVar.Key] = envVar.Value;
UnitTests.Common (1)
TestTypes.cs (1)
308workItem.Key(workItem.Value);
VBCSCompiler.UnitTests (5)
CompilerServerTests.cs (5)
114TempFile file = currentDirectory.CreateFile(pair.Key); 134resetVariables.Add(variable.Key, Environment.GetEnvironmentVariable(variable.Key)); 135Environment.SetEnvironmentVariable(variable.Key, variable.Value); 144Environment.SetEnvironmentVariable(variable.Key, variable.Value);
VersioningWebSite (4)
src\Mvc\test\WebSites\Common\TestResponseGenerator.cs (4)
31.Where(kvp => kvp.Key != "link" && kvp.Key != "link_action" && kvp.Key != "link_controller") 32.ToDictionary(kvp => kvp.Key.Substring("link_".Length), kvp => (object)kvp.Value[0]);
WindowsBase.Tests (2)
System\Windows\NameScopeTests.cs (2)
739Assert.Equal("name", enumerator.Current.Key); 795Assert.Equal("name", ((KeyValuePair<string, object>)enumerator.Current).Key);
WindowsFormsIntegration (2)
System\Windows\Integration\PropertyMap.cs (2)
172Apply(entry.Key); 280Add(entry.Key, entry.Value);
XmlFileLogger (6)
ItemGroupParser.cs (3)
32name = nameValue.Key; 41name = nameValue.Key; 71currentItem.AddMetadata(nameValue.Key, nameValue.Value);
LogProcessNode.cs (1)
131propElement.Add(new XElement("Property", new XAttribute("Name", p.Key)) { Value = p.Value });
ObjectModel\Item.cs (1)
79var metadataElement = new XElement(metadataItem.Key);
PropertyBag.cs (1)
70AddProperty(property.Key, property.Value);
XmlFormattersWebSite (2)
Controllers\HomeController.cs (1)
33var key = keyModelStatePair.Key;
Controllers\ValidationController.cs (1)
31var key = keyModelStatePair.Key;
xunit.assert (2)
Sdk\AssertHelper.cs (2)
712 if (!actualGetters.TryGetValue(kvp.Key, out actualGetter)) 718 var ex = VerifyEquivalence(expectedMemberValue, actualMemberValue, strict, prefixDot + kvp.Key, expectedRefs, actualRefs, depth + 1);
xunit.console (6)
CommandLine.cs (4)
242var optionName = option.Key.ToLowerInvariant(); 245throw new ArgumentException($"unknown command line option: {option.Key}"); 249ParseRspFile(option.Key.Substring(1)); 476throw new ArgumentException($"missing filename for {option.Key}");
ConsoleRunner.cs (1)
309reporterMessageHandler.OnMessage(new TestExecutionSummary(clockTime.Elapsed, completionMessages.OrderBy(kvp => kvp.Key).ToList()));
Utility\TransformFactory.cs (1)
61.Select(output => new Action<XElement>(xml => instance.availableTransforms[output.Key].OutputHandler(xml, output.Value)))
Xunit.NetCore.Extensions (1)
AssemblyFixtureSupport\XunitTestCollectionRunnerWithAssemblyFixture.cs (1)
44combinedFixtures[kvp.Key] = kvp.Value;