122 references to Create
Aspire.Dashboard.Components.Tests (6)
Controls\StructuredLogDetailsTests.cs (6)
39KeyValuePair.Create("Message", "value1"), 40KeyValuePair.Create("Message", "value2"), 41KeyValuePair.Create("event.name", "value1"), 42KeyValuePair.Create("event.name", "value2") 48KeyValuePair.Create("Message", "value1"), 49KeyValuePair.Create("Message", "value2")
Aspire.Dashboard.Tests (58)
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));
ResourceOutgoingPeerResolverTests.cs (13)
46Assert.False(TryResolvePeerName(resources, [KeyValuePair.Create("peer.service", "")], out _)); 59Assert.False(TryResolvePeerName(resources, [KeyValuePair.Create<string, string>("peer.service", null!)], out _)); 72Assert.True(TryResolvePeerName(resources, [KeyValuePair.Create("peer.service", "localhost:5000")], out var value)); 86Assert.True(TryResolvePeerName(resources, [KeyValuePair.Create("peer.service", "127.0.0.1:5000")], out var value)); 100Assert.True(TryResolvePeerName(resources, [KeyValuePair.Create("peer.service", "127.0.0.1,5000")], out var value)); 114Assert.True(TryResolvePeerName(resources, [KeyValuePair.Create("server.address", "localhost"), KeyValuePair.Create("server.port", "5000")], out var value)); 173Assert.True(TryResolvePeerName(resources, [KeyValuePair.Create("server.address", "localhost"), KeyValuePair.Create("server.port", "5000")], out var value)); 188Assert.True(TryResolvePeerName(resources, [KeyValuePair.Create("server.address", "localhost"), KeyValuePair.Create("server.port", "5000")], out var value1)); 191Assert.True(TryResolvePeerName(resources, [KeyValuePair.Create("server.address", "localhost"), KeyValuePair.Create("server.port", "5001")], out var value2));
TelemetryRepositoryTests\LogTests.cs (2)
943LogRecords = { CreateLogRecord(time: s_testTime.AddMinutes(1), message: "message-1", attributes: [KeyValuePair.Create("key-1", "value-1")]) } 955LogRecords = { CreateLogRecord(time: s_testTime.AddMinutes(2), message: "message-2", attributes: [KeyValuePair.Create("key-2", "value-2")]) }
TelemetryRepositoryTests\MetricsTests.cs (24)
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")]),
TelemetryRepositoryTests\TraceTests.cs (10)
1078Spans = { CreateSpan(traceId: "1", spanId: "1-1", startTime: s_testTime.AddMinutes(1), endTime: s_testTime.AddMinutes(10), attributes: [KeyValuePair.Create("key-1", "value-1")]) } 1090Spans = { CreateSpan(traceId: "2", spanId: "2-1", startTime: s_testTime.AddMinutes(2), endTime: s_testTime.AddMinutes(10), attributes: [KeyValuePair.Create("key-2", "value-2")]) } 1153Spans = { CreateSpan(traceId: "1", spanId: "1-1", startTime: s_testTime.AddMinutes(1), endTime: s_testTime.AddMinutes(10), attributes: [KeyValuePair.Create("key1", "value1")]) } 1165Spans = { CreateSpan(traceId: "1", spanId: "1-2", startTime: s_testTime.AddMinutes(2), endTime: s_testTime.AddMinutes(10), parentSpanId: "1-1", attributes: [KeyValuePair.Create("key2", "value2")]) } 1253Spans = { CreateSpan(traceId: "1", spanId: "1-1", startTime: s_testTime.AddMinutes(1), endTime: s_testTime.AddMinutes(10), attributes: [KeyValuePair.Create("key1", "value1")]) } 1428Resource = CreateResource(attributes: [KeyValuePair.Create("prop1", "value1")]), 1443Resource = CreateResource(attributes: [KeyValuePair.Create("prop2", "value1"), KeyValuePair.Create("prop1", "value2")]), 1458Resource = CreateResource(attributes: [KeyValuePair.Create("prop1", "value2"), KeyValuePair.Create("prop2", "value1")]),
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)
874KeyValuePair.Create("Key1","value1"), 875KeyValuePair.Create("Key2","value2"), 876KeyValuePair.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.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)
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);