17 references to TryAdd
Aspire.Cli.Tests (5)
Projects\ProjectUpdaterTests.cs (5)
609
if (!root.
TryAdd
("Properties", properties))
624
if (!root.
TryAdd
("Items", items))
630
if (!items.
TryAdd
("PackageReference", packageReferences))
648
if (!root.
TryAdd
("Items", items))
654
if (!items.
TryAdd
("ProjectReference", projectReferences))
Aspire.Dashboard.Tests (1)
Model\ResourceStateViewModelTests.cs (1)
88
resource.Properties.
TryAdd
(KnownProperties.Resource.ExitCode, new ResourcePropertyViewModel(KnownProperties.Resource.ExitCode, Value.ForNumber((double)exitCode), false, null, 0));
Microsoft.AspNetCore.Components (3)
PersistentComponentState.cs (3)
118
if (!_currentState.
TryAdd
(key, JsonSerializer.SerializeToUtf8Bytes(instance, JsonSerializerOptionsProvider.Options)))
134
if (!_currentState.
TryAdd
(key, JsonSerializer.SerializeToUtf8Bytes(instance, type, JsonSerializerOptionsProvider.Options)))
154
if (!_currentState.
TryAdd
(key, data))
Microsoft.AspNetCore.OpenApi (1)
Services\OpenApiDocumentService.cs (1)
445
response.Content.
TryAdd
(contentType, new OpenApiMediaType());
Microsoft.AspNetCore.Routing (1)
Builder\EndpointRoutingApplicationBuilderExtensions.cs (1)
60
builder.Properties.
TryAdd
(UseRoutingKey, (object)UseRouting);
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (1)
Http3\QPackDecoderBenchmark.cs (1)
49
var success = headers.
TryAdd
(s, s);
System.Text.Json (4)
System\Text\Json\Serialization\Converters\Collection\IDictionaryOfTKeyTValueConverter.cs (1)
31
if (!collection.
TryAdd
(key, value))
System\Text\Json\Serialization\Converters\Object\ObjectWithParameterizedConstructorConverter.cs (2)
247
else if (!dict.
TryAdd
(dataExtKey, (JsonElement)propValue!))
260
else if (!objDict.
TryAdd
(dataExtKey, propValue!))
System\Text\Json\Serialization\Metadata\JsonPropertyInfo.cs (1)
904
if (!d.
TryAdd
(property, value))
System.Windows.Forms.Design (1)
System\Resources\Tools\StronglyTypedResourceBuilder.cs (1)
919
if (!cleanedResourceList.
TryAdd
(key, value))