299 references to KeyValuePair
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 (70)
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\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)
55trace.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 (13)
48Assert.False(TryResolvePeerName(resources, [KeyValuePair.Create("peer.service", "")], out _)); 61Assert.False(TryResolvePeerName(resources, [KeyValuePair.Create<string, string>("peer.service", null!)], out _)); 74Assert.True(TryResolvePeerName(resources, [KeyValuePair.Create("peer.service", "localhost:5000")], out var value)); 88Assert.True(TryResolvePeerName(resources, [KeyValuePair.Create("peer.service", "127.0.0.1:5000")], out var value)); 102Assert.True(TryResolvePeerName(resources, [KeyValuePair.Create("peer.service", "127.0.0.1,5000")], out var value)); 116Assert.True(TryResolvePeerName(resources, [KeyValuePair.Create("server.address", "localhost"), KeyValuePair.Create("server.port", "5000")], out var value)); 195Assert.True(TryResolvePeerName(resources, [KeyValuePair.Create("server.address", "localhost"), KeyValuePair.Create("server.port", "5000")], out var value)); 210Assert.True(TryResolvePeerName(resources, [KeyValuePair.Create("server.address", "localhost"), KeyValuePair.Create("server.port", "5000")], out var value1)); 213Assert.True(TryResolvePeerName(resources, [KeyValuePair.Create("server.address", "localhost"), KeyValuePair.Create("server.port", "5001")], out var value2));
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)
GenerateDocumentationAndConfigFiles (17)
src\Dependencies\Collections\KeyValuePair.cs (1)
16[assembly: TypeForwardedTo(typeof(KeyValuePair))]
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))))
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.Hosting (9)
Internal\HostingMetrics.cs (9)
122KeyValuePair.Create(HttpMethods.Connect, HttpMethods.Connect), 123KeyValuePair.Create(HttpMethods.Delete, HttpMethods.Delete), 124KeyValuePair.Create(HttpMethods.Get, HttpMethods.Get), 125KeyValuePair.Create(HttpMethods.Head, HttpMethods.Head), 126KeyValuePair.Create(HttpMethods.Options, HttpMethods.Options), 127KeyValuePair.Create(HttpMethods.Patch, HttpMethods.Patch), 128KeyValuePair.Create(HttpMethods.Post, HttpMethods.Post), 129KeyValuePair.Create(HttpMethods.Put, HttpMethods.Put), 130KeyValuePair.Create(HttpMethods.Trace, HttpMethods.Trace)
Microsoft.AspNetCore.Hosting.Tests (3)
HostingApplicationDiagnosticsTests.cs (3)
873KeyValuePair.Create("Key1","value1"), 874KeyValuePair.Create("Key2","value2"), 875KeyValuePair.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.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 (8)
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]));
src\Dependencies\Collections\KeyValuePair.cs (1)
16[assembly: TypeForwardedTo(typeof(KeyValuePair))]
Microsoft.CodeAnalysis.Collections.Package (1)
KeyValuePair.cs (1)
16[assembly: TypeForwardedTo(typeof(KeyValuePair))]
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)
79=> [KeyValuePair.Create(InsertionTextOnLessThan, symbol.Name.EscapeIdentifier())];
UseExpressionBody\UseExpressionBodyCodeRefactoringProvider.cs (2)
50yield return KeyValuePair.Create((helper, useExpressionBody: true), helper.GetType().Name + "_UseExpressionBody"); 51yield return KeyValuePair.Create((helper, useExpressionBody: false), helper.GetType().Name + "_UseBlockBody");
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (4)
Diagnostics\Suppression\SuppressionTests.cs (2)
760var specificDiagnosticOptions = new[] { KeyValuePair.Create(IDEDiagnosticIds.FormattingDiagnosticId, ReportDiagnostic.Warn) }; 1002var specificDiagnosticOptions = new[] { KeyValuePair.Create(IDEDiagnosticIds.FormattingDiagnosticId, ReportDiagnostic.Warn) };
EditAndContinue\CSharpEditAndContinueAnalyzerTests.cs (1)
317KeyValuePair.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.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.Features (38)
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)
47properties = properties.NullToEmpty().Add(KeyValuePair.Create(DescriptionProperty, EncodeDescription(description.ToTaggedText())));
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)
53builder.Add(KeyValuePair.Create(InsertionTextProperty, insertionText)); 55builder.Add(KeyValuePair.Create("ContextPosition", contextPosition.ToString())); 82=> properties.Add(KeyValuePair.Create("Symbols", EncodeSymbols(symbols))); 88properties.Add(KeyValuePair.Create("SymbolKind", SmallNumberFormatter.ToString((int)symbol.Kind))); 89properties.Add(KeyValuePair.Create("SymbolName", symbol.Name)); 92properties.Add(KeyValuePair.Create("IsGeneric", isGeneric.ToString())); 227properties.Add(KeyValuePair.Create("InvalidProjects", string.Join(";", supportedPlatforms.InvalidProjects.Select(id => id.Id)))); 228properties.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)
1626lazyKnownMatches.Add(KeyValuePair.Create(activeNode.OldNode, activeNode.NewTrackedNode));
EditAndContinue\CommittedSolution.cs (1)
437return documentIdArrays.SelectMany(ids => ids.WhereNotNull()).Select(id => KeyValuePair.Create(id, DocumentState.MatchesBuildOutput));
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.Workspaces (31)
CodeFixes\FixAllOccurrences\FixAllContext.DiagnosticProvider.cs (1)
82return ImmutableDictionary.CreateRange([KeyValuePair.Create(project, diagnostics)]);
CodeRefactorings\FixAllOccurences\FixAllState.cs (1)
103return spansByDocument.Select(kvp => KeyValuePair.Create(kvp.Key, new Optional<ImmutableArray<TextSpan>>(kvp.Value)))
Differencing\LongestCommonSubsequence.cs (1)
288yield return KeyValuePair.Create(xEnd, yEnd);
LanguageServices\FixAllSpanMappingService\AbstractFixAllSpanMappingService.cs (2)
41return ImmutableDictionary.CreateRange([KeyValuePair.Create(document, ImmutableArray.Create(decl.FullSpan))]); 67return ImmutableDictionary.CreateRange([KeyValuePair.Create(document, ImmutableArray.Create(decl.FullSpan))]);
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)
81var internallyDefined = _changedOptionKeys.Where(key => key.Option is IOption2).SelectAsArray(key => KeyValuePair.Create(new OptionKey2((IOption2)key.Option, key.Language), _values[key])); 82var externallyDefined = _changedOptionKeys.Where(key => key.Option is not IOption2).SelectAsArray(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\Dependencies\Collections\KeyValuePair.cs (1)
16[assembly: TypeForwardedTo(typeof(KeyValuePair))]
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))))
Workspace\Solution\SolutionState.cs (1)
1217var map = sortedNewProjectStates.Select(state => KeyValuePair.Create(
Workspace\Solution\TextDocumentStates.cs (1)
153States.AddRange(states.Select(state => KeyValuePair.Create(state.Id, state))),
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (1)
src\Dependencies\Collections\KeyValuePair.cs (1)
16[assembly: TypeForwardedTo(typeof(KeyValuePair))]
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\Phi3ForCasualLM.cs (2)
103KeyValuePair.Create(targetDevice, layersOnTargetDevice), 104KeyValuePair.Create("cpu", -1)
mscorlib (1)
mscorlib.cs (1)
56[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Collections.Generic.KeyValuePair))]
netstandard (1)
netstandard.cs (1)
124[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Collections.Generic.KeyValuePair))]
Stress.AppHost (16)
InteractionCommands.cs (16)
106KeyValuePair.Create("pizza", "Pizza"), 107KeyValuePair.Create("fried-chicken", "Fried chicken"), 108KeyValuePair.Create("burger", "Burger"), 109KeyValuePair.Create("salmon", "Salmon"), 110KeyValuePair.Create("chicken-pie", "Chicken pie"), 111KeyValuePair.Create("sushi", "Sushi"), 112KeyValuePair.Create("tacos", "Tacos"), 113KeyValuePair.Create("pasta", "Pasta"), 114KeyValuePair.Create("salad", "Salad"), 115KeyValuePair.Create("steak", "Steak"), 116KeyValuePair.Create("vegetarian", "Vegetarian"), 117KeyValuePair.Create("sausage", "Sausage"), 118KeyValuePair.Create("lasagne", "Lasagne"), 119KeyValuePair.Create("fish-pie", "Fish pie"), 120KeyValuePair.Create("soup", "Soup"), 121KeyValuePair.Create("beef-stew", "Beef stew"),
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 (10)
src\libraries\System.Private.CoreLib\src\System\Collections\DictionaryEntry.cs (1)
47KeyValuePair.PairToString(_key, _value);
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\KeyValuePair.cs (1)
47return KeyValuePair.PairToString(Key, Value);
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.Runtime (1)
artifacts\obj\System.Runtime\Debug\net10.0\System.Runtime.Forwards.cs (1)
92[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Collections.Generic.KeyValuePair))]
Test.Utilities (17)
src\Dependencies\Collections\KeyValuePair.cs (1)
16[assembly: TypeForwardedTo(typeof(KeyValuePair))]
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))))