566 references to Create
aspire (1)
Commands\PipelineCommandBase.cs (1)
1182options.Add(KeyValuePair.Create(CustomChoiceValue, InteractionServiceStrings.CustomChoiceLabel));
Aspire.Dashboard.Components.Tests (9)
Controls\GenAIVisualizerDialogTests.cs (3)
100KeyValuePair.Create(GenAIHelpers.GenAISystemInstructions, systemInstruction), 101KeyValuePair.Create(GenAIHelpers.GenAIInputMessages, inputMessages), 102KeyValuePair.Create(GenAIHelpers.GenAIOutputInstructions, outputMessages)
Controls\StructuredLogDetailsTests.cs (6)
38KeyValuePair.Create("Message", "value1"), 39KeyValuePair.Create("Message", "value2"), 40KeyValuePair.Create("event.name", "value1"), 41KeyValuePair.Create("event.name", "value2") 48KeyValuePair.Create("Message", "value1"), 49KeyValuePair.Create("Message", "value2")
Aspire.Dashboard.Tests (250)
BrowserLinkOutgoingPeerResolverTests.cs (9)
28Assert.False(TryResolvePeerName(resolver, [KeyValuePair.Create("http.url", "")], out _)); 38Assert.False(TryResolvePeerName(resolver, [KeyValuePair.Create<string, string>("http.url", null!)], out _)); 50Assert.False(TryResolvePeerName(resolver, [KeyValuePair.Create("http.url", "/6eed7c2dedc14419901b813e8fe87a86/getScriptTag")], out _)); 60Assert.False(TryResolvePeerName(resolver, [KeyValuePair.Create("http.url", "http://dummy:59267/6eed7c2dedc14419901b813e8fe87a86/getScriptTag")], out _)); 70Assert.False(TryResolvePeerName(resolver, [KeyValuePair.Create("http.url", "http://localhost:59267/getScriptTag")], out _)); 80Assert.False(TryResolvePeerName(resolver, [KeyValuePair.Create("http.url", "ht$tp://localhost:59267/6eed7c2dedc14419901b813e8fe87a86/getScriptTag")], out _)); 90Assert.False(TryResolvePeerName(resolver, [KeyValuePair.Create("http.url", "http://localhost:59267/")], out _)); 100Assert.False(TryResolvePeerName(resolver, [KeyValuePair.Create("http.url", "http://localhost:59267/not-a-guid/getScriptTag")], out _)); 110Assert.True(TryResolvePeerName(resolver, [KeyValuePair.Create("http.url", "http://localhost:59267/6eed7c2dedc14419901b813e8fe87a86/getScriptTag")], out var name));
Model\GenAIVisualizerDialogViewModelTests.cs (122)
75KeyValuePair.Create("error.type", "Exception") 139CreateSpan(traceId: "1", spanId: "1-1", startTime: s_testTime.AddMinutes(1), endTime: s_testTime.AddMinutes(10), attributes: [KeyValuePair.Create(GenAIHelpers.GenAISystem, "System!"), KeyValuePair.Create("server.address", "ai-server.address")]) 163attributes: [KeyValuePair.Create("event.name", "gen_ai.system.message")]), 169attributes: [KeyValuePair.Create("event.name", "gen_ai.user.message")]), 175attributes: [KeyValuePair.Create("event.name", "gen_ai.assistant.message")]) 236CreateSpan(traceId: "1", spanId: "1-1", startTime: s_testTime.AddMinutes(1), endTime: s_testTime.AddMinutes(10), attributes: [KeyValuePair.Create(GenAIHelpers.GenAISystem, "System!"), KeyValuePair.Create("server.address", "ai-server.address")]) 260attributes: [KeyValuePair.Create("event.name", "gen_ai.system.message")]), 266attributes: [KeyValuePair.Create("event.name", "gen_ai.user.message")]) 297KeyValuePair.Create(GenAIHelpers.GenAIEventContent, JsonSerializer.Serialize(new SystemOrUserEvent { Content = "System!" }, GenAIEventsContext.Default.SystemOrUserEvent)), 298KeyValuePair.Create(GenAIHelpers.GenAISystem, "System!"), 304KeyValuePair.Create(GenAIHelpers.GenAIEventContent, JsonSerializer.Serialize(new SystemOrUserEvent { Content = "User!" }, GenAIEventsContext.Default.SystemOrUserEvent)), 305KeyValuePair.Create(GenAIHelpers.GenAISystem, "System!"), 311KeyValuePair.Create(GenAIHelpers.GenAIEventContent, JsonSerializer.Serialize(new AssistantEvent { Content = "Assistant!" }, GenAIEventsContext.Default.AssistantEvent)), 317KeyValuePair.Create(GenAIHelpers.GenAIEventContent, JsonSerializer.Serialize(new AssistantEvent { Content = "Assistant!" }, GenAIEventsContext.Default.AssistantEvent)), 318KeyValuePair.Create(GenAIHelpers.GenAISystem, "System!"), 335CreateSpan(traceId: "1", spanId: "1-1", startTime: s_testTime.AddMinutes(1), endTime: s_testTime.AddMinutes(10), attributes: [KeyValuePair.Create(GenAIHelpers.GenAISystem, "System!"), KeyValuePair.Create("server.address", "ai-server.address")], events: events) 389KeyValuePair.Create(GenAIHelpers.GenAIEventContent, ""), 390KeyValuePair.Create(GenAIHelpers.GenAISystem, "System!"), 396KeyValuePair.Create(GenAIHelpers.GenAIEventContent, string.Empty), 413CreateSpan(traceId: "1", spanId: "1-1", startTime: s_testTime.AddMinutes(1), endTime: s_testTime.AddMinutes(10), attributes: [KeyValuePair.Create(GenAIHelpers.GenAISystem, "System!")], events: events) 444KeyValuePair.Create(GenAIHelpers.GenAISystem, "System!"), 462CreateSpan(traceId: "1", spanId: "1-1", startTime: s_testTime.AddMinutes(1), endTime: s_testTime.AddMinutes(10), attributes: [KeyValuePair.Create(GenAIHelpers.GenAISystem, "System!")], events: events) 522KeyValuePair.Create(GenAIHelpers.GenAISystem, "System!"), 523KeyValuePair.Create("server.address", "ai-server.address"), 524KeyValuePair.Create(GenAIHelpers.GenAISystemInstructions, systemInstruction), 525KeyValuePair.Create(GenAIHelpers.GenAIInputMessages, inputMessages), 526KeyValuePair.Create(GenAIHelpers.GenAIOutputInstructions, outputMessages) 638KeyValuePair.Create(GenAIHelpers.GenAISystem, "System!"), 639KeyValuePair.Create("server.address", "ai-server.address"), 640KeyValuePair.Create(GenAIHelpers.GenAISystemInstructions, systemInstruction), 641KeyValuePair.Create(GenAIHelpers.GenAIInputMessages, inputMessages), 642KeyValuePair.Create(GenAIHelpers.GenAIOutputInstructions, outputMessages) 718KeyValuePair.Create(GenAIHelpers.GenAISystem, "System!"), 719KeyValuePair.Create("server.address", "ai-server.address"), 720KeyValuePair.Create(GenAIHelpers.GenAISystemInstructions, systemInstruction), 721KeyValuePair.Create(GenAIHelpers.GenAIInputMessages, inputMessages), 722KeyValuePair.Create(GenAIHelpers.GenAIOutputInstructions, outputMessages) 805KeyValuePair.Create(GenAIHelpers.GenAISystem, "System!"), 806KeyValuePair.Create("server.address", "ai-server.address"), 850KeyValuePair.Create(GenAIHelpers.GenAISystem, "System!"), 851KeyValuePair.Create("server.address", "ai-server.address"), 853KeyValuePair.Create("gen_ai.prompt.0.role", "system"), 854KeyValuePair.Create("gen_ai.prompt.0.content", "You are a helpful assistant."), 855KeyValuePair.Create("gen_ai.prompt.1.role", "user"), 856KeyValuePair.Create("gen_ai.prompt.1.content", "Hello, how are you?"), 858KeyValuePair.Create("gen_ai.completion.0.role", "assistant"), 859KeyValuePair.Create("gen_ai.completion.0.content", "I'm doing well, thank you!") 926KeyValuePair.Create(GenAIHelpers.GenAISystem, "System!"), 927KeyValuePair.Create("server.address", "ai-server.address"), 929KeyValuePair.Create("gen_ai.prompt.0.message.role", "system"), 930KeyValuePair.Create("gen_ai.prompt.0.message.content", "You are a coding assistant."), 931KeyValuePair.Create("gen_ai.prompt.1.message.role", "user"), 932KeyValuePair.Create("gen_ai.prompt.1.message.content", "Write a hello world program."), 934KeyValuePair.Create("gen_ai.completion.0.message.role", "assistant"), 935KeyValuePair.Create("gen_ai.completion.0.message.content", "Here's a simple hello world program...") 1002KeyValuePair.Create(GenAIHelpers.GenAISystem, "System!"), 1003KeyValuePair.Create("server.address", "ai-server.address"), 1005KeyValuePair.Create("gen_ai.prompt.0.role", "system"), 1006KeyValuePair.Create("gen_ai.prompt.0.content", "You are a helpful assistant."), 1008KeyValuePair.Create("gen_ai.prompt.2.role", "user"), 1009KeyValuePair.Create("gen_ai.prompt.2.content", "What is 2+2?"), 1011KeyValuePair.Create("gen_ai.prompt.5.role", "user"), 1012KeyValuePair.Create("gen_ai.prompt.5.content", "Follow up question."), 1014KeyValuePair.Create("gen_ai.completion.0.role", "assistant"), 1015KeyValuePair.Create("gen_ai.completion.0.content", "The answer is 4."), 1017KeyValuePair.Create("gen_ai.completion.3.role", "assistant"), 1018KeyValuePair.Create("gen_ai.completion.3.content", "Follow up answer.") 1125KeyValuePair.Create(GenAIHelpers.GenAISystem, "System!"), 1126KeyValuePair.Create(GenAIHelpers.GenAIToolDefinitions, toolDefinitionsJson) 1196KeyValuePair.Create(GenAIHelpers.GenAISystem, "System!"), 1197KeyValuePair.Create(GenAIHelpers.GenAIToolDefinitions, "invalid json") 1239KeyValuePair.Create(GenAIHelpers.GenAISystem, "System!") 1322KeyValuePair.Create(GenAIHelpers.GenAISystem, "System!"), 1323KeyValuePair.Create("server.address", "ai-server.address"), 1324KeyValuePair.Create(GenAIHelpers.GenAISystemInstructions, systemInstruction), 1325KeyValuePair.Create(GenAIHelpers.GenAIInputMessages, inputMessages), 1326KeyValuePair.Create(GenAIHelpers.GenAIOutputInstructions, outputMessages) 1414KeyValuePair.Create(GenAIHelpers.GenAISystem, "System!"), 1415KeyValuePair.Create(GenAIHelpers.GenAIToolDefinitions, toolDefinitions) 1487KeyValuePair.Create(GenAIHelpers.GenAISystem, "System!"), 1488KeyValuePair.Create(GenAIHelpers.GenAIToolDefinitions, toolDefinitionsJson) 1595KeyValuePair.Create(GenAIHelpers.GenAISystem, "System!"), 1596KeyValuePair.Create(GenAIHelpers.GenAIToolDefinitions, toolDefinitionsJson) 1752KeyValuePair.Create("event.name", "gen_ai.evaluation.result"), 1753KeyValuePair.Create("gen_ai.evaluation.name", "Relevance"), 1754KeyValuePair.Create("gen_ai.evaluation.score.label", "relevant"), 1755KeyValuePair.Create("gen_ai.evaluation.score.value", "0.85"), 1756KeyValuePair.Create("gen_ai.evaluation.explanation", "The response is factually accurate and addresses the question."), 1757KeyValuePair.Create("gen_ai.response.id", "chatcmpl-123") 1765KeyValuePair.Create("event.name", "gen_ai.evaluation.result"), 1766KeyValuePair.Create("gen_ai.evaluation.name", "IntentResolution"), 1767KeyValuePair.Create("gen_ai.evaluation.score.label", "incorrect"), 1768KeyValuePair.Create("gen_ai.evaluation.score.value", "0.65"), 1769KeyValuePair.Create("error.type", "timeout") 1819KeyValuePair.Create("gen_ai.evaluation.name", "Relevance"), 1820KeyValuePair.Create("gen_ai.evaluation.score.label", "pass"), 1821KeyValuePair.Create("gen_ai.evaluation.score.value", "0.95"), 1822KeyValuePair.Create("gen_ai.evaluation.explanation", "Very accurate response"), 1823KeyValuePair.Create("gen_ai.response.id", "chatcmpl-456") 1830KeyValuePair.Create("gen_ai.evaluation.name", "IntentResolution"), 1831KeyValuePair.Create("gen_ai.evaluation.score.value", "0.88") 1933KeyValuePair.Create("event.name", "gen_ai.evaluation.result"), 1934KeyValuePair.Create("gen_ai.evaluation.name", "BasicMetric") 1972KeyValuePair.Create("gen_ai.evaluation.name", "SpanEventMetric"), 1973KeyValuePair.Create("gen_ai.evaluation.score.value", "0.75") 2020KeyValuePair.Create("event.name", "gen_ai.evaluation.result"), 2021KeyValuePair.Create("gen_ai.evaluation.name", "LogEntryMetric"), 2022KeyValuePair.Create("gen_ai.evaluation.score.value", "0.65") 2078KeyValuePair.Create(GenAIHelpers.GenAISystem, "System!"), 2079KeyValuePair.Create(GenAIHelpers.GenAIToolDefinitions, toolDefinitionsJson) 2163KeyValuePair.Create(GenAIHelpers.GenAISystem, "System!"), 2164KeyValuePair.Create("server.address", "ai-server.address"), 2165KeyValuePair.Create(GenAIHelpers.GenAIInputMessages, truncatedInput) 2235KeyValuePair.Create(GenAIHelpers.GenAISystem, "System!"), 2236KeyValuePair.Create("server.address", "ai-server.address"), 2237KeyValuePair.Create(GenAIHelpers.GenAISystemInstructions, truncatedInstruction) 2304KeyValuePair.Create(GenAIHelpers.GenAISystem, "System!"), 2305KeyValuePair.Create("server.address", "ai-server.address"), 2306KeyValuePair.Create(GenAIHelpers.GenAIOutputInstructions, truncatedOutput)
Model\ResourceMenuBuilderTests.cs (2)
97TelemetryTestHelpers.CreateSpan(traceId: "1", spanId: "1-1", startTime: s_testTime.AddMinutes(1), endTime: s_testTime.AddMinutes(10), attributes: [KeyValuePair.Create(OtlpSpan.PeerServiceAttributeKey, "value-1")], kind: Span.Types.SpanKind.Client), 98TelemetryTestHelpers.CreateSpan(traceId: "1", spanId: "1-2", startTime: s_testTime.AddMinutes(5), endTime: s_testTime.AddMinutes(10), parentSpanId: "1-1", attributes: [KeyValuePair.Create(OtlpSpan.PeerServiceAttributeKey, "value-2")], kind: Span.Types.SpanKind.Client)
Model\SpanWaterfallViewModelTests.cs (2)
88trace.AddSpan(TelemetryTestHelpers.CreateOtlpSpan(app1, trace, scope, spanId: "1", parentSpanId: null, startDate: new DateTime(2001, 1, 1, 1, 1, 2, DateTimeKind.Utc), kind: OtlpSpanKind.Client, attributes: [KeyValuePair.Create("http.url", "http://localhost:59267/6eed7c2dedc14419901b813e8fe87a86/getScriptTag"), KeyValuePair.Create("server.address", "localhost")]));
ResourceOutgoingPeerResolverTests.cs (46)
51Assert.False(TryResolvePeerName(resources, [KeyValuePair.Create("peer.service", "")], out _)); 64Assert.False(TryResolvePeerName(resources, [KeyValuePair.Create<string, string>("peer.service", null!)], out _)); 77Assert.True(TryResolvePeerName(resources, [KeyValuePair.Create("peer.service", "localhost:5000")], out var value)); 96Assert.True(TryResolvePeerName(resources, [KeyValuePair.Create("peer.service", $"{host}:5000")], out var value)); 110Assert.True(TryResolvePeerName(resources, [KeyValuePair.Create("peer.service", "127.0.0.1,5000")], out var value)); 124Assert.True(TryResolvePeerName(resources, [KeyValuePair.Create("server.address", "localhost"), KeyValuePair.Create("server.port", "5000")], out var value)); 141KeyValuePair.Create("server.address", "localhost"), 142KeyValuePair.Create("server.port", "50267"), 143KeyValuePair.Create(databaseAttribute, databaseName) 159Assert.True(TryResolvePeerName(resources, [KeyValuePair.Create("server.address", "localhost"), KeyValuePair.Create("server.port", "50267"), KeyValuePair.Create("db.namespace", "catalog")], out var value)); 173KeyValuePair.Create("server.address", "127.0.0.1"), 174KeyValuePair.Create("server.port", "50267"), 175KeyValuePair.Create("db.namespace", "catalogdb") 195KeyValuePair.Create("server.address", "localhost"), 196KeyValuePair.Create("server.port", "50267") 200attributes.Add(KeyValuePair.Create("db.namespace", databaseName)); 220KeyValuePair.Create("server.address", "localhost"), 221KeyValuePair.Create("server.port", "50267") 225attributes.Add(KeyValuePair.Create("db.namespace", databaseName)); 241Assert.True(TryResolvePeerName(resources, [KeyValuePair.Create("server.address", "localhost"), KeyValuePair.Create("server.port", "27017"), KeyValuePair.Create("db.namespace", "catalogdb")], out var value)); 256Assert.True(TryResolvePeerName(resources, [KeyValuePair.Create("server.address", "localhost"), KeyValuePair.Create("db.namespace", "catalogdb")], out var value)); 269Assert.True(TryResolvePeerName(resources, [KeyValuePair.Create("server.address", "localhost"), KeyValuePair.Create("server.port", "27017"), KeyValuePair.Create("db.namespace", "unknown")], out var value)); 348Assert.True(TryResolvePeerName(resources, [KeyValuePair.Create("server.address", "localhost"), KeyValuePair.Create("server.port", "5000")], out var value)); 363Assert.True(TryResolvePeerName(resources, [KeyValuePair.Create("server.address", "localhost"), KeyValuePair.Create("server.port", "5000")], out var value1)); 366Assert.True(TryResolvePeerName(resources, [KeyValuePair.Create("server.address", "localhost"), KeyValuePair.Create("server.port", "5001")], out var value2)); 386Assert.True(TryResolvePeerName(resources, [KeyValuePair.Create("peer.service", "models.github.ai:443")], out var value)); 401Assert.True(TryResolvePeerName(resources, [KeyValuePair.Create("peer.service", "models.github.ai:443")], out var value)); 415Assert.True(TryResolvePeerName(resources, [KeyValuePair.Create("peer.service", "api.example.com:8080")], out var value)); 430Assert.False(TryResolvePeerName(resources, [KeyValuePair.Create("peer.service", "localhost:1433")], out _)); 443Assert.False(TryResolvePeerName(resources, [KeyValuePair.Create("peer.service", "localhost:5000")], out _)); 457Assert.True(TryResolvePeerName(resources, [KeyValuePair.Create("peer.service", "mystorageaccount.blob.core.windows.net:443")], out var value)); 472Assert.True(TryResolvePeerName(resources, [KeyValuePair.Create("peer.service", "myvault.vault.azure.net:8080")], out var value)); 543Assert.True(TryResolvePeerName(resources, [KeyValuePair.Create("peer.service", "127.0.0.1:1433")], out var name)); 558Assert.True(TryResolvePeerName(resources, [KeyValuePair.Create("peer.service", "localhost:5432")], out var name)); 575Assert.True(TryResolvePeerName(resources, [KeyValuePair.Create("peer.service", "127.0.0.1:8080")], out var name));
TelemetryRepositoryTests\LogTests.cs (2)
989LogRecords = { CreateLogRecord(time: s_testTime.AddMinutes(1), message: "message-1", attributes: [KeyValuePair.Create("key-1", "value-1")]) } 1001LogRecords = { CreateLogRecord(time: s_testTime.AddMinutes(2), message: "message-2", attributes: [KeyValuePair.Create("key-2", "value-2")]) }
TelemetryRepositoryTests\MetricsTests.cs (25)
342CreateSumMetric(metricName: "test", startTime: s_testTime.AddMinutes(1), exemplars: new List<Exemplar> { CreateExemplar(startTime: s_testTime.AddMinutes(1), value: 2, attributes: [KeyValuePair.Create("key1", "value1")]) }), 344CreateSumMetric(metricName: "test", startTime: s_testTime.AddMinutes(1), attributes: [KeyValuePair.Create("key1", "value1")]), 345CreateSumMetric(metricName: "test", startTime: s_testTime.AddMinutes(1), attributes: [KeyValuePair.Create("key1", "value2")]), 346CreateSumMetric(metricName: "test", startTime: s_testTime.AddMinutes(1), attributes: [KeyValuePair.Create("key1", "value1"), KeyValuePair.Create("key2", "value1")]), 347CreateSumMetric(metricName: "test", startTime: s_testTime.AddMinutes(1), attributes: [KeyValuePair.Create("key1", "value1"), KeyValuePair.Create("key2", "")]) 404AssertDimensionValues(instrument.Dimensions, new KeyValuePair<string, string>[] { KeyValuePair.Create("key1", "value1") }, valueCount: 1); 405AssertDimensionValues(instrument.Dimensions, new KeyValuePair<string, string>[] { KeyValuePair.Create("key1", "value2") }, valueCount: 1); 406AssertDimensionValues(instrument.Dimensions, new KeyValuePair<string, string>[] { KeyValuePair.Create("key1", "value1"), KeyValuePair.Create("key2", "value1") }, valueCount: 1); 529CreateSumMetric(metricName: "test1", value: 1, startTime: s_testTime.AddMinutes(1), attributes: [KeyValuePair.Create("key-1", "value-1")]), 530CreateSumMetric(metricName: "test1", value: 2, startTime: s_testTime.AddMinutes(1), attributes: [KeyValuePair.Create("key-1", "value-2")]) 545CreateSumMetric(metricName: "test1", value: 3, startTime: s_testTime.AddMinutes(1), attributes: [KeyValuePair.Create("key-1", "value-3")]), 546CreateSumMetric(metricName: "test2", value: 4, startTime: s_testTime.AddMinutes(1), attributes: [KeyValuePair.Create("key-1", "value-4")]) 561CreateSumMetric(metricName: "test1", value: 5, startTime: s_testTime.AddMinutes(1), attributes: [KeyValuePair.Create("key-1", "value-5")]), 562CreateSumMetric(metricName: "test3", value: 6, startTime: s_testTime.AddMinutes(1), attributes: [KeyValuePair.Create("key-1", "value-6")]) 605Assert.Equal(KeyValuePair.Create("key-1", "value-1"), d.Attributes.Single()); 610Assert.Equal(KeyValuePair.Create("key-1", "value-2"), d.Attributes.Single()); 615Assert.Equal(KeyValuePair.Create("key-1", "value-3"), d.Attributes.Single()); 880CreateSumMetric(metricName: "test1", value: 1, startTime: s_testTime.AddMinutes(1), attributes: [KeyValuePair.Create("key-1", "value-1")]), 881CreateSumMetric(metricName: "test1", value: 2, startTime: s_testTime.AddMinutes(1), attributes: [KeyValuePair.Create("key-1", "value-2")]), 1022CreateSumMetric(metricName: "", value: 1, startTime: s_testTime.AddMinutes(1), attributes: [KeyValuePair.Create("key-1", "value-1")]), 1023CreateSumMetric(metricName: "test1", value: 2, startTime: s_testTime.AddMinutes(1), attributes: [KeyValuePair.Create("key-1", "value-2")]), 1222CreateSumMetric(metricName: "test", startTime: s_testTime.AddMinutes(1), attributes: [KeyValuePair.Create("otel.metric.overflow", "true")])
TelemetryRepositoryTests\OtlpSpanTests.cs (6)
140KeyValuePair.Create("http.request.method", "GET"), 141KeyValuePair.Create("http.response.status_code", "200") 151KeyValuePair.Create("http.method", "GET"), 152KeyValuePair.Create("http.status_code", "200") 162KeyValuePair.Create("http.method", "GET"), 163KeyValuePair.Create("http.status_code", "200")
TelemetryRepositoryTests\TraceTests.cs (36)
1064Spans = { CreateSpan(traceId: "1", spanId: "1-1", startTime: s_testTime.AddMinutes(1), endTime: s_testTime.AddMinutes(10), attributes: [KeyValuePair.Create("key-1", "value-1")]) } 1076Spans = { CreateSpan(traceId: "2", spanId: "2-1", startTime: s_testTime.AddMinutes(2), endTime: s_testTime.AddMinutes(10), attributes: [KeyValuePair.Create("key-2", "value-2")]) } 1138Spans = { CreateSpan(traceId: "1", spanId: "1-1", startTime: s_testTime.AddMinutes(1), endTime: s_testTime.AddMinutes(10), attributes: [KeyValuePair.Create("key1", "value1")]) } 1150Spans = { CreateSpan(traceId: "1", spanId: "1-2", startTime: s_testTime.AddMinutes(2), endTime: s_testTime.AddMinutes(10), parentSpanId: "1-1", attributes: [KeyValuePair.Create("key2", "value2")]) } 1238Spans = { CreateSpan(traceId: "1", spanId: "1-1", startTime: s_testTime.AddMinutes(1), endTime: s_testTime.AddMinutes(10), attributes: [KeyValuePair.Create("key1", "value1"), KeyValuePair.Create(OtlpSpan.PeerServiceAttributeKey, "value-1")], kind: Span.Types.SpanKind.Client) } 1301CreateSpan(traceId: "1", spanId: "1-1", startTime: s_testTime.AddMilliseconds(1), endTime: s_testTime.AddMilliseconds(11), attributes: [KeyValuePair.Create("dynamic.filter", "match")]), 1302CreateSpan(traceId: "2", spanId: "2-1", startTime: s_testTime.AddMilliseconds(2), endTime: s_testTime.AddMilliseconds(22), attributes: [KeyValuePair.Create("dynamic.filter", "match")]), 1303CreateSpan(traceId: "3", spanId: "3-1", startTime: s_testTime.AddMilliseconds(3), endTime: s_testTime.AddMilliseconds(33), attributes: [KeyValuePair.Create("dynamic.filter", "other")]), 1304CreateSpan(traceId: "4", spanId: "4-1", startTime: s_testTime.AddMilliseconds(4), endTime: s_testTime.AddMilliseconds(44), attributes: [KeyValuePair.Create("dynamic.filter", "match")]), 1305CreateSpan(traceId: "5", spanId: "5-1", startTime: s_testTime.AddMilliseconds(5), endTime: s_testTime.AddMilliseconds(55), attributes: [KeyValuePair.Create("dynamic.filter", "match")]) 1417Spans = { CreateSpan(traceId: "1", spanId: "1-1", startTime: s_testTime.AddMinutes(1), endTime: s_testTime.AddMinutes(10), attributes: [KeyValuePair.Create("key1", "value1")]) } 1571Resource = CreateResource(attributes: [KeyValuePair.Create("prop1", "value1")]), 1586Resource = CreateResource(attributes: [KeyValuePair.Create("prop2", "value1"), KeyValuePair.Create("prop1", "value2")]), 1601Resource = CreateResource(attributes: [KeyValuePair.Create("prop1", "value2"), KeyValuePair.Create("prop2", "value1")]), 2086CreateSpan(traceId: "1", spanId: "1-1", startTime: s_testTime.AddMinutes(1), endTime: s_testTime.AddMinutes(10), attributes: [KeyValuePair.Create(OtlpSpan.PeerServiceAttributeKey, "value-1")], kind: Span.Types.SpanKind.Client), 2087CreateSpan(traceId: "1", spanId: "1-2", startTime: s_testTime.AddMinutes(5), endTime: s_testTime.AddMinutes(10), parentSpanId: "1-1", attributes: [KeyValuePair.Create(OtlpSpan.PeerServiceAttributeKey, "value-2")], kind: Span.Types.SpanKind.Client) 2172CreateSpan(traceId: "1", spanId: "1-1", startTime: s_testTime.AddMinutes(1), endTime: s_testTime.AddMinutes(10), attributes: [KeyValuePair.Create(OtlpSpan.PeerServiceAttributeKey, "value-1")], kind: Span.Types.SpanKind.Client), 2173CreateSpan(traceId: "1", spanId: "1-2", startTime: s_testTime.AddMinutes(5), endTime: s_testTime.AddMinutes(10), parentSpanId: "1-1", attributes: [KeyValuePair.Create(OtlpSpan.PeerServiceAttributeKey, "value-2")], kind: Span.Types.SpanKind.Client) 2276CreateSpan(traceId: "1", spanId: "1-1", startTime: s_testTime.AddMinutes(1), endTime: s_testTime.AddMinutes(10), attributes: [KeyValuePair.Create(OtlpSpan.PeerServiceAttributeKey, "value-1")], kind: Span.Types.SpanKind.Client), 2277CreateSpan(traceId: "1", spanId: "1-2", startTime: s_testTime.AddMinutes(5), endTime: s_testTime.AddMinutes(10), parentSpanId: "1-1", attributes: [KeyValuePair.Create(OtlpSpan.PeerServiceAttributeKey, "value-2")], kind: Span.Types.SpanKind.Client) 2590CreateSpan(traceId: "1", spanId: "1-1", startTime: s_testTime.AddMinutes(1), endTime: s_testTime.AddMinutes(10), attributes: [KeyValuePair.Create("http.url", "https://example.com/api")]), 2591CreateSpan(traceId: "1", spanId: "1-2", startTime: s_testTime.AddMinutes(5), endTime: s_testTime.AddMinutes(10), parentSpanId: "1-1", attributes: [KeyValuePair.Create("db.system", "postgresql")]) 2673CreateSpan(traceId: "1", spanId: "1-1", startTime: s_testTime.AddMinutes(1), endTime: s_testTime.AddMinutes(10), status: new Status { Code = Status.Types.StatusCode.Error }, attributes: [KeyValuePair.Create("http.url", "https://example.com")]), 2674CreateSpan(traceId: "1", spanId: "1-2", startTime: s_testTime.AddMinutes(5), endTime: s_testTime.AddMinutes(10), parentSpanId: "1-1", status: new Status { Code = Status.Types.StatusCode.Ok }, attributes: [KeyValuePair.Create("http.url", "https://example.com")]), 2675CreateSpan(traceId: "2", spanId: "2-1", startTime: s_testTime.AddMinutes(2), endTime: s_testTime.AddMinutes(8), status: new Status { Code = Status.Types.StatusCode.Error }, attributes: [KeyValuePair.Create("db.system", "redis")]) 3033attributes: [KeyValuePair.Create("env", "prod")]), 3035parentSpanId: "1-1", attributes: [KeyValuePair.Create("env", "prod")]) 3051attributes: [KeyValuePair.Create("env", "staging")]) 3068attributes: [KeyValuePair.Create("env", "prod")]) 3120attributes: [KeyValuePair.Create("http.method", "POST")]), 3175attributes: [KeyValuePair.Create("http.method", "GET")]), 3226attributes: [KeyValuePair.Create("http.method", "GET")]), 3228parentSpanId: "1-1", attributes: [KeyValuePair.Create("http.method", "POST")]),
Aspire.Hosting (3)
Ats\InteractionExports.cs (1)
244list.Add(KeyValuePair.Create(choice.Value, choice.Label));
Dashboard\InteractionFileUploadStore.cs (1)
372_interactions.TryRemove(KeyValuePair.Create(interactionId, interaction));
ParameterResourceBuilderExtensions.cs (1)
271Options = options.Options is { Count: > 0 } optionValues ? optionValues.Select(static option => KeyValuePair.Create(option.Key, option.Value)).ToArray() : null,
Aspire.Hosting.Azure (13)
AzureProvisioningController.cs (6)
461context.Input.Options = resourceGroupOptions.Select(static rg => KeyValuePair.Create(rg.Name, rg.Name)).ToList(); 494context.Input.Options = [KeyValuePair.Create(resourceGroupLocation, resourceGroupLocation)]; 3265return KeyValuePair.Create(tenantId, $"{description} — {tenantId}"); 3287.Select(static subscription => KeyValuePair.Create( 3344.Select(location => KeyValuePair.Create(location.Name, location.DisplayName))]; 3361.Select(static location => KeyValuePair.Create(location.Name, location.DisplayName ?? location.Name))];
Provisioning\Internal\BaseProvisioningContextProvider.cs (4)
283return KeyValuePair.Create(tenantId, description); 313.Select(sub => KeyValuePair.Create(sub.Id.SubscriptionId ?? "", $"{sub.DisplayName ?? sub.Id.SubscriptionId} ({sub.Id.SubscriptionId})")) 382.Select(loc => KeyValuePair.Create(loc.Name, loc.DisplayName)) 409.Select(location => KeyValuePair.Create(location.Name, location.DisplayName ?? location.Name))
Provisioning\Internal\PublishModeProvisioningContextProvider.cs (1)
360? resourceGroupOptions.Select(rg => KeyValuePair.Create(rg.Name, rg.Name)).ToList()
Provisioning\Internal\RunModeProvisioningContextProvider.cs (2)
418context.Input.Options = resourceGroupOptions.Select(rg => KeyValuePair.Create(rg.Name, rg.Name)).ToList(); 461context.Input.Options = [KeyValuePair.Create(resourceGroupLocation, resourceGroupLocation)];
Aspire.Hosting.Azure.Tests (1)
AzureEnvironmentResourceExtensionsTests.cs (1)
223Assert.Equal([KeyValuePair.Create("westus", "westus")], locationInput.Options);
Aspire.Hosting.Tests (13)
InteractionServiceTests.cs (6)
422var input = new InteractionInput { Name = "Value", Label = "Value", InputType = InputType.Choice, Options = [KeyValuePair.Create("first", "First option!"), KeyValuePair.Create("second", "Second option!")] }; 445var input = new InteractionInput { Name = "Value", Label = "Value", InputType = InputType.Choice, AllowCustomChoice = true, Options = [KeyValuePair.Create("first", "First option!"), KeyValuePair.Create("second", "Second option!")] }; 919c.Input.Options = [KeyValuePair.Create("loaded", "Loaded option")]; 973c.Input.Options = [KeyValuePair.Create("loaded", "Loaded option")];
ResourceCommandServiceTests.cs (7)
998Options = [KeyValuePair.Create("sub-a", "Subscription A")] 1012context.Input.Options = [KeyValuePair.Create("westus", "West US")]; 1071Options = [KeyValuePair.Create("fruit", "Fruit")] 1085context.Input.Options = [KeyValuePair.Create("banana", "Banana")]; 1102context.Input.Options = [KeyValuePair.Create("express", "Express")]; 1163Options = [KeyValuePair.Create("isolated", "Isolated")] 1177context.Input.Options = [KeyValuePair.Create("default", "Default")];
GenerateDocumentationAndConfigFiles (18)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleHelpers.cs (2)
161KeyValuePair.Create("discard_variable", UnusedValuePreference.DiscardVariable), 162KeyValuePair.Create("unused_local_variable", UnusedValuePreference.UnusedLocalVariable),
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleOptions2.cs (10)
173KeyValuePair.Create("non_public", UnusedParametersPreference.NonPublicMethods), 174KeyValuePair.Create("all", UnusedParametersPreference.AllMethods), 201KeyValuePair.Create("never", CodeStyle.AccessibilityModifiersRequired.Never), 202KeyValuePair.Create("always", CodeStyle.AccessibilityModifiersRequired.Always), 203KeyValuePair.Create("for_non_interface_members", CodeStyle.AccessibilityModifiersRequired.ForNonInterfaceMembers), 204KeyValuePair.Create("omit_if_default", CodeStyle.AccessibilityModifiersRequired.OmitIfDefault), 247KeyValuePair.Create("always_for_clarity", ParenthesesPreference.AlwaysForClarity), 248KeyValuePair.Create("never_if_unnecessary", ParenthesesPreference.NeverIfUnnecessary), 300KeyValuePair.Create("always", ForEachExplicitCastInSourcePreference.Always), 301KeyValuePair.Create("when_strongly_typed", ForEachExplicitCastInSourcePreference.WhenStronglyTyped),
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\EditorConfigValueSerializer.cs (1)
131.AddRange(alternativeEntries.Select(static p => KeyValuePair.Create(p.name, p.value)));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BidirectionalMap.cs (3)
25backwardMap: ImmutableDictionary.CreateRange(valueComparer, pairs.Select(static p => KeyValuePair.Create(p.Value, p.Key)))) 30: this(forwardMap: ImmutableDictionary.CreateRange(keyComparer, pairs.Select(static p => KeyValuePair.Create(p.key, p.value))), 31backwardMap: ImmutableDictionary.CreateRange(valueComparer, pairs.Select(static p => KeyValuePair.Create(p.value, p.key))))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixesAndRefactorings\AbstractFixAllSpanMappingService.cs (2)
41return ImmutableDictionary.CreateRange([KeyValuePair.Create(document, ImmutableArray.Create(decl.FullSpan))]); 67return ImmutableDictionary.CreateRange([KeyValuePair.Create(document, ImmutableArray.Create(decl.FullSpan))]);
Microsoft.AspNetCore.Authentication.Cookies (5)
src\aspnetcore\src\Shared\ChunkingCookieManager\ChunkingCookieManager.cs (5)
200keyValuePairs[0] = KeyValuePair.Create(key, ChunkCountPrefix + cookieChunkCount.ToString(CultureInfo.InvariantCulture)); 209keyValuePairs[chunkId] = KeyValuePair.Create(string.Concat(key, ChunkKeySuffix, chunkId.ToString(CultureInfo.InvariantCulture)), segment); 297keyValuePairs[0] = KeyValuePair.Create(key, string.Empty); 301keyValuePairs[i] = KeyValuePair.Create(string.Concat(key, "C", i.ToString(CultureInfo.InvariantCulture)), string.Empty); 327keyValuePairs.Add(KeyValuePair.Create(subkey, string.Empty));
Microsoft.AspNetCore.Components.Endpoints (5)
src\aspnetcore\src\Shared\ChunkingCookieManager\ChunkingCookieManager.cs (5)
200keyValuePairs[0] = KeyValuePair.Create(key, ChunkCountPrefix + cookieChunkCount.ToString(CultureInfo.InvariantCulture)); 209keyValuePairs[chunkId] = KeyValuePair.Create(string.Concat(key, ChunkKeySuffix, chunkId.ToString(CultureInfo.InvariantCulture)), segment); 297keyValuePairs[0] = KeyValuePair.Create(key, string.Empty); 301keyValuePairs[i] = KeyValuePair.Create(string.Concat(key, "C", i.ToString(CultureInfo.InvariantCulture)), string.Empty); 327keyValuePairs.Add(KeyValuePair.Create(subkey, string.Empty));
Microsoft.AspNetCore.CookiePolicy (1)
ResponseCookiesWrapper.cs (1)
151nonSuppressedValues.Add(KeyValuePair.Create(key, value));
Microsoft.AspNetCore.Grpc.JsonTranscoding (1)
Internal\Json\EnumNameHelpers.cs (1)
96foreach (var item in nameMappings.GroupBy(m => m.RemoveEnumPrefixName).Select(g => KeyValuePair.Create(g.Key, g.First().OriginalName)))
Microsoft.AspNetCore.Hosting (10)
Internal\HostingTelemetryHelpers.cs (10)
33KeyValuePair.Create(HttpMethods.Connect, HttpMethods.Connect), 34KeyValuePair.Create(HttpMethods.Delete, HttpMethods.Delete), 35KeyValuePair.Create(HttpMethods.Get, HttpMethods.Get), 36KeyValuePair.Create(HttpMethods.Head, HttpMethods.Head), 37KeyValuePair.Create(HttpMethods.Options, HttpMethods.Options), 38KeyValuePair.Create(HttpMethods.Patch, HttpMethods.Patch), 39KeyValuePair.Create(HttpMethods.Post, HttpMethods.Post), 40KeyValuePair.Create(HttpMethods.Put, HttpMethods.Put), 41KeyValuePair.Create(HttpMethods.Query, HttpMethods.Query), 42KeyValuePair.Create(HttpMethods.Trace, HttpMethods.Trace)
Microsoft.AspNetCore.Http.Extensions (1)
QueryBuilder.cs (1)
42: this(parameters.SelectMany(kvp => kvp.Value, (kvp, v) => KeyValuePair.Create(kvp.Key, v ?? string.Empty)))
Microsoft.AspNetCore.Mvc.Core (5)
src\aspnetcore\src\Shared\ChunkingCookieManager\ChunkingCookieManager.cs (5)
200keyValuePairs[0] = KeyValuePair.Create(key, ChunkCountPrefix + cookieChunkCount.ToString(CultureInfo.InvariantCulture)); 209keyValuePairs[chunkId] = KeyValuePair.Create(string.Concat(key, ChunkKeySuffix, chunkId.ToString(CultureInfo.InvariantCulture)), segment); 297keyValuePairs[0] = KeyValuePair.Create(key, string.Empty); 301keyValuePairs[i] = KeyValuePair.Create(string.Concat(key, "C", i.ToString(CultureInfo.InvariantCulture)), string.Empty); 327keyValuePairs.Add(KeyValuePair.Create(subkey, string.Empty));
Microsoft.AspNetCore.Routing (1)
Matching\HttpMethodMatcherPolicy.cs (1)
375destinations.Add(KeyValuePair.Create(httpMethod, destination));
Microsoft.AspNetCore.SignalR.Core (1)
StreamTracker.cs (1)
101if (!_lookup.TryRemove(KeyValuePair.Create(streamId, registration)))
Microsoft.AspNetCore.WebUtilities (1)
QueryHelpers.cs (1)
65return AddQueryString(uri, queryString.SelectMany(kvp => kvp.Value, (kvp, v) => KeyValuePair.Create<string, string?>(kvp.Key, v)));
Microsoft.CodeAnalysis (7)
DocumentationComments\DocumentationCommentIncludeCache.cs (1)
58return KeyValuePair.Create(resolvedPath, document);
MetadataReader\MetadataDecoder.cs (1)
410argumentsBuilder.Add(KeyValuePair.Create(DecodeTypeOrThrow(ref ppSig, typeCode, out argumentRefersToNoPia), modifiers));
MetadataReader\MetadataHelpers.cs (1)
926nestedNamespaces[keyIndex] = KeyValuePair.Create(primaryPair.Key, primaryPair.Value.Concat(pair.Value));
MetadataReference\AssemblyIdentityMap.cs (1)
101var pair = KeyValuePair.Create(identity, value);
PEWriter\MetadataWriter.cs (2)
1143_signatureIndex.Add(methodReference, KeyValuePair.Create(result, signatureBlob)); 1289_signatureIndex.Add(propertyDef, KeyValuePair.Create(result, blob));
ReferenceManager\CommonReferenceManager.State.cs (1)
682return ReferencedAssembliesMap.Select(ra => KeyValuePair.Create(ra.Key, (IAssemblySymbolInternal)ReferencedAssemblies[ra.Value]));
Microsoft.CodeAnalysis.CSharp.Features (9)
Completion\CompletionProviders\OperatorsAndIndexer\UnnamedSymbolCompletionProvider_Conversions.cs (3)
34[KeyValuePair.Create(KindName, ConversionKindName)]; 70builder.Add(KeyValuePair.Create(RehydrateName, RehydrateName)); 71builder.Add(KeyValuePair.Create(DocumentationCommentXmlName, conversion.GetDocumentationCommentXml(cancellationToken: context.CancellationToken) ?? ""));
Completion\CompletionProviders\OperatorsAndIndexer\UnnamedSymbolCompletionProvider_Indexers.cs (1)
19[KeyValuePair.Create(KindName, IndexerKindName)];
Completion\CompletionProviders\OperatorsAndIndexer\UnnamedSymbolCompletionProvider_Operators.cs (2)
36[KeyValuePair.Create(KindName, OperatorKindName)]; 116properties: [.. OperatorProperties, KeyValuePair.Create(OperatorName, opName)],
Completion\CompletionProviders\PartialTypeCompletionProvider.cs (1)
76=> [KeyValuePair.Create(InsertionTextOnLessThan, symbol.Name.EscapeIdentifier())];
UseExpressionBody\UseExpressionBodyCodeRefactoringProvider.cs (2)
52yield return KeyValuePair.Create((helper, useExpressionBody: true), helper.GetType().Name + "_UseExpressionBody"); 53yield return KeyValuePair.Create((helper, useExpressionBody: false), helper.GetType().Name + "_UseBlockBody");
Microsoft.CodeAnalysis.CSharp.Workspaces (20)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\CSharpFormattingOptions2.cs (20)
24KeyValuePair.Create("expressions", SpacePlacementWithinParentheses.Expressions), 25KeyValuePair.Create("type_casts", SpacePlacementWithinParentheses.TypeCasts), 26KeyValuePair.Create("control_flow_statements", SpacePlacementWithinParentheses.ControlFlowStatements), 31KeyValuePair.Create("ignore", BinaryOperatorSpacingOptionsInternal.Ignore), 32KeyValuePair.Create("none", BinaryOperatorSpacingOptionsInternal.Remove), 33KeyValuePair.Create("before_and_after", BinaryOperatorSpacingOptionsInternal.Single), 38KeyValuePair.Create("flush_left", LabelPositionOptionsInternal.LeftMost), 39KeyValuePair.Create("no_change", LabelPositionOptionsInternal.NoIndent), 40KeyValuePair.Create("one_less_than_current", LabelPositionOptionsInternal.OneLess), 45KeyValuePair.Create("object_collection_array_initalizers", NewLineBeforeOpenBracePlacement.ObjectCollectionArrayInitializers), 50KeyValuePair.Create("all", NewLineBeforeOpenBracePlacement.All), 51KeyValuePair.Create("accessors", NewLineBeforeOpenBracePlacement.Accessors), 52KeyValuePair.Create("types", NewLineBeforeOpenBracePlacement.Types), 53KeyValuePair.Create("methods", NewLineBeforeOpenBracePlacement.Methods), 54KeyValuePair.Create("properties", NewLineBeforeOpenBracePlacement.Properties), 55KeyValuePair.Create("anonymous_methods", NewLineBeforeOpenBracePlacement.AnonymousMethods), 56KeyValuePair.Create("control_blocks", NewLineBeforeOpenBracePlacement.ControlBlocks), 57KeyValuePair.Create("anonymous_types", NewLineBeforeOpenBracePlacement.AnonymousTypes), 58KeyValuePair.Create("object_collection_array_initializers", NewLineBeforeOpenBracePlacement.ObjectCollectionArrayInitializers), 59KeyValuePair.Create("lambdas", NewLineBeforeOpenBracePlacement.LambdaExpressionBody),
Microsoft.CodeAnalysis.Features (43)
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.GlobalSuppressMessageFixAllCodeAction.cs (1)
213builder.Add(KeyValuePair.Create(symbol, GetUniqueDiagnostics(diagnostics)));
CodeRefactorings\CodeRefactoringService.cs (1)
38.Select(grp => KeyValuePair.Create(grp.Key,
Completion\CommonCompletionItem.cs (1)
57properties = properties.NullToEmpty().Add(KeyValuePair.Create(DescriptionProperty, EncodeDescription(description.ToTagsAndText())));
Completion\CompletionItem.cs (1)
463=> With(properties: GetProperties().Add(KeyValuePair.Create(name, value)));
Completion\Providers\AbstractAwaitCompletionProvider.cs (5)
100builder.Add(KeyValuePair.Create(Position, position.ToString())); 101builder.Add(KeyValuePair.Create(LeftTokenPosition, leftToken.SpanStart.ToString())); 110builder.Add(KeyValuePair.Create(MakeContainerAsync, string.Empty)); 114builder.Add(KeyValuePair.Create(AddAwaitAtCurrentPosition, string.Empty)); 139properties = properties.Add(KeyValuePair.Create(AppendConfigureAwait, string.Empty));
Completion\Providers\AbstractInternalsVisibleToCompletionProvider.cs (1)
160properties: [KeyValuePair.Create(ProjectGuidKey, projectGuid)]);
Completion\Providers\CompletionUtilities.cs (1)
83=> KeyValuePair.Create(OriginalIdentifierEnd, ScanForwardThroughIdentifier(position, text, syntaxFacts).ToString());
Completion\Providers\ImportCompletionProvider\ImportCompletionItem.cs (10)
53builder.Add(KeyValuePair.Create(MethodKey, extensionMethodData.Value.methodSymbolKey)); 54builder.Add(KeyValuePair.Create(ReceiverKey, extensionMethodData.Value.receiverTypeSymbolKey)); 58builder.Add(KeyValuePair.Create(OverloadCountKey, extensionMethodData.Value.overloadCount.ToString())); 66builder.Add(KeyValuePair.Create(TypeAritySuffixName, ArityUtilities.GetMetadataAritySuffix(arity))); 74builder.Add(KeyValuePair.Create(CommitBehaviorKey, nameof(ImportCompletionCommitBehavior.NeverAddImport))); 77builder.Add(KeyValuePair.Create(CommitBehaviorKey, nameof(ImportCompletionCommitBehavior.OnlyAddImportIfExplicitlyCompleted))); 122builder.Add(KeyValuePair.Create(AttributeFullName, attributeItem.DisplayText)); 240ImmutableArray<KeyValuePair<string, string>> properties = [.. itemProperties, KeyValuePair.Create(AlwaysFullyQualifyKey, AlwaysFullyQualifyKey)]; 254properties = [.. properties, KeyValuePair.Create(CommitBehaviorKey, nameof(ImportCompletionCommitBehavior.OnlyAddImportIfExplicitlyCompleted))]; 258properties = [.. properties, KeyValuePair.Create(CommitBehaviorKey, nameof(ImportCompletionCommitBehavior.NeverAddImport))];
Completion\Providers\MemberInsertingCompletionItem.cs (3)
31KeyValuePair.Create("Line", line.ToString()), 32KeyValuePair.Create("Modifiers", modifiers.ToString()), 33KeyValuePair.Create("TokenSpanEnd", token.Span.End.ToString())],
Completion\Providers\Snippets\SnippetCompletionItem.cs (2)
34KeyValuePair.Create("Position", position.ToString()), 35KeyValuePair.Create(SnippetIdentifierKey, snippetIdentifier)],
Completion\Providers\SymbolCompletionItem.cs (8)
54builder.Add(KeyValuePair.Create(InsertionTextProperty, insertionText)); 83=> properties.Add(KeyValuePair.Create("Symbols", EncodeSymbols(symbols))); 89properties.Add(KeyValuePair.Create("SymbolKind", SmallNumberFormatter.ToString((int)symbol.Kind))); 90properties.Add(KeyValuePair.Create("SymbolName", symbol.Name)); 93properties.Add(KeyValuePair.Create("IsGeneric", isGeneric.ToString())); 247properties.Add(KeyValuePair.Create("ContextPosition", contextPositionString)); 254properties.Add(KeyValuePair.Create("InvalidProjects", string.Join(";", supportedPlatforms.InvalidProjects.Select(id => id.Id)))); 255properties.Add(KeyValuePair.Create("CandidateProjects", string.Join(";", supportedPlatforms.CandidateProjects.Select(id => id.Id))));
Completion\Providers\XmlDocCommentCompletionItem.cs (2)
26KeyValuePair.Create(BeforeCaretText, beforeCaretText), 27KeyValuePair.Create(AfterCaretText, afterCaretText)],
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (1)
1750lazyKnownMatches.Add(KeyValuePair.Create(activeNode.OldNode, activeNode.NewTrackedNode));
EditAndContinue\RunningProjectOptions.cs (1)
38return KeyValuePair.Create((filePath, targetFramework), restartAutomatically);
EmbeddedLanguages\RegularExpressions\LanguageServices\RegexEmbeddedCompletionProvider.cs (5)
100properties.Add(KeyValuePair.Create(StartKey, textChange.Span.Start.ToString())); 101properties.Add(KeyValuePair.Create(LengthKey, textChange.Span.Length.ToString())); 102properties.Add(KeyValuePair.Create(NewTextKey, textChange.NewText)); 103properties.Add(KeyValuePair.Create(DescriptionKey, embeddedItem.FullDescription)); 104properties.Add(KeyValuePair.Create(AbstractAggregateEmbeddedLanguageCompletionProvider.EmbeddedProviderName, Name));
Microsoft.CodeAnalysis.Workspaces (30)
CodeFixes\FixAllOccurrences\FixAllContext.DiagnosticProvider.cs (1)
82return ImmutableDictionary.CreateRange([KeyValuePair.Create(project, diagnostics)]);
CodeRefactorings\FixAllOccurences\RefactorAllState.cs (1)
102return spansByDocument.Select(kvp => KeyValuePair.Create(kvp.Key, new Optional<ImmutableArray<TextSpan>>(kvp.Value)))
Differencing\LongestCommonSubsequence.cs (1)
288yield return KeyValuePair.Create(xEnd, yEnd);
Log\AbstractLogAggregator.cs (1)
42=> _map.Select(static kvp => KeyValuePair.Create((TKey)kvp.Key, kvp.Value)).GetEnumerator();
Options\GlobalOptionService.cs (1)
143=> SetGlobalOptions(OneOrMany.Create(KeyValuePair.Create(optionKey, value)));
Options\SolutionOptionSet.cs (2)
83selector: key => KeyValuePair.Create(new OptionKey2((IOption2)key.Option, key.Language), _values[key])); 86selector: key => KeyValuePair.Create(key, _values[key]));
Serialization\AbstractOptionsSerializationService.cs (2)
145specificDiagnosticOptionsList.Add(KeyValuePair.Create(key, value)); 231featuresList.Add(KeyValuePair.Create(key, value));
Shared\Extensions\ILanguageMetadataExtensions.cs (1)
41return builder.Select(kvp => KeyValuePair.Create(kvp.Key, kvp.Value.ToImmutableAndFree())).ToImmutableDictionary();
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleHelpers.cs (2)
161KeyValuePair.Create("discard_variable", UnusedValuePreference.DiscardVariable), 162KeyValuePair.Create("unused_local_variable", UnusedValuePreference.UnusedLocalVariable),
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleOptions2.cs (10)
173KeyValuePair.Create("non_public", UnusedParametersPreference.NonPublicMethods), 174KeyValuePair.Create("all", UnusedParametersPreference.AllMethods), 201KeyValuePair.Create("never", CodeStyle.AccessibilityModifiersRequired.Never), 202KeyValuePair.Create("always", CodeStyle.AccessibilityModifiersRequired.Always), 203KeyValuePair.Create("for_non_interface_members", CodeStyle.AccessibilityModifiersRequired.ForNonInterfaceMembers), 204KeyValuePair.Create("omit_if_default", CodeStyle.AccessibilityModifiersRequired.OmitIfDefault), 247KeyValuePair.Create("always_for_clarity", ParenthesesPreference.AlwaysForClarity), 248KeyValuePair.Create("never_if_unnecessary", ParenthesesPreference.NeverIfUnnecessary), 300KeyValuePair.Create("always", ForEachExplicitCastInSourcePreference.Always), 301KeyValuePair.Create("when_strongly_typed", ForEachExplicitCastInSourcePreference.WhenStronglyTyped),
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\EditorConfigValueSerializer.cs (1)
131.AddRange(alternativeEntries.Select(static p => KeyValuePair.Create(p.name, p.value)));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BidirectionalMap.cs (3)
25backwardMap: ImmutableDictionary.CreateRange(valueComparer, pairs.Select(static p => KeyValuePair.Create(p.Value, p.Key)))) 30: this(forwardMap: ImmutableDictionary.CreateRange(keyComparer, pairs.Select(static p => KeyValuePair.Create(p.key, p.value))), 31backwardMap: ImmutableDictionary.CreateRange(valueComparer, pairs.Select(static p => KeyValuePair.Create(p.value, p.key))))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixesAndRefactorings\AbstractFixAllSpanMappingService.cs (2)
41return ImmutableDictionary.CreateRange([KeyValuePair.Create(document, ImmutableArray.Create(decl.FullSpan))]); 67return ImmutableDictionary.CreateRange([KeyValuePair.Create(document, ImmutableArray.Create(decl.FullSpan))]);
Workspace\Solution\SolutionState.cs (1)
1229var map = sortedNewProjectStates.Select(state => KeyValuePair.Create(
Workspace\Solution\TextDocumentStates.cs (1)
151States.AddRange(states.Select(static state => KeyValuePair.Create(state.Id, state))),
Microsoft.DotNet.HotReload.Utils.Generator (1)
DocResolver.cs (1)
32var kvp = KeyValuePair.Create(key!, value);
Microsoft.DotNet.HotReload.Utils.Generator.Frontend (1)
Frontend.cs (1)
70builder.Properties.Add(KeyValuePair.Create(k,v));
Microsoft.Extensions.Caching.Memory (2)
MemoryCache.cs (2)
870if (entry.Key is string s ? _stringEntries.TryRemove(KeyValuePair.Create(s, entry)) 871: _nonStringEntries.TryRemove(KeyValuePair.Create(entry.Key, entry)))
Microsoft.Extensions.ServiceDiscovery.Dns (3)
Resolver\DnsResolver.Telemetry.cs (3)
37var hostNameTag = KeyValuePair.Create("dns.question.name", (object?)hostName); 38var queryTypeTag = KeyValuePair.Create("dns.question.type", (object?)queryType); 46var errorTypeTag = KeyValuePair.Create("error.type", (object?)error.ToString());
Microsoft.ML.GenAI.LLaMA (2)
LlamaForCausalLM.cs (2)
151KeyValuePair.Create(targetDevice, layersOnTargetDevice), 152KeyValuePair.Create("cpu", -1)
Microsoft.ML.GenAI.Mistral (2)
MistralForCausalLM.cs (2)
101KeyValuePair.Create(targetDevice, layersOnTargetDevice), 102KeyValuePair.Create("cpu", -1)
Microsoft.ML.GenAI.Phi (2)
Phi3\Phi3ForCausalLM.cs (2)
103KeyValuePair.Create(targetDevice, layersOnTargetDevice), 104KeyValuePair.Create("cpu", -1)
Stress.AppHost (92)
CommandResources.cs (31)
225KeyValuePair.Create("vanilla", "Vanilla"), 226KeyValuePair.Create("chocolate", "Chocolate"), 227KeyValuePair.Create("strawberry", "Strawberry") 304KeyValuePair.Create("success", "Success"), 305KeyValuePair.Create("fail", "Fail"), 306KeyValuePair.Create("dry-run", "Dry run") 386KeyValuePair.Create("fruit", "Fruit"), 387KeyValuePair.Create("vegetable", "Vegetable"), 388KeyValuePair.Create("dairy", "Dairy") 413KeyValuePair.Create("apple", "Apple"), 414KeyValuePair.Create("banana", "Banana"), 415KeyValuePair.Create("cherry", "Cherry") 419KeyValuePair.Create("carrot", "Carrot"), 420KeyValuePair.Create("broccoli", "Broccoli"), 421KeyValuePair.Create("spinach", "Spinach") 425KeyValuePair.Create("milk", "Milk"), 426KeyValuePair.Create("cheese", "Cheese"), 427KeyValuePair.Create("yogurt", "Yogurt") 466KeyValuePair.Create("express", "Express"), 467KeyValuePair.Create("overnight", "Overnight") 471KeyValuePair.Create("standard", "Standard"), 472KeyValuePair.Create("express", "Express"), 473KeyValuePair.Create("overnight", "Overnight") 545KeyValuePair.Create("version", "dotnet --version"), 546KeyValuePair.Create("info", "dotnet --info") 702KeyValuePair.Create("small", "Small"), 703KeyValuePair.Create("medium", "Medium"), 704KeyValuePair.Create("large", "Large") 748KeyValuePair.Create("smoke", "Smoke tests"), 749KeyValuePair.Create("db", "Database tests"), 750KeyValuePair.Create("ui", "UI tests")
InteractionCommands.cs (61)
80KeyValuePair.Create("option1", "Option 1 - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce id massa arcu. Morbi ac risus eget augue venenatis hendrerit. Morbi posuere, **neque id** efficitur ultrices, velit augue suscipit ante, vitae lacinia elit risus nec dui."), 81KeyValuePair.Create("option2", "Option 2 - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce id massa arcu. Morbi ac risus eget augue venenatis hendrerit. Morbi posuere, **neque id** efficitur ultrices, velit augue suscipit ante, vitae lacinia elit risus nec dui.") 92KeyValuePair.Create("option1", "Option 1 - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce id massa arcu. Morbi ac risus eget augue venenatis hendrerit. Morbi posuere, **neque id** efficitur ultrices, velit augue suscipit ante, vitae lacinia elit risus nec dui."), 93KeyValuePair.Create("option2", "Option 2 - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce id massa arcu. Morbi ac risus eget augue venenatis hendrerit. Morbi posuere, **neque id** efficitur ultrices, velit augue suscipit ante, vitae lacinia elit risus nec dui.") 151KeyValuePair.Create("pizza", "Pizza"), 152KeyValuePair.Create("fried-chicken", "Fried chicken"), 153KeyValuePair.Create("burger", "Burger") 164KeyValuePair.Create("vegetarian", "Vegetarian"), 165KeyValuePair.Create("vegan", "Vegan") 204KeyValuePair.Create("pizza", "Pizza"), 205KeyValuePair.Create("fried-chicken", "Fried chicken"), 206KeyValuePair.Create("burger", "Burger"), 207KeyValuePair.Create("salmon", "Salmon"), 208KeyValuePair.Create("chicken-pie", "Chicken pie"), 209KeyValuePair.Create("sushi", "Sushi"), 210KeyValuePair.Create("tacos", "Tacos"), 211KeyValuePair.Create("pasta", "Pasta"), 212KeyValuePair.Create("salad", "Salad"), 213KeyValuePair.Create("steak", "Steak"), 214KeyValuePair.Create("vegetarian", "Vegetarian"), 215KeyValuePair.Create("sausage", "Sausage"), 216KeyValuePair.Create("lasagne", "Lasagne"), 217KeyValuePair.Create("fish-pie", "Fish pie"), 218KeyValuePair.Create("soup", "Soup"), 219KeyValuePair.Create("beef-stew", "Beef stew"), 220KeyValuePair.Create("welsh-pie", "Llanfair­pwllgwyngyll­gogery­chwyrn­drobwll­llan­tysilio­gogo­goch pie"), 232KeyValuePair.Create("vegetarian", "Vegetarian"), 233KeyValuePair.Create("vegan", "Vegan") 288KeyValuePair.Create("option1", "Option 1"), 289KeyValuePair.Create("option2", "Option 2"), 290KeyValuePair.Create("option3", "Option 3") 309KeyValuePair.Create("option1", "Option 1"), 310KeyValuePair.Create("option2", "Option 2"), 311KeyValuePair.Create("option3", "Option 3") 328list.Add(KeyValuePair.Create($"option{i}-{dependsOnInput.Value}", $"Option {i} - {dependsOnInput.Value}")); 427KeyValuePair.Create("option1", "Option 1"), 428KeyValuePair.Create("option2", "Option 2"), 429KeyValuePair.Create("option3", "Option 3") 473list.Add(KeyValuePair.Create($"option{i}-{dependsOnInput.Value}", $"Option {i} - {dependsOnInput.Value}")); 618KeyValuePair.Create("11111111-1111-1111-1111-111111111111", "Contoso Corp (11111111-1111-1111-1111-111111111111)"), 619KeyValuePair.Create("22222222-2222-2222-2222-222222222222", "Fabrikam Inc (22222222-2222-2222-2222-222222222222)"), 620KeyValuePair.Create("33333333-3333-3333-3333-333333333333", "Northwind Traders (33333333-3333-3333-3333-333333333333)") 648KeyValuePair.Create("aaaa1111-aaaa-aaaa-aaaa-aaaaaaaaaaaa", "Dev/Test Subscription (aaaa1111)"), 649KeyValuePair.Create("bbbb2222-bbbb-bbbb-bbbb-bbbbbbbbbbbb", "Production Subscription (bbbb2222)") 655KeyValuePair.Create("cccc3333-cccc-cccc-cccc-cccccccccccc", "Sandbox Subscription (cccc3333)"), 656KeyValuePair.Create("dddd4444-dddd-dddd-dddd-dddddddddddd", "Staging Subscription (dddd4444)"), 657KeyValuePair.Create("eeee5555-eeee-eeee-eeee-eeeeeeeeeeee", "Production Subscription (eeee5555)") 681KeyValuePair.Create("rg-aspire-dev", "rg-aspire-dev"), 682KeyValuePair.Create("rg-myapp-prod", "rg-myapp-prod"), 683KeyValuePair.Create("rg-shared-services", "rg-shared-services") 721context.Input.Options = [KeyValuePair.Create(existingLocation, existingLocation)]; 730KeyValuePair.Create("eastus", "East US"), 731KeyValuePair.Create("eastus2", "East US 2"), 732KeyValuePair.Create("westus2", "West US 2"), 733KeyValuePair.Create("westus3", "West US 3"), 734KeyValuePair.Create("centralus", "Central US"), 735KeyValuePair.Create("northeurope", "North Europe"), 736KeyValuePair.Create("westeurope", "West Europe"), 737KeyValuePair.Create("southeastasia", "Southeast Asia"), 738KeyValuePair.Create("australiaeast", "Australia East"), 739KeyValuePair.Create("japaneast", "Japan East")
System.Net.NameResolution (2)
System\Net\NameResolutionMetrics.cs (2)
31var hostNameTag = KeyValuePair.Create("dns.question.name", (object?)hostName); 40var errorTypeTag = KeyValuePair.Create("error.type", (object?)errorType);
System.Private.CoreLib (8)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\AsyncLocal.cs (8)
115new OneElementAsyncLocalValueMap(KeyValuePair.Create(key, value)) : 127new OneElementAsyncLocalValueMap(KeyValuePair.Create(key, value)) : 154KeyValuePair<IAsyncLocal, object?> newItem = KeyValuePair.Create(key, value); 204KeyValuePair<IAsyncLocal, object?> newItem = KeyValuePair.Create(key, value); 264KeyValuePair<IAsyncLocal, object?> newItem = KeyValuePair.Create(key, value); 333KeyValuePair<IAsyncLocal, object?> newItem = KeyValuePair.Create(key, value); 408newValues[i] = KeyValuePair.Create(key, value); 450newValues[_keyValues.Length] = KeyValuePair.Create(key, value);
System.Security.Cryptography (3)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\RSACng.SignVerify.cs (3)
21KeyValuePair.Create(HashAlgorithmName.SHA256, 256 / 8), 22KeyValuePair.Create(HashAlgorithmName.SHA384, 384 / 8), 23KeyValuePair.Create(HashAlgorithmName.SHA512, 512 / 8),