61 references to TryAdd
illink (8)
Microsoft.AspNetCore.Components (1)
Rendering\RenderTreeBuilder.cs (1)
814if (!seenAttributeNames.TryAdd(frame.AttributeNameField, i))
Microsoft.AspNetCore.Components.WebView (1)
WebViewManager.cs (1)
92if (!_rootComponentsBySelector.TryAdd(selector, rootComponent))
Microsoft.AspNetCore.Http (2)
src\Shared\Dictionary\AdaptiveCapacityDictionary.cs (2)
469return _dictionaryStorage.TryAdd(key, value); 477return _dictionaryStorage!.TryAdd(key, value);
Microsoft.AspNetCore.Mvc.Core (2)
ApplicationModels\ApplicationModelFactory.cs (2)
139routeValues.TryAdd(kvp.Key, kvp.Value); 144routeValues.TryAdd(kvp.Key, kvp.Value);
Microsoft.AspNetCore.Mvc.Razor (1)
Compilation\DefaultViewCompiler.cs (1)
64compiledViews.TryAdd(compiledView.RelativePath, Task.FromResult(compiledView));
Microsoft.AspNetCore.Mvc.RazorPages (1)
Infrastructure\CompiledPageActionDescriptorProvider.cs (1)
63lookup.TryAdd(ViewPath.NormalizePath(viewDescriptor.RelativePath), viewDescriptor);
Microsoft.AspNetCore.Routing (1)
Patterns\RoutePatternFactory.cs (1)
1057if (!combinedDictionary.TryAdd(key, value) && !Equals(combinedDictionary[key], value))
Microsoft.AspNetCore.Shared.Tests (2)
src\Shared\Dictionary\AdaptiveCapacityDictionary.cs (2)
469return _dictionaryStorage.TryAdd(key, value); 477return _dictionaryStorage!.TryAdd(key, value);
PresentationCore (1)
MS\Internal\FontCache\FamilyCollection.cs (1)
499faces.TryAdd(name.Value, font);
System.ComponentModel.TypeConverter (4)
System\ComponentModel\ReflectTypeDescriptionProvider.ReflectedTypeData.cs (2)
453eventList.TryAdd(ed.Name, ed); 488propertyList.TryAdd(p.Name, p);
System\ComponentModel\TypeDescriptor.cs (2)
359s_defaultProviderInitialized.TryAdd(type, null); 1687s_providerTypeTable.TryAdd(searchType, node);
System.Data.Common (1)
System\Data\Common\AdapterUtil.Common.cs (1)
831if (hash.TryAdd(lowerName, index))
System.Formats.Tar (1)
System\Formats\Tar\TarHeader.Read.cs (1)
626if (!ExtendedAttributes.TryAdd(key, value))
System.IO.Compression (1)
System\IO\Compression\ZipArchive.cs (1)
432_entriesDictionary.TryAdd(entry.FullName, entry);
System.Linq.Expressions (3)
System\Linq\Expressions\Compiler\BoundConstants.cs (1)
85if (_indexes.TryAdd(value, _values.Count))
System\Linq\Expressions\Interpreter\LightCompiler.cs (2)
1656caseDict.TryAdd(key, caseOffset); 1709caseDict.TryAdd(key, caseOffset);
System.Net.Http (1)
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.Http3.cs (1)
387added = altSvcBlocklist.TryAdd(badAuthority, exception);
System.Net.NetworkInformation (2)
System\Net\NetworkInformation\NetworkAddressChange.Unix.cs (2)
62s_addressChangedSubscribers.TryAdd(value, ExecutionContext.Capture()); 113s_availabilityChangedSubscribers.TryAdd(value, ExecutionContext.Capture());
System.Net.Security (2)
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.SslCtx.cs (2)
191if (!_sslSessions.TryAdd(targetName, session)) 195bool added = _sslSessions.TryAdd(targetName, session);
System.Private.DataContractSerialization (4)
System\Runtime\Serialization\DataContract.cs (1)
2030knownDataContracts.TryAdd(itemDataContract.XmlName, itemDataContract);
System\Runtime\Serialization\HybridObjectCache.cs (1)
37_referencedObjectDictionary.TryAdd(id, null);
System\Runtime\Serialization\Json\JsonDataContract.cs (2)
293_knownDataContracts.TryAdd(itemContract.XmlName, itemContract); 299_knownDataContracts.TryAdd(itemDataContract.XmlName, itemDataContract);
System.Private.Xml (11)
System\Xml\Schema\ContentValidator.cs (1)
2128if (_elements.TryAdd(name, i))
System\Xml\Schema\DtdParser.cs (2)
1232_schemaInfo.ParameterEntities.TryAdd(entityName, entity); 1236_schemaInfo.GeneralEntities.TryAdd(entityName, entity);
System\Xml\Schema\DtdParserAsync.cs (2)
863_schemaInfo.ParameterEntities.TryAdd(entityName, entity); 867_schemaInfo.GeneralEntities.TryAdd(entityName, entity);
System\Xml\Schema\SchemaCollectionCompiler.cs (1)
308schemaInfo.Notations.TryAdd(no.Name.Name, no);
System\Xml\Schema\SchemaInfo.cs (3)
302_targetNamespaces.TryAdd(tns, true); 321_attributeDecls.TryAdd(attdef.Name, attdef); 325Notations.TryAdd(notation.Name.Name, notation);
System\Xml\Schema\SchemaSetCompiler.cs (1)
170schemaInfo.Notations.TryAdd(no.Name.Name, no);
System\Xml\Schema\XdrBuilder.cs (1)
1054if (!builder._SchemaInfo.AttributeDecls.TryAdd(qname, builder._AttributeDef._AttDef))
System.Resources.Extensions (2)
src\libraries\System.Runtime.Serialization.BinaryFormat\src\System\Runtime\Serialization\BinaryFormat\ClassInfo.cs (1)
61if (memberNames.TryAdd(memberName, i))
src\libraries\System.Runtime.Serialization.BinaryFormat\src\System\Runtime\Serialization\BinaryFormat\RecordMap.cs (1)
48if (_map.TryAdd(record.ObjectId, record))
System.Runtime.Serialization.BinaryFormat (2)
System\Runtime\Serialization\BinaryFormat\ClassInfo.cs (1)
61if (memberNames.TryAdd(memberName, i))
System\Runtime\Serialization\BinaryFormat\RecordMap.cs (1)
48if (_map.TryAdd(record.ObjectId, record))
System.Runtime.Serialization.Formatters (1)
System\Runtime\Serialization\SerializationObjectManager.cs (1)
34if (_objectSeenTable.TryAdd(obj, true))
System.Text.Json (5)
System\Text\Json\JsonPropertyDictionary.cs (2)
232if (_propertyDictionary.TryAdd(propertyName, value)) 306if (!_propertyDictionary.TryAdd(propertyName, value))
System\Text\Json\Serialization\Metadata\JsonTypeInfo.cs (1)
1161parameterIndex.TryAdd(paramKey, parameterInfoValue); // Ignore conflicts since they are reported at serialization time.
System\Text\Json\Serialization\Metadata\PolymorphicTypeResolver.cs (1)
54if (!(_discriminatorIdtoType ??= new()).TryAdd(typeDiscriminator, derivedJsonTypeInfo))
System\Text\Json\Serialization\PreserveReferenceResolver.cs (1)
35if (!_referenceIdToObjectMap.TryAdd(referenceId, value))
System.Xaml (1)
System\Xaml\Schema\XamlTypeInvoker.cs (1)
178addMethods.TryAdd(type, addMethod);