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