563 references to Create
Aspire.Dashboard.Components.Tests (6)
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 (104)
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 (24)
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")]) 229KeyValuePair.Create(GenAIHelpers.GenAIEventContent, JsonSerializer.Serialize(new SystemOrUserEvent { Content = "System!" }, GenAIEventsContext.Default.SystemOrUserEvent)), 230KeyValuePair.Create(GenAIHelpers.GenAISystem, "System!"), 236KeyValuePair.Create(GenAIHelpers.GenAIEventContent, JsonSerializer.Serialize(new SystemOrUserEvent { Content = "User!" }, GenAIEventsContext.Default.SystemOrUserEvent)), 237KeyValuePair.Create(GenAIHelpers.GenAISystem, "System!"), 243KeyValuePair.Create(GenAIHelpers.GenAIEventContent, JsonSerializer.Serialize(new AssistantEvent { Content = "Assistant!" }, GenAIEventsContext.Default.AssistantEvent)), 244KeyValuePair.Create(GenAIHelpers.GenAISystem, "System!"), 261CreateSpan(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) 344KeyValuePair.Create(GenAIHelpers.GenAISystem, "System!"), 345KeyValuePair.Create("server.address", "ai-server.address"), 346KeyValuePair.Create(GenAIHelpers.GenAISystemInstructions, systemInstruction), 347KeyValuePair.Create(GenAIHelpers.GenAIInputMessages, inputMessages), 348KeyValuePair.Create(GenAIHelpers.GenAIOutputInstructions, outputMessages) 466KeyValuePair.Create(GenAIHelpers.GenAISystem, "System!"), 467KeyValuePair.Create("server.address", "ai-server.address"), 468KeyValuePair.Create(GenAIHelpers.GenAISystemInstructions, systemInstruction), 469KeyValuePair.Create(GenAIHelpers.GenAIInputMessages, inputMessages), 470KeyValuePair.Create(GenAIHelpers.GenAIOutputInstructions, outputMessages)
Model\ResourceMenuItemsTests.cs (2)
71TelemetryTestHelpers.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), 72TelemetryTestHelpers.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 (23)
49Assert.False(TryResolvePeerName(resources, [KeyValuePair.Create("peer.service", "")], out _)); 62Assert.False(TryResolvePeerName(resources, [KeyValuePair.Create<string, string>("peer.service", null!)], out _)); 75Assert.True(TryResolvePeerName(resources, [KeyValuePair.Create("peer.service", "localhost:5000")], out var value)); 89Assert.True(TryResolvePeerName(resources, [KeyValuePair.Create("peer.service", "127.0.0.1:5000")], out var value)); 103Assert.True(TryResolvePeerName(resources, [KeyValuePair.Create("peer.service", "127.0.0.1,5000")], out var value)); 117Assert.True(TryResolvePeerName(resources, [KeyValuePair.Create("server.address", "localhost"), KeyValuePair.Create("server.port", "5000")], out var value)); 196Assert.True(TryResolvePeerName(resources, [KeyValuePair.Create("server.address", "localhost"), KeyValuePair.Create("server.port", "5000")], out var value)); 211Assert.True(TryResolvePeerName(resources, [KeyValuePair.Create("server.address", "localhost"), KeyValuePair.Create("server.port", "5000")], out var value1)); 214Assert.True(TryResolvePeerName(resources, [KeyValuePair.Create("server.address", "localhost"), KeyValuePair.Create("server.port", "5001")], out var value2)); 234Assert.True(TryResolvePeerName(resources, [KeyValuePair.Create("peer.service", "models.github.ai:443")], out var value)); 249Assert.True(TryResolvePeerName(resources, [KeyValuePair.Create("peer.service", "models.github.ai:443")], out var value)); 263Assert.True(TryResolvePeerName(resources, [KeyValuePair.Create("peer.service", "api.example.com:8080")], out var value)); 278Assert.False(TryResolvePeerName(resources, [KeyValuePair.Create("peer.service", "localhost:1433")], out _)); 291Assert.False(TryResolvePeerName(resources, [KeyValuePair.Create("peer.service", "localhost:5000")], out _)); 305Assert.True(TryResolvePeerName(resources, [KeyValuePair.Create("peer.service", "mystorageaccount.blob.core.windows.net:443")], out var value)); 320Assert.True(TryResolvePeerName(resources, [KeyValuePair.Create("peer.service", "myvault.vault.azure.net:8080")], out var value)); 371Assert.True(TryResolvePeerName(resources, [KeyValuePair.Create("peer.service", "127.0.0.1:1433")], out var name)); 386Assert.True(TryResolvePeerName(resources, [KeyValuePair.Create("peer.service", "localhost:5432")], out var name)); 403Assert.True(TryResolvePeerName(resources, [KeyValuePair.Create("peer.service", "127.0.0.1:8080")], out var name));
TelemetryRepositoryTests\LogTests.cs (2)
942LogRecords = { CreateLogRecord(time: s_testTime.AddMinutes(1), message: "message-1", attributes: [KeyValuePair.Create("key-1", "value-1")]) } 954LogRecords = { 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")]), 1152CreateSumMetric(metricName: "test", startTime: s_testTime.AddMinutes(1), attributes: [KeyValuePair.Create("otel.metric.overflow", "true")])
TelemetryRepositoryTests\TraceTests.cs (17)
1080Spans = { CreateSpan(traceId: "1", spanId: "1-1", startTime: s_testTime.AddMinutes(1), endTime: s_testTime.AddMinutes(10), attributes: [KeyValuePair.Create("key-1", "value-1")]) } 1092Spans = { CreateSpan(traceId: "2", spanId: "2-1", startTime: s_testTime.AddMinutes(2), endTime: s_testTime.AddMinutes(10), attributes: [KeyValuePair.Create("key-2", "value-2")]) } 1155Spans = { CreateSpan(traceId: "1", spanId: "1-1", startTime: s_testTime.AddMinutes(1), endTime: s_testTime.AddMinutes(10), attributes: [KeyValuePair.Create("key1", "value1")]) } 1167Spans = { CreateSpan(traceId: "1", spanId: "1-2", startTime: s_testTime.AddMinutes(2), endTime: s_testTime.AddMinutes(10), parentSpanId: "1-1", attributes: [KeyValuePair.Create("key2", "value2")]) } 1257Spans = { 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) } 1432Resource = CreateResource(attributes: [KeyValuePair.Create("prop1", "value1")]), 1447Resource = CreateResource(attributes: [KeyValuePair.Create("prop2", "value1"), KeyValuePair.Create("prop1", "value2")]), 1462Resource = CreateResource(attributes: [KeyValuePair.Create("prop1", "value2"), KeyValuePair.Create("prop2", "value1")]), 1952CreateSpan(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), 1953CreateSpan(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) 2039CreateSpan(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), 2040CreateSpan(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) 2145CreateSpan(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), 2146CreateSpan(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)
Aspire.Hosting.Azure (4)
Provisioning\Internal\PublishModeProvisioningContextProvider.cs (3)
129.Select(sub => KeyValuePair.Create(sub.Id.SubscriptionId ?? "", $"{sub.DisplayName ?? sub.Id.SubscriptionId} ({sub.Id.SubscriptionId})")) 247.Select(loc => KeyValuePair.Create(loc.Name, loc.DisplayName)) 324.Select(location => KeyValuePair.Create(location.Name, location.DisplayName ?? location.Name))
Provisioning\Internal\RunModeProvisioningContextProvider.cs (1)
106.Select(location => KeyValuePair.Create(location.Name, location.DisplayName ?? location.Name))
Aspire.Hosting.Tests (2)
InteractionServiceTests.cs (2)
230var input = new InteractionInput { Name = "Value", Label = "Value", InputType = InputType.Choice, Options = [KeyValuePair.Create("first", "First option!"), KeyValuePair.Create("second", "Second option!")] };
GenerateDocumentationAndConfigFiles (18)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleHelpers.cs (2)
161KeyValuePair.Create("discard_variable", UnusedValuePreference.DiscardVariable), 162KeyValuePair.Create("unused_local_variable", UnusedValuePreference.UnusedLocalVariable),
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\EditorConfigValueSerializer.cs (1)
131.AddRange(alternativeEntries.Select(static p => KeyValuePair.Create(p.name, p.value)));
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\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\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.CookiePolicy.Test (5)
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.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 (9)
Internal\HostingTelemetryHelpers.cs (9)
30KeyValuePair.Create(HttpMethods.Connect, HttpMethods.Connect), 31KeyValuePair.Create(HttpMethods.Delete, HttpMethods.Delete), 32KeyValuePair.Create(HttpMethods.Get, HttpMethods.Get), 33KeyValuePair.Create(HttpMethods.Head, HttpMethods.Head), 34KeyValuePair.Create(HttpMethods.Options, HttpMethods.Options), 35KeyValuePair.Create(HttpMethods.Patch, HttpMethods.Patch), 36KeyValuePair.Create(HttpMethods.Post, HttpMethods.Post), 37KeyValuePair.Create(HttpMethods.Put, HttpMethods.Put), 38KeyValuePair.Create(HttpMethods.Trace, HttpMethods.Trace)
Microsoft.AspNetCore.Hosting.Tests (3)
HostingApplicationDiagnosticsTests.cs (3)
938KeyValuePair.Create("Key1","value1"), 939KeyValuePair.Create("Key2","value2"), 940KeyValuePair.Create("Key1","value3")
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.Identity.Test (108)
SignInManagerTest.cs (53)
73KeyValuePair.Create<string, object>("aspnetcore.identity.user_type", "Microsoft.AspNetCore.Identity.Test.PocoUser"), 74KeyValuePair.Create<string, object>("aspnetcore.authentication.scheme", "Identity.Application"), 75KeyValuePair.Create<string, object>("aspnetcore.identity.sign_in.type", "password"), 76KeyValuePair.Create<string, object>("aspnetcore.authentication.is_persistent", false), 77KeyValuePair.Create<string, object>("aspnetcore.identity.sign_in.result", "locked_out"), 117KeyValuePair.Create<string, object>("aspnetcore.identity.user_type", "Microsoft.AspNetCore.Identity.Test.PocoUser"), 118KeyValuePair.Create<string, object>("aspnetcore.identity.sign_in.result", "locked_out"), 397KeyValuePair.Create<string, object>("aspnetcore.identity.user_type", "Microsoft.AspNetCore.Identity.Test.PocoUser"), 398KeyValuePair.Create<string, object>("aspnetcore.authentication.scheme", "Identity.Application"), 399KeyValuePair.Create<string, object>("aspnetcore.identity.sign_in.type", "external"), 400KeyValuePair.Create<string, object>("aspnetcore.authentication.is_persistent", false), 401KeyValuePair.Create<string, object>("aspnetcore.identity.sign_in.result", "success"), 406KeyValuePair.Create<string, object>("aspnetcore.identity.user_type", "Microsoft.AspNetCore.Identity.Test.PocoUser"), 407KeyValuePair.Create<string, object>("aspnetcore.authentication.scheme", "Identity.Application"), 408KeyValuePair.Create<string, object>("aspnetcore.authentication.is_persistent", false), 416KeyValuePair.Create<string, object>("aspnetcore.identity.user_type", "Microsoft.AspNetCore.Identity.Test.PocoUser"), 417KeyValuePair.Create<string, object>("aspnetcore.authentication.scheme", "Identity.Application"), 418KeyValuePair.Create<string, object>("aspnetcore.identity.sign_in.type", "external"), 419KeyValuePair.Create<string, object>("aspnetcore.authentication.is_persistent", false), 420KeyValuePair.Create<string, object>("aspnetcore.identity.sign_in.result", "requires_two_factor"), 474KeyValuePair.Create<string, object>("aspnetcore.identity.user_type", "Microsoft.AspNetCore.Identity.Test.PocoUser"), 475KeyValuePair.Create<string, object>("aspnetcore.authentication.scheme", "Identity.Application"), 476KeyValuePair.Create<string, object>("aspnetcore.identity.sign_in.type", "passkey"), 477KeyValuePair.Create<string, object>("aspnetcore.authentication.is_persistent", false), 478KeyValuePair.Create<string, object>("aspnetcore.identity.sign_in.result", "success"), 483KeyValuePair.Create<string, object>("aspnetcore.identity.user_type", "Microsoft.AspNetCore.Identity.Test.PocoUser"), 484KeyValuePair.Create<string, object>("aspnetcore.authentication.scheme", "Identity.Application"), 485KeyValuePair.Create<string, object>("aspnetcore.authentication.is_persistent", false), 802KeyValuePair.Create<string, object>("aspnetcore.identity.user_type", "Microsoft.AspNetCore.Identity.Test.PocoUser"), 803KeyValuePair.Create<string, object>("aspnetcore.authentication.scheme", "Identity.Application"), 804KeyValuePair.Create<string, object>("error.type", "System.InvalidOperationException"), 860KeyValuePair.Create<string, object>("aspnetcore.identity.user_type", "Microsoft.AspNetCore.Identity.Test.PocoUser"), 861KeyValuePair.Create<string, object>("aspnetcore.authentication.scheme", "Identity.Application"), 862KeyValuePair.Create<string, object>("aspnetcore.authentication.is_persistent", isPersistent), 863KeyValuePair.Create<string, object>("aspnetcore.identity.sign_in.result", "success"), 897KeyValuePair.Create<string, object>("aspnetcore.identity.user_type", "Microsoft.AspNetCore.Identity.Test.PocoUser"), 898KeyValuePair.Create<string, object>("aspnetcore.authentication.scheme", "Identity.Application"), 899KeyValuePair.Create<string, object>("aspnetcore.identity.sign_in.result", "failure"), 1071KeyValuePair.Create<string, object>("aspnetcore.identity.user_type", "Microsoft.AspNetCore.Identity.Test.PocoUser"), 1072KeyValuePair.Create<string, object>("aspnetcore.authentication.scheme", "Identity.TwoFactorRememberMe"), 1103KeyValuePair.Create<string, object>("aspnetcore.identity.user_type", "Microsoft.AspNetCore.Identity.Test.PocoUser"), 1104KeyValuePair.Create<string, object>("aspnetcore.authentication.scheme", "Identity.TwoFactorRememberMe"), 1105KeyValuePair.Create<string, object>("error.type", "System.InvalidOperationException"), 1174KeyValuePair.Create<string, object>("aspnetcore.identity.user_type", "Microsoft.AspNetCore.Identity.Test.PocoUser"), 1175KeyValuePair.Create<string, object>("aspnetcore.authentication.scheme", "Identity.Application"), 1199KeyValuePair.Create<string, object>("aspnetcore.identity.user_type", "Microsoft.AspNetCore.Identity.Test.PocoUser"), 1200KeyValuePair.Create<string, object>("aspnetcore.authentication.scheme", "Identity.Application"), 1201KeyValuePair.Create<string, object>("error.type", "System.InvalidOperationException"), 1235KeyValuePair.Create<string, object>("aspnetcore.identity.user_type", "Microsoft.AspNetCore.Identity.Test.PocoUser"), 1236KeyValuePair.Create<string, object>("aspnetcore.authentication.scheme", "Identity.Application"), 1237KeyValuePair.Create<string, object>("aspnetcore.authentication.is_persistent", false), 1238KeyValuePair.Create<string, object>("aspnetcore.identity.sign_in.result", "failure"), 1239KeyValuePair.Create<string, object>("aspnetcore.identity.sign_in.type", "password"),
UserManagerTest.cs (55)
148KeyValuePair.Create<string, object>("aspnetcore.identity.user_type", "Microsoft.AspNetCore.Identity.Test.PocoUser"), 149KeyValuePair.Create<string, object>("aspnetcore.identity.result", "success") 175KeyValuePair.Create<string, object>("aspnetcore.identity.user_type", "Microsoft.AspNetCore.Identity.Test.PocoUser"), 176KeyValuePair.Create<string, object>("aspnetcore.identity.result", "failure"), 177KeyValuePair.Create<string, object>("aspnetcore.identity.error_code", "ConcurrencyFailure") 588KeyValuePair.Create<string, object>("aspnetcore.identity.user.update_type", "add_claims"), 589KeyValuePair.Create<string, object>("aspnetcore.identity.result", "success") 620KeyValuePair.Create<string, object>("aspnetcore.identity.user.update_type", "replace_claim"), 621KeyValuePair.Create<string, object>("aspnetcore.identity.result", "success") 662KeyValuePair.Create<string, object>("aspnetcore.identity.user.update_type", "password_rehash"), 663KeyValuePair.Create<string, object>("aspnetcore.identity.result", "success") 668KeyValuePair.Create<string, object>("aspnetcore.identity.password_check_result", "success_rehash_needed") 694KeyValuePair.Create<string, object>("aspnetcore.identity.user_type", "Microsoft.AspNetCore.Identity.Test.PocoUser"), 695KeyValuePair.Create<string, object>("error.type", "System.InvalidOperationException") 721KeyValuePair.Create<string, object>("aspnetcore.identity.user.update_type", "update"), 722KeyValuePair.Create<string, object>("error.type", "System.InvalidOperationException") 752KeyValuePair.Create<string, object>("aspnetcore.identity.user.update_type", "remove_claims"), 753KeyValuePair.Create<string, object>("aspnetcore.identity.result", "success") 783KeyValuePair.Create<string, object>("aspnetcore.identity.user.update_type", "remove_claims"), 784KeyValuePair.Create<string, object>("aspnetcore.identity.result", "success") 875KeyValuePair.Create<string, object>("aspnetcore.identity.password_check_result", "user_missing") 904KeyValuePair.Create<string, object>("aspnetcore.identity.user.update_type", "set_email"), 905KeyValuePair.Create<string, object>("error.type", "System.NotSupportedException"), 909KeyValuePair.Create<string, object>("aspnetcore.identity.user.update_type", "confirm_email"), 910KeyValuePair.Create<string, object>("error.type", "System.NotSupportedException"), 929KeyValuePair.Create<string, object>("aspnetcore.identity.user.update_type", "set_phone_number"), 930KeyValuePair.Create<string, object>("error.type", "System.NotSupportedException"), 934KeyValuePair.Create<string, object>("aspnetcore.identity.user.update_type", "change_phone_number"), 935KeyValuePair.Create<string, object>("error.type", "System.NotSupportedException"), 956KeyValuePair.Create<string, object>("aspnetcore.identity.token_purpose", "_OTHER"), 957KeyValuePair.Create<string, object>("error.type", "System.NotSupportedException"), 962KeyValuePair.Create<string, object>("aspnetcore.identity.token_purpose", "_OTHER"), 963KeyValuePair.Create<string, object>("error.type", "System.NotSupportedException"), 987KeyValuePair.Create<string, object>("error.type", "System.NotSupportedException"), 992KeyValuePair.Create<string, object>("aspnetcore.identity.user.update_type", "change_password"), 993KeyValuePair.Create<string, object>("error.type", "System.NotSupportedException"), 997KeyValuePair.Create<string, object>("aspnetcore.identity.user.update_type", "add_password"), 998KeyValuePair.Create<string, object>("error.type", "System.NotSupportedException"), 1002KeyValuePair.Create<string, object>("aspnetcore.identity.user.update_type", "remove_password"), 1003KeyValuePair.Create<string, object>("error.type", "System.NotSupportedException"), 1008KeyValuePair.Create<string, object>("error.type", "System.NotSupportedException"), 1033KeyValuePair.Create<string, object>("aspnetcore.identity.user.update_type", "update_security_stamp"), 1034KeyValuePair.Create<string, object>("error.type", "System.NotSupportedException"), 1039KeyValuePair.Create<string, object>("aspnetcore.identity.token_purpose", "change_phone_number"), 1040KeyValuePair.Create<string, object>("error.type", "System.NotSupportedException"), 1060KeyValuePair.Create<string, object>("aspnetcore.identity.user.update_type", "add_login"), 1061KeyValuePair.Create<string, object>("error.type", "System.NotSupportedException"), 1065KeyValuePair.Create<string, object>("aspnetcore.identity.user.update_type", "remove_login"), 1066KeyValuePair.Create<string, object>("error.type", "System.NotSupportedException"), 1086KeyValuePair.Create<string, object>("aspnetcore.identity.user.update_type", "add_claims"), 1087KeyValuePair.Create<string, object>("error.type", "System.NotSupportedException"), 1091KeyValuePair.Create<string, object>("aspnetcore.identity.user.update_type", "replace_claim"), 1092KeyValuePair.Create<string, object>("error.type", "System.NotSupportedException"), 1096KeyValuePair.Create<string, object>("aspnetcore.identity.user.update_type", "remove_claims"), 1097KeyValuePair.Create<string, object>("error.type", "System.NotSupportedException"),
Microsoft.AspNetCore.Mvc.Core (5)
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.Mvc.FunctionalTests (1)
SimpleWithWebApplicationBuilderTests.cs (1)
161KeyValuePair.Create("Greeting", "Bonjour tout le monde"),
Microsoft.AspNetCore.Routing (1)
Matching\HttpMethodMatcherPolicy.cs (1)
375destinations.Add(KeyValuePair.Create(httpMethod, destination));
Microsoft.AspNetCore.Routing.Microbenchmarks (9)
Matching\HttpMethodPolicyJumpTableBenchmark.cs (9)
35KeyValuePair.Create(HttpMethods.Connect, 1), 36KeyValuePair.Create(HttpMethods.Delete, 2), 37KeyValuePair.Create(HttpMethods.Head, 3), 38KeyValuePair.Create(HttpMethods.Get, 4), 39KeyValuePair.Create(HttpMethods.Options, 5), 40KeyValuePair.Create(HttpMethods.Patch, 6), 41KeyValuePair.Create(HttpMethods.Put, 7), 42KeyValuePair.Create(HttpMethods.Post, 8), 43KeyValuePair.Create(HttpMethods.Trace, 9)
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (1)
RequestHeaderTests.cs (1)
90var header = KeyValuePair.Create("Custom-Header", new StringValues("custom"));
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)
916nestedNamespaces[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.CommandLine.UnitTests (16)
CommandLineTests.cs (16)
11520Assert.Equal(KeyValuePair.Create("K1" + s, "V1" + s), parsedArgs.PathMap[0]); 11524Assert.Equal(KeyValuePair.Create("abc" + s, "/"), parsedArgs.PathMap[0]); 11528Assert.Equal(KeyValuePair.Create("K1" + s, "V1" + s), parsedArgs.PathMap[0]); 11529Assert.Equal(KeyValuePair.Create("K2" + s, "V2" + s), parsedArgs.PathMap[1]); 11562Assert.Equal(KeyValuePair.Create("supporting spaces" + s, "is hard" + s), parsedArgs.PathMap[0]); 11566Assert.Equal(KeyValuePair.Create("K 1" + s, "V 1" + s), parsedArgs.PathMap[0]); 11567Assert.Equal(KeyValuePair.Create("K 2" + s, "V 2" + s), parsedArgs.PathMap[1]); 11571Assert.Equal(KeyValuePair.Create("K 1" + s, "V 1" + s), parsedArgs.PathMap[0]); 11572Assert.Equal(KeyValuePair.Create("K 2" + s, "V 2" + s), parsedArgs.PathMap[1]); 11576Assert.Equal(KeyValuePair.Create("a =,b" + s, "1,= 2" + s), parsedArgs.PathMap[0]); 11577Assert.Equal(KeyValuePair.Create("x =,y" + s, "3 4" + s), parsedArgs.PathMap[1]); 11581Assert.Equal(KeyValuePair.Create(@"C:\temp\a\b\", "/_3/"), parsedArgs.PathMap[0]); 11582Assert.Equal(KeyValuePair.Create(@"C:\temp\a\", "/_2/"), parsedArgs.PathMap[1]); 11583Assert.Equal(KeyValuePair.Create(@"C:\temp\", "/_1/"), parsedArgs.PathMap[2]); 12267additionalEnvironmentVars: new[] { KeyValuePair.Create("MICROSOFT_DIASYMREADER_NATIVE_ALT_LOAD_PATH", "") }); 12282additionalEnvironmentVars: new[] { KeyValuePair.Create("MICROSOFT_DIASYMREADER_NATIVE_ALT_LOAD_PATH", cscDir) });
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (2)
ExtractMethod\ExtractMethodBase.cs (1)
36var featuresMapped = features.Select(x => KeyValuePair.Create(x, string.Empty));
Semantics\SpeculationAnalyzerTests.cs (1)
484TestOptions.ReleaseDll.WithSpecificDiagnosticOptions([KeyValuePair.Create("CS0219", ReportDiagnostic.Suppress)]));
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (1)
CodeGen\GotoTest.cs (1)
1128var resolver = TestSourceReferenceResolver.Create(KeyValuePair.Create("a.csx", sourceA));
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (4)
Diagnostics\DiagnosticAnalyzerTests.cs (2)
146new[] { KeyValuePair.Create("CA9999_UseOfVariableThatStartsWithX", ReportDiagnostic.Suppress) }); 169new[] { KeyValuePair.Create("CA9999_UseOfVariableThatStartsWithX", ReportDiagnostic.Error) });
Semantics\CollectionExpressionTests.cs (2)
28KeyValuePair.Create(GetIdForErrorCode(ErrorCode.WRN_CollectionExpressionRefStructMayAllocate), ReportDiagnostic.Warn), 29KeyValuePair.Create(GetIdForErrorCode(ErrorCode.WRN_CollectionExpressionRefStructSpreadMayAllocate), ReportDiagnostic.Warn)
Microsoft.CodeAnalysis.CSharp.Features (10)
Completion\CompletionProviders\CrefCompletionProvider.cs (1)
78var serializedOptions = ImmutableArray.Create(KeyValuePair.Create(HideAdvancedMembers, options.MemberDisplayOptions.HideAdvancedMembers.ToString()));
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.Features.UnitTests (4)
Diagnostics\Suppression\SuppressionTests.cs (2)
803var specificDiagnosticOptions = new[] { KeyValuePair.Create(IDEDiagnosticIds.FormattingDiagnosticId, ReportDiagnostic.Warn) }; 1049var specificDiagnosticOptions = new[] { KeyValuePair.Create(IDEDiagnosticIds.FormattingDiagnosticId, ReportDiagnostic.Warn) };
EditAndContinue\CSharpEditAndContinueAnalyzerTests.cs (1)
313KeyValuePair.Create(newDocument.FilePath, ImmutableArray.Create(
src\Analyzers\CSharp\Tests\MakeFieldReadonly\MakeFieldReadonlyTests.cs (1)
25private static readonly ParseOptions s_strictFeatureFlag = CSharpParseOptions.Default.WithFeatures([KeyValuePair.Create("strict", "true")]);
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (17)
ScriptTests.cs (17)
646KeyValuePair.Create("a.csx", "return 42;")); 664KeyValuePair.Create("a.csx", @" 687KeyValuePair.Create("a.csx", @" 710KeyValuePair.Create("a.csx", "1"), 711KeyValuePair.Create("b.csx", @" 720KeyValuePair.Create("a.csx", "1"), 721KeyValuePair.Create("b.csx", "2")); 730KeyValuePair.Create("a.csx", "1"), 731KeyValuePair.Create("b.csx", "2")); 745KeyValuePair.Create("a.csx", "return 1;"), 746KeyValuePair.Create("b.csx", @" 755KeyValuePair.Create("a.csx", "return 1;"), 756KeyValuePair.Create("b.csx", "2")); 765KeyValuePair.Create("a.csx", "return 1;"), 766KeyValuePair.Create("b.csx", "2")); 780KeyValuePair.Create("a.csx", @" 829KeyValuePair.Create("a.csx", @"
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (7)
Compilation\CompilationAPITests.cs (1)
3359KeyValuePair.Create("a.csx", "return \"Who returns a string?\";"));
Compilation\LoadDirectiveTests.cs (6)
51KeyValuePair.Create("a.csx", @" 77KeyValuePair.Create<string, object>("a.csx", new byte[] { 0xd8, 0x00, 0x00, 0x00 }), 78KeyValuePair.Create<string, object>("b.csx", "#load \"a.csx\"")); 156var resolver = TestSourceReferenceResolver.Create(KeyValuePair.Create("a.csx", code)); 175KeyValuePair.Create("a.csx", "#load \"b.csx\""), 176KeyValuePair.Create("b.csx", code));
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (1)
Syntax\SyntaxTreeTests.cs (1)
232new[] { KeyValuePair.Create("CS00778", ReportDiagnostic.Suppress) });
Microsoft.CodeAnalysis.CSharp.Test.Utilities (5)
CSharpTestBase.cs (5)
2930KeyValuePair.Create(GetIdForErrorCode(ErrorCode.WRN_UseDefViolationPropertySupportedVersion), ReportDiagnostic.Warn), 2931KeyValuePair.Create(GetIdForErrorCode(ErrorCode.WRN_UseDefViolationFieldSupportedVersion), ReportDiagnostic.Warn), 2932KeyValuePair.Create(GetIdForErrorCode(ErrorCode.WRN_UseDefViolationThisSupportedVersion), ReportDiagnostic.Warn), 2933KeyValuePair.Create(GetIdForErrorCode(ErrorCode.WRN_UnassignedThisAutoPropertySupportedVersion), ReportDiagnostic.Warn), 2934KeyValuePair.Create(GetIdForErrorCode(ErrorCode.WRN_UnassignedThisSupportedVersion), ReportDiagnostic.Warn),
Microsoft.CodeAnalysis.CSharp.Workspaces (20)
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.ExpressionEvaluator.ExpressionCompiler (2)
PDB\MethodDebugInfo.Native.cs (2)
293KeyValuePair.Create(reader, methodVersion), 528KeyValuePair.Create(reader, methodVersion),
Microsoft.CodeAnalysis.Features (39)
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)
48properties = 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())); 105builder.Add(KeyValuePair.Create(MakeContainerAsync, string.Empty)); 109builder.Add(KeyValuePair.Create(AddAwaitAtCurrentPosition, string.Empty)); 134properties = properties.Add(KeyValuePair.Create(AppendConfigureAwait, string.Empty));
Completion\Providers\AbstractInternalsVisibleToCompletionProvider.cs (1)
160properties: [KeyValuePair.Create(ProjectGuidKey, projectGuid)]);
Completion\Providers\ImportCompletionProvider\ImportCompletionItem.cs (6)
50builder.Add(KeyValuePair.Create(MethodKey, extensionMethodData.Value.methodSymbolKey)); 51builder.Add(KeyValuePair.Create(ReceiverKey, extensionMethodData.Value.receiverTypeSymbolKey)); 55builder.Add(KeyValuePair.Create(OverloadCountKey, extensionMethodData.Value.overloadCount.ToString())); 62builder.Add(KeyValuePair.Create(TypeAritySuffixName, ArityUtilities.GetMetadataAritySuffix(arity))); 103builder.Add(KeyValuePair.Create(AttributeFullName, attributeItem.DisplayText)); 221ImmutableArray<KeyValuePair<string, string>> properties = [.. itemProperties, KeyValuePair.Create(AlwaysFullyQualifyKey, AlwaysFullyQualifyKey)];
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)
52builder.Add(KeyValuePair.Create(InsertionTextProperty, insertionText)); 54builder.Add(KeyValuePair.Create("ContextPosition", contextPosition.ToString())); 81=> properties.Add(KeyValuePair.Create("Symbols", EncodeSymbols(symbols))); 87properties.Add(KeyValuePair.Create("SymbolKind", SmallNumberFormatter.ToString((int)symbol.Kind))); 88properties.Add(KeyValuePair.Create("SymbolName", symbol.Name)); 91properties.Add(KeyValuePair.Create("IsGeneric", isGeneric.ToString())); 226properties.Add(KeyValuePair.Create("InvalidProjects", string.Join(";", supportedPlatforms.InvalidProjects.Select(id => id.Id)))); 227properties.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)
1745lazyKnownMatches.Add(KeyValuePair.Create(activeNode.OldNode, activeNode.NewTrackedNode));
EditAndContinue\CommittedSolution.cs (1)
434return documentIdArrays.SelectMany(ids => ids.WhereNotNull()).Select(id => KeyValuePair.Create(id, DocumentState.MatchesBuildOutput));
EditAndContinue\RunningProjectOptions.cs (1)
38return KeyValuePair.Create((filePath, targetFramework is { Length: > 0 } tfm ? tfm : null), 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.LanguageServer.Protocol (1)
Handler\Configuration\DidChangeConfigurationNotificationHandler.cs (1)
108optionsToUpdate.Add(KeyValuePair.Create(new OptionKey2(option, language: languageName), parsedValue));
Microsoft.CodeAnalysis.Rebuild.UnitTests (2)
DeterministicKeyBuilderTests.cs (2)
580(string, string) => ImmutableArray.Create(KeyValuePair.Create(pathMapFrom, pathMapTo)), 728(string, string) => ImmutableArray.Create(KeyValuePair.Create(pathMapFrom, pathMapTo)),
Microsoft.CodeAnalysis.Remote.ServiceHub (1)
Host\TestUtils.cs (1)
107items.Add(KeyValuePair.Create(checksum, await assetService.GetAssetAsync<object>(
Microsoft.CodeAnalysis.Test.Utilities (2)
TestHelpers.cs (2)
33=> ImmutableDictionary.CreateRange(comparer, entries.Select(t => KeyValuePair.Create(t.key, t.value))); 36=> ImmutableDictionary.CreateRange(entries.Select(t => KeyValuePair.Create(t.key, t.value)));
Microsoft.CodeAnalysis.UnitTests (28)
Analyzers\AnalyzerConfigTests.cs (24)
45new[] { KeyValuePair.Create("my_global_prop", "my_global_val"), 46KeyValuePair.Create("root", "true") }, 52new[] { KeyValuePair.Create("my_prop", "my_val") }, 79new[] { KeyValuePair.Create("build_metadata.compile.toretrieve", "abc123") }, 85new[] { KeyValuePair.Create("build_metadata.compile.toretrieve", "def456") }, 91new[] { KeyValuePair.Create("build_metadata.compile.toretrieve", "ghi789") }, 170new[] { KeyValuePair.Create("my_prop", "my_val") }, 184Assert.Equal(new[] { KeyValuePair.Create("my_prop", "my_val") }, properties); 206AnalyzerConfig.ReservedKeys.Select(k => KeyValuePair.Create("my_" + k, "MY_VAL")).ToList(), 218Assert.Equal(new[] { KeyValuePair.Create("my_prop", "my_other_val") }, properties); 229Assert.Equal(new[] { KeyValuePair.Create("my_prop", "my_other_val") }, properties); 241new[] { KeyValuePair.Create("my_prop", "my_val2") }, 254new[] { KeyValuePair.Create("my_prop1", ""), 255KeyValuePair.Create("my_prop2", "my_val") }, 268new[] { KeyValuePair.Create("my_prop2", "my val2") }, 280new[] { KeyValuePair.Create("my_prop2", "my val2") }, 304new[] { KeyValuePair.Create("my", "key1 = my_val"), 305KeyValuePair.Create("my_key2", "my:val")}, 318new[] { KeyValuePair.Create("my_key2", "my@val") }, 335new[] { KeyValuePair.Create("long", "this value continues") }, 355AnalyzerConfig.ReservedValues.Select(v => KeyValuePair.Create("my_key" + (index++), v)).ToList(), 365AnalyzerConfig.ReservedKeys.Select(k => KeyValuePair.Create(k, "my_val")).ToList(), 1245expected[i].Select(t => KeyValuePair.Create(t.key, t.value)), 1608Assert.Equal(KeyValuePair.Create("cs000", ReportDiagnostic.Warn), options[0].TreeOptions.Single());
Diagnostics\CompilationWithAnalyzersTests.cs (1)
41new[] { KeyValuePair.Create($"CS{(int)ErrorCode.WRN_AlwaysNull:D4}", ReportDiagnostic.Suppress) }));
SourceFileResolverTest.cs (3)
37ImmutableArray.Create(KeyValuePair.Create<string, string>("key", null))); 49ImmutableArray.Create(KeyValuePair.Create("key", ""))); 60[KeyValuePair.Create("key", "value")]);
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleHelpers.cs (2)
161KeyValuePair.Create("discard_variable", UnusedValuePreference.DiscardVariable), 162KeyValuePair.Create("unused_local_variable", UnusedValuePreference.UnusedLocalVariable),
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\EditorConfigValueSerializer.cs (1)
131.AddRange(alternativeEntries.Select(static p => KeyValuePair.Create(p.name, p.value)));
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\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)
1230var map = sortedNewProjectStates.Select(state => KeyValuePair.Create(
Workspace\Solution\TextDocumentStates.cs (1)
153States.AddRange(states.Select(state => KeyValuePair.Create(state.Id, state))),
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (5)
Remote\TestSerializerService.cs (1)
40.AddRange(s_wellKnownReferenceNames.Select(pair => KeyValuePair.Create(pair.Value!, pair.Key)));
TestAnalyzerReferenceByLanguage.cs (1)
54_analyzersMap.Select(kvp => KeyValuePair.Create(
Workspaces\TestWorkspace_XmlConsumption.cs (2)
287.Split(',').SelectAsArray(v => KeyValuePair.Create(v.Split('=').ElementAt(0), (object)v.Split('=').ElementAt(1)))); 305return KeyValuePair.Create(key, value);
Workspaces\TestWorkspace`1.cs (1)
137options.Select(static o => KeyValuePair.Create(o.name, o.value)).ToImmutableDictionary())))),
Microsoft.CodeAnalysis.Workspaces.UnitTests (17)
Differencing\MatchTests.cs (8)
25[KeyValuePair.Create(x1, x2), KeyValuePair.Create(x1, x2)]); 29Assert.Throws<ArgumentException>(() => TestTreeComparer.Instance.ComputeMatch(oldRoot, newRoot, [KeyValuePair.Create(x1, x1)])); 31Assert.Throws<ArgumentException>(() => TestTreeComparer.Instance.ComputeMatch(oldRoot, newRoot, [KeyValuePair.Create(x1, x2), KeyValuePair.Create(x1, new TestNode(0, 0))])); 49KeyValuePair.Create(x1, x2), 50KeyValuePair.Create(y1, x2), 75KeyValuePair.Create(x1, newRoot),
SolutionTests\TryApplyChangesTests.cs (3)
125project.ParseOptions!.WithFeatures([KeyValuePair.Create("Feature", "")])).Solution)); 140project.WithParseOptions(project.ParseOptions!.WithFeatures([KeyValuePair.Create("Feature", "ExpectedValue")])).Solution)); 155project.WithParseOptions(project.ParseOptions!.WithFeatures([KeyValuePair.Create("Feature", "WrongThing")])).Solution));
WorkspaceServiceTests\GlobalOptionServiceTests.cs (6)
40[KeyValuePair.Create(optionKey, (object?)2)]); 46[KeyValuePair.Create(optionKey, (object?)3)]); 124[KeyValuePair.Create(new OptionKey2(FormattingOptions2.NewLine, "lang"), (object?)"NEW_LINE")], 183KeyValuePair.Create(new OptionKey2(option1), (object?)5), 184KeyValuePair.Create(new OptionKey2(option2), (object?)6), 185KeyValuePair.Create(new OptionKey2(option3), (object?)3),
Microsoft.Extensions.Caching.Memory (2)
MemoryCache.cs (2)
787if (entry.Key is string s ? _stringEntries.TryRemove(KeyValuePair.Create(s, entry)) 788: _nonStringEntries.TryRemove(KeyValuePair.Create(entry.Key, entry)))
Microsoft.Extensions.ServiceDiscovery (2)
Http\HttpServiceEndpointResolver.cs (1)
62_resolvers.TryRemove(KeyValuePair.Create(resolver.ServiceName, resolver));
ServiceEndpointResolver.cs (1)
70_resolvers.TryRemove(KeyValuePair.Create(resolver.ServiceName, resolver));
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)
Microsoft.VisualStudio.LanguageServices.Implementation (1)
Options\AbstractOptionPage.cs (1)
111s_optionStore.GlobalOptions.SetGlobalOptions(changedOptions.SelectAsArray(entry => KeyValuePair.Create(entry.key, entry.newValue)));
Stress.AppHost (17)
InteractionCommands.cs (17)
113KeyValuePair.Create("pizza", "Pizza"), 114KeyValuePair.Create("fried-chicken", "Fried chicken"), 115KeyValuePair.Create("burger", "Burger"), 116KeyValuePair.Create("salmon", "Salmon"), 117KeyValuePair.Create("chicken-pie", "Chicken pie"), 118KeyValuePair.Create("sushi", "Sushi"), 119KeyValuePair.Create("tacos", "Tacos"), 120KeyValuePair.Create("pasta", "Pasta"), 121KeyValuePair.Create("salad", "Salad"), 122KeyValuePair.Create("steak", "Steak"), 123KeyValuePair.Create("vegetarian", "Vegetarian"), 124KeyValuePair.Create("sausage", "Sausage"), 125KeyValuePair.Create("lasagne", "Lasagne"), 126KeyValuePair.Create("fish-pie", "Fish pie"), 127KeyValuePair.Create("soup", "Soup"), 128KeyValuePair.Create("beef-stew", "Beef stew"), 129KeyValuePair.Create("welsh-pie", "Llanfair­pwllgwyngyll­gogery­chwyrn­drobwll­llan­tysilio­gogo­goch pie"),
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\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);
Test.Utilities (16)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleHelpers.cs (2)
161KeyValuePair.Create("discard_variable", UnusedValuePreference.DiscardVariable), 162KeyValuePair.Create("unused_local_variable", UnusedValuePreference.UnusedLocalVariable),
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\EditorConfigValueSerializer.cs (1)
131.AddRange(alternativeEntries.Select(static p => KeyValuePair.Create(p.name, p.value)));
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))))