73 implementations of TryGetValue
Microsoft.AspNetCore.Components (1)
src\Http\Http.Abstractions\src\Routing\RouteValueDictionary.cs (1)
603public bool TryGetValue(string key, out object? value)
Microsoft.AspNetCore.Components.Endpoints (1)
Rendering\EndpointHtmlRenderer.cs (1)
261public bool TryGetValue(string key, [MaybeNullWhen(false)] out StringValues value)
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (1)
src\Shared\EmptyCollections\EmptyReadonlyDictionary.cs (1)
39public bool TryGetValue(TKey key, out TValue value)
Microsoft.AspNetCore.Http (1)
src\Shared\Dictionary\AdaptiveCapacityDictionary.cs (1)
481public bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
Microsoft.AspNetCore.Http.Abstractions (1)
Routing\RouteValueDictionary.cs (1)
603public bool TryGetValue(string key, out object? value)
Microsoft.AspNetCore.Mvc.Abstractions (2)
ModelBinding\ModelStateDictionary.cs (1)
731public bool TryGetValue(string key, [NotNullWhen(true)] out ModelStateEntry? value)
ModelBinding\Validation\ValidationStateDictionary.cs (1)
129public bool TryGetValue(object key, [MaybeNullWhen(false)] out ValidationStateEntry value)
Microsoft.AspNetCore.Mvc.ViewFeatures (1)
AttributeDictionary.cs (1)
292public bool TryGetValue(string key, out string? value)
Microsoft.AspNetCore.Shared.Tests (1)
src\Shared\Dictionary\AdaptiveCapacityDictionary.cs (1)
481public bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
Microsoft.Build (3)
BackEnd\BuildManager\GlobalPropertiesLookup.cs (1)
45public bool TryGetValue(string key, out string? value)
Collections\ArrayDictionary.cs (1)
182public bool TryGetValue(TKey key, out TValue value)
ReadOnlyEmptyDictionary.cs (1)
208public bool TryGetValue(K key, out V value)
Microsoft.Build.Framework (3)
ImmutableSegmentedDictionary`2.cs (1)
273public bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
ImmutableSegmentedDictionary`2+Builder.cs (1)
211public bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
SegmentedDictionary`2.cs (1)
823public bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
Microsoft.Build.Tasks.Core (1)
ReadOnlyEmptyDictionary.cs (1)
208public bool TryGetValue(K key, out V value)
Microsoft.Build.Utilities.Core (1)
ReadOnlyEmptyDictionary.cs (1)
208public bool TryGetValue(K key, out V value)
Microsoft.CodeAnalysis (5)
InternalUtilities\SpecializedCollections.Empty.Dictionary.cs (1)
55public bool TryGetValue(TKey key, [MaybeNullWhen(returnValue: false)] out TValue value)
src\Dependencies\Collections\ImmutableSegmentedDictionary`2.cs (1)
261public bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+Builder.cs (1)
116public bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+ValueBuilder.cs (1)
223public readonly bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
src\Dependencies\Collections\SegmentedDictionary`2.cs (1)
851public bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
Microsoft.CodeAnalysis.CodeStyle (5)
src\Compilers\Core\Portable\InternalUtilities\SpecializedCollections.Empty.Dictionary.cs (1)
55public bool TryGetValue(TKey key, [MaybeNullWhen(returnValue: false)] out TValue value)
src\Dependencies\Collections\ImmutableSegmentedDictionary`2.cs (1)
261public bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+Builder.cs (1)
116public bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+ValueBuilder.cs (1)
223public readonly bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
src\Dependencies\Collections\SegmentedDictionary`2.cs (1)
851public bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
Microsoft.CodeAnalysis.Collections.Package (4)
ImmutableSegmentedDictionary`2.cs (1)
261public bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
ImmutableSegmentedDictionary`2+Builder.cs (1)
116public bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
ImmutableSegmentedDictionary`2+ValueBuilder.cs (1)
223public readonly bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
SegmentedDictionary`2.cs (1)
851public bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
Microsoft.CodeAnalysis.Workspaces (5)
src\Compilers\Core\Portable\InternalUtilities\SpecializedCollections.Empty.Dictionary.cs (1)
55public bool TryGetValue(TKey key, [MaybeNullWhen(returnValue: false)] out TValue value)
src\Dependencies\Collections\ImmutableSegmentedDictionary`2.cs (1)
261public bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+Builder.cs (1)
116public bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+ValueBuilder.cs (1)
223public readonly bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
src\Dependencies\Collections\SegmentedDictionary`2.cs (1)
851public bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (5)
src\Compilers\Core\Portable\InternalUtilities\SpecializedCollections.Empty.Dictionary.cs (1)
55public bool TryGetValue(TKey key, [MaybeNullWhen(returnValue: false)] out TValue value)
src\Dependencies\Collections\ImmutableSegmentedDictionary`2.cs (1)
261public bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+Builder.cs (1)
116public bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+ValueBuilder.cs (1)
223public readonly bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
src\Dependencies\Collections\SegmentedDictionary`2.cs (1)
851public bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
Microsoft.Extensions.AI (1)
src\Shared\EmptyCollections\EmptyReadonlyDictionary.cs (1)
39public bool TryGetValue(TKey key, out TValue value)
Microsoft.Extensions.AI.Abstractions (2)
AdditionalPropertiesDictionary{TValue}.cs (1)
202bool IReadOnlyDictionary<string, TValue>.TryGetValue(string key, out TValue value) => _dictionary.TryGetValue(key, out value!);
src\Shared\EmptyCollections\EmptyReadonlyDictionary.cs (1)
39public bool TryGetValue(TKey key, out TValue value)
Microsoft.Extensions.AI.Abstractions.Tests (1)
test\Shared\JsonSchemaExporter\TestTypes.cs (1)
1110public bool TryGetValue(string key, out int value) => key == nameof(BaseValue) ? (value = BaseValue) == BaseValue : (value = 0) == 0;
Microsoft.Extensions.AI.AzureAIInference (1)
src\Shared\EmptyCollections\EmptyReadonlyDictionary.cs (1)
39public bool TryGetValue(TKey key, out TValue value)
Microsoft.Extensions.AI.Ollama (1)
src\Shared\EmptyCollections\EmptyReadonlyDictionary.cs (1)
39public bool TryGetValue(TKey key, out TValue value)
Microsoft.Extensions.AI.OpenAI (1)
src\Shared\EmptyCollections\EmptyReadonlyDictionary.cs (1)
39public bool TryGetValue(TKey key, out TValue value)
Microsoft.Extensions.Http.Diagnostics (1)
src\Shared\EmptyCollections\EmptyReadonlyDictionary.cs (1)
39public bool TryGetValue(TKey key, out TValue value)
Microsoft.Gen.ComplianceReports.Unit.Tests (1)
src\Shared\EmptyCollections\EmptyReadonlyDictionary.cs (1)
39public bool TryGetValue(TKey key, out TValue value)
Microsoft.Gen.ContextualOptions.Unit.Tests (1)
src\Shared\EmptyCollections\EmptyReadonlyDictionary.cs (1)
39public bool TryGetValue(TKey key, out TValue value)
Microsoft.Gen.Logging.Unit.Tests (1)
src\Shared\EmptyCollections\EmptyReadonlyDictionary.cs (1)
39public bool TryGetValue(TKey key, out TValue value)
Microsoft.Gen.MetadataExtractor.Unit.Tests (1)
src\Shared\EmptyCollections\EmptyReadonlyDictionary.cs (1)
39public bool TryGetValue(TKey key, out TValue value)
Microsoft.Gen.Metrics.Unit.Tests (1)
src\Shared\EmptyCollections\EmptyReadonlyDictionary.cs (1)
39public bool TryGetValue(TKey key, out TValue value)
Microsoft.Gen.MetricsReports.Unit.Tests (1)
src\Shared\EmptyCollections\EmptyReadonlyDictionary.cs (1)
39public bool TryGetValue(TKey key, out TValue value)
Microsoft.Maui.Controls (1)
DragAndDrop\DataPackagePropertySetView.cs (1)
38 public bool TryGetValue(string key, out object value) => _dataPackagePropertySet.TryGetValue(key, out value);
MSBuild (1)
ReadOnlyEmptyDictionary.cs (1)
208public bool TryGetValue(K key, out V value)
Shared (1)
EmptyCollections\EmptyReadonlyDictionary.cs (1)
39public bool TryGetValue(TKey key, out TValue value)
Shared.Tests (1)
JsonSchemaExporter\TestTypes.cs (1)
1110public bool TryGetValue(string key, out int value) => key == nameof(BaseValue) ? (value = BaseValue) == BaseValue : (value = 0) == 0;
System.Collections (3)
System\Collections\Generic\OrderedDictionary.cs (1)
914public bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value) => TryGetValue(key, out value, out _);
System\Collections\Generic\SortedDictionary.cs (1)
257public bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
System\Collections\Generic\SortedList.cs (1)
671public bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
System.Collections.Immutable (4)
System\Collections\Immutable\ImmutableDictionary_2.Builder.cs (1)
591public bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
System\Collections\Immutable\ImmutableDictionary_2.cs (1)
407public bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
System\Collections\Immutable\ImmutableSortedDictionary_2.Builder.cs (1)
466public bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
System\Collections\Immutable\ImmutableSortedDictionary_2.cs (1)
448public bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
System.Formats.Nrbf (1)
System\Formats\Nrbf\RecordMap.cs (1)
26public bool TryGetValue(SerializationRecordId key, [MaybeNullWhen(false)] out SerializationRecord value) => _map.TryGetValue(key, out value);
System.Net.Http (2)
System\Net\Http\Headers\HttpHeadersNonValidated.cs (1)
81bool IReadOnlyDictionary<string, HeaderStringValues>.TryGetValue(string key, out HeaderStringValues value) => TryGetValues(key, out value);
System\Net\Http\HttpRequestOptions.cs (1)
18bool IReadOnlyDictionary<string, object?>.TryGetValue(string key, out object? value) => Options.TryGetValue(key, out value);
System.Net.WebSockets.Client (1)
System\Net\WebSockets\HttpResponseHeadersReadOnlyCollection.cs (1)
53public bool TryGetValue(string key, [MaybeNullWhen(false)] out IEnumerable<string> value)
System.Private.CoreLib (1)
src\libraries\System.Private.CoreLib\src\System\Collections\ObjectModel\ReadOnlyDictionary.cs (1)
46public bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
System.Security.Cryptography.Cose (1)
System\Security\Cryptography\Cose\CoseHeaderMap.cs (1)
185public bool TryGetValue(CoseHeaderLabel key, out CoseHeaderValue value) => _headerParameters.TryGetValue(key, out value);
System.Text.RegularExpressions (1)
System\Text\RegularExpressions\GroupCollection.cs (1)
197public bool TryGetValue(string key, [NotNullWhen(true)] out Group? value)
182 references to TryGetValue
Aspire.Hosting.Dapr (1)
DaprDistributedApplicationLifecycleHook.cs (1)
95else if (onDemandResourcesPaths.TryGetValue(componentReferenceAnnotation.Component.Name, out var onDemandResourcesPath))
CustomCheck (1)
Check1.cs (1)
33customData.TryGetValue("setmessage", out string? setMessage))
InMemory.FunctionalTests (2)
ConnectionLimitTests.cs (1)
158m.Tags.TryGetValue(KestrelMetrics.ErrorTypeAttributeName, out var value);
src\Servers\Kestrel\shared\test\MetricsAssert.cs (1)
24if (tags.TryGetValue(KestrelMetrics.ErrorTypeAttributeName, out var error))
Microsoft.AspNetCore.Components (1)
src\Http\Routing\src\Template\RoutePrecedence.cs (1)
266if (routePattern.RequiredValues.TryGetValue(parameterPart.Name, out var requiredValue) &&
Microsoft.AspNetCore.Components.Endpoints (4)
FormMapping\FormDataReader.cs (3)
115if (_formDictionaryKeysByPrefix.TryGetValue(new FormKey(_currentPrefixBuffer), out var foundKeys)) 246var foundSingleValue = _readOnlyMemoryKeys.TryGetValue(new FormKey(_currentPrefixBuffer), out var result) || result.Count == 1; 260_readOnlyMemoryKeys.TryGetValue(new FormKey(_currentPrefixBuffer), out values);
FormMapping\Metadata\FormDataMetadataFactory.cs (1)
96if (WellKnownConverters.Converters.TryGetValue(type, out var converter))
Microsoft.AspNetCore.Components.QuickGrid (1)
src\Components\Shared\src\AttributeUtilities.cs (1)
12if (additionalAttributes is null || !additionalAttributes.TryGetValue("class", out var @class))
Microsoft.AspNetCore.Components.Web (4)
Forms\InputBase.cs (1)
203if (AdditionalAttributes?.TryGetValue("name", out var nameAttributeValue) ?? false)
Routing\NavLink.cs (2)
67if (AdditionalAttributes != null && AdditionalAttributes.TryGetValue("href", out var obj)) 76if (AdditionalAttributes != null && AdditionalAttributes.TryGetValue("class", out obj))
src\Components\Shared\src\AttributeUtilities.cs (1)
12if (additionalAttributes is null || !additionalAttributes.TryGetValue("class", out var @class))
Microsoft.AspNetCore.Grpc.JsonTranscoding (1)
src\Grpc\JsonTranscoding\src\Shared\Server\MethodOptions.cs (1)
93if (!CompressionProviders.TryGetValue(ResponseCompressionAlgorithm, out var _))
Microsoft.AspNetCore.Http.Extensions (4)
src\Components\Endpoints\src\FormMapping\FormDataReader.cs (3)
115if (_formDictionaryKeysByPrefix.TryGetValue(new FormKey(_currentPrefixBuffer), out var foundKeys)) 246var foundSingleValue = _readOnlyMemoryKeys.TryGetValue(new FormKey(_currentPrefixBuffer), out var result) || result.Count == 1; 260_readOnlyMemoryKeys.TryGetValue(new FormKey(_currentPrefixBuffer), out values);
src\Components\Endpoints\src\FormMapping\Metadata\FormDataMetadataFactory.cs (1)
96if (WellKnownConverters.Converters.TryGetValue(type, out var converter))
Microsoft.AspNetCore.Mvc.ApiExplorer (1)
EndpointMetadataApiDescriptionProvider.cs (1)
228if (pattern.ParameterPolicies.TryGetValue(parameter.Name, out var parameterPolicyReferences))
Microsoft.AspNetCore.Mvc.Core (2)
Infrastructure\ConfigureCompatibilityOptions.cs (1)
79if (!defaultValues.TryGetValue(@switch.Name, out var value))
Routing\ActionEndpointFactory.cs (1)
197else if (route.Pattern.Defaults.TryGetValue(key, out var value))
Microsoft.AspNetCore.Mvc.Core.Test (1)
Routing\ActionEndpointFactoryTest.cs (1)
487var isPresent = fullSet.TryGetValue(subsetPair.Key, out var fullSetPairValue);
Microsoft.AspNetCore.Mvc.Razor (1)
ViewLocationCacheKey.cs (1)
110if (!y.ViewLocationExpanderValues.TryGetValue(item.Key, out var yValue) ||
Microsoft.AspNetCore.Routing (12)
Matching\DfaMatcherBuilder.cs (4)
325if (endpoint.RoutePattern.ParameterPolicies.TryGetValue(parameterPart.Name, out var parameterPolicyReferences)) 400if (endpoint.RoutePattern.ParameterPolicies.TryGetValue(partParameter.Name, out var parameterPolicyReferences)) 475if (endpoint.RoutePattern.ParameterPolicies.TryGetValue(parameterPart.Name, out var parameterPolicyReferences)) 982if (!routePattern.RequiredValues.TryGetValue(parameterPart.Name, out value))
Patterns\DefaultRoutePatternTransformer.cs (5)
65else if (original.Defaults.TryGetValue(kvp.Key, out var defaultValue) && 84original.Defaults.TryGetValue(kvp.Key, out var defaultValue) && 115else if (original.Defaults.TryGetValue(kvp.Key, out var defaultValue) && 168original.Defaults.TryGetValue(kvp.Key, out var defaultValue) && 199if (pattern.ParameterPolicies.TryGetValue(key, out var policies))
Template\RoutePrecedence.cs (1)
266if (routePattern.RequiredValues.TryGetValue(parameterPart.Name, out var requiredValue) &&
Template\TemplateBinder.cs (2)
222if (!_pattern.RequiredValues.TryGetValue(key, out var requiredValue)) 311if (!copyAmbientValues && !hasExplicitValue && _pattern.RequiredValues.TryGetValue(key, out var requiredValue))
Microsoft.AspNetCore.Server.HttpSys (1)
src\Shared\HttpSys\RequestProcessing\NativeRequestContext.cs (1)
100if (!RequestInfo.TryGetValue((int)HTTP_REQUEST_INFO_TYPE.HttpRequestInfoTypeRequestTiming, out var timingInfo))
Microsoft.AspNetCore.Server.IIS (1)
src\Shared\HttpSys\RequestProcessing\NativeRequestContext.cs (1)
100if (!RequestInfo.TryGetValue((int)HTTP_REQUEST_INFO_TYPE.HttpRequestInfoTypeRequestTiming, out var timingInfo))
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (1)
src\Servers\Kestrel\shared\test\MetricsAssert.cs (1)
24if (tags.TryGetValue(KestrelMetrics.ErrorTypeAttributeName, out var error))
Microsoft.AspNetCore.Shared.Tests (1)
src\Shared\HttpSys\RequestProcessing\NativeRequestContext.cs (1)
100if (!RequestInfo.TryGetValue((int)HTTP_REQUEST_INFO_TYPE.HttpRequestInfoTypeRequestTiming, out var timingInfo))
Microsoft.Build (37)
BuildCheck\Checks\CopyAlwaysCheck.cs (1)
53context.Data.EvaluatedProperties.TryGetValue("SkipUnchangedFilesOnCopyAlways", out string? skipUnchanged);
BuildCheck\Checks\NoEnvironmentVariablePropertyCheck.cs (1)
77&& (customConfigurationData.ConfigurationData?.TryGetValue(VerboseEnvVariableOutputKey, out string? configVal) ?? false)
BuildCheck\Checks\PreferProjectReferenceCheck.cs (1)
57context.Data.EvaluatedProperties.TryGetValue(ItemMetadataNames.targetPath, out targetPath);
BuildCheck\Checks\PropertiesUsageCheck.cs (1)
96(customConfigurationData.ConfigurationData?.TryGetValue(_allowUninitPropsInConditionsKey, out string? configVal) ?? false))
BuildCheck\Checks\SharedOutputPathCheck.cs (2)
50context.Data.EvaluatedProperties.TryGetValue("OutputPath", out binPath); 51context.Data.EvaluatedProperties.TryGetValue("IntermediateOutputPath", out objPath);
BuildCheck\Checks\TargetFrameworkConfusionCheck.cs (2)
48if (context.Data.EvaluatedProperties.TryGetValue(PropertyNames.TargetFrameworks, out frameworks) && 49context.Data.EvaluatedProperties.TryGetValue(PropertyNames.TargetFramework, out framework) &&
BuildCheck\Checks\TargetFrameworkUnexpectedCheck.cs (4)
54if ((context.Data.EvaluatedProperties.TryGetValue(PropertyNames.TargetFrameworks, out frameworks) || 55context.Data.EvaluatedProperties.TryGetValue(PropertyNames.TargetFramework, out framework)) && 66=> evaluatedProperties.TryGetValue(PropertyNames.UsingMicrosoftNETSdk, out string? usingSdkStr) && 70=> evaluatedProperties.TryGetValue("CLRSupport", out string? clrSupportStr) &&
BuildCheck\Infrastructure\BuildCheckBuildEventHandler.cs (1)
65eventArgs.GlobalProperties.TryGetValue(MSBuildConstants.MSBuildIsRestoring, out string? restoreProperty);
BuildCheck\Infrastructure\CustomConfigurationData.cs (1)
76if (!ConfigurationData.TryGetValue(keyVal.Key, out var value) || value != keyVal.Value)
CollectionHelpers.cs (1)
67if (!b.TryGetValue(aKvp.Key, out var bValue))
Construction\Solution\ProjectInSolution.cs (4)
413if (!ParentSolution.ProjectsByGuid.TryGetValue(ParentProjectGuid, out proj) && 414!ParentSolution.SolutionFoldersByGuid.TryGetValue(ParentProjectGuid, out solutionFolder)) 455if (!ParentSolution.ProjectsByGuid.TryGetValue(ParentProjectGuid, out proj) && 456!ParentSolution.SolutionFoldersByGuid.TryGetValue(ParentProjectGuid, out solutionFolder))
Construction\Solution\SolutionProjectGenerator.cs (9)
273if (project.ProjectConfigurations.TryGetValue(solutionConfiguration.FullName, out ProjectConfigurationInSolution projectConfiguration)) 284if (!solutionFile.ProjectsByGuid.TryGetValue(dependencyProjectGuid, out ProjectInSolution dependencyProject)) 295if (dependencyProject.ProjectConfigurations.TryGetValue(solutionConfiguration.FullName, out ProjectConfigurationInSolution dependencyProjectConfiguration) && 795project.ProjectConfigurations.TryGetValue(selectedSolutionConfiguration, out ProjectConfigurationInSolution projectConfiguration); 1154if (!_solutionFile.ProjectsByGuid.TryGetValue(dependencyProjectGuid, out ProjectInSolution dependencyProject)) 1310if (!_solutionFile.ProjectsByGuid.TryGetValue(dependencyProjectGuid, out ProjectInSolution dependencyProject)) 1321if (dependencyProject.ProjectConfigurations.TryGetValue(_selectedSolutionConfiguration, out ProjectConfigurationInSolution dependencyProjectConfiguration) && 1858if (project.ProjectConfigurations.TryGetValue(solutionConfiguration.FullName, out ProjectConfigurationInSolution projectConfiguration)) 1932if (project.ProjectConfigurations.TryGetValue(solutionConfiguration.FullName, out ProjectConfigurationInSolution projectConfiguration))
Definition\Project.cs (1)
2644if (removeElementCache.TryGetValue(itemElement.ItemType, out CumulativeRemoveElementData removeItemElement))
Evaluation\ItemSpec.cs (1)
351if (itemsByNormalizedValue.TryGetValue(key, out var multiValue))
Evaluation\LazyItemEvaluator.EvaluatorData.cs (1)
51return _itemsByType.TryGetValue(itemType, out LazyItemList items)
Evaluation\Profiler\EvaluationProfiler.cs (1)
144if (!_evaluationProfiler.ProfiledResult.Value.ProfiledLocations.TryGetValue(Location, out var previousTimeSpent))
FrameworkLocationHelper.cs (2)
1119ErrorUtilities.VerifyThrowArgument(VisualStudioSpecDict.Value.TryGetValue(version, out VisualStudioSpec spec), "FrameworkLocationHelper.UnsupportedVisualStudioVersion", version); 1125ErrorUtilities.VerifyThrowArgument(DotNetFrameworkSpecDict.Value.TryGetValue(version, out DotNetFrameworkSpec spec), "FrameworkLocationHelper.UnsupportedFrameworkVersion", version);
Graph\GraphBuilder.cs (2)
346if (!Solution.ProjectsByGuid.TryGetValue(dependencyProjectGuid, out ProjectInSolution dependencyProject)) 397if (projectConfigs.TryGetValue(solutionConfigFullName, out ProjectConfigurationInSolution projectConfiguration))
Instance\TaskFactoryWrapper.cs (1)
179if (!_propertyData.Value.PropertyInfoCache.TryGetValue(propertyName, out propertyInfo))
Microsoft.Build.BuildCheck.UnitTests (1)
TestAssets\CustomCheck\Check1.cs (1)
33customData.TryGetValue("setmessage", out string? setMessage))
Microsoft.Build.Engine.OM.UnitTests (1)
ObjectModelRemoting\Helpers\TestCollectionGroup.cs (1)
246this.ImmutableProjects?.TryGetValue(linker, out toKeep);
Microsoft.Build.Tasks.Core (1)
WriteCodeFragment.cs (1)
206if (!parameterTypes.TryGetValue(name, out ParameterType type))
Microsoft.Build.Utilities.Core (2)
FrameworkLocationHelper.cs (2)
1119ErrorUtilities.VerifyThrowArgument(VisualStudioSpecDict.Value.TryGetValue(version, out VisualStudioSpec spec), "FrameworkLocationHelper.UnsupportedVisualStudioVersion", version); 1125ErrorUtilities.VerifyThrowArgument(DotNetFrameworkSpecDict.Value.TryGetValue(version, out DotNetFrameworkSpec spec), "FrameworkLocationHelper.UnsupportedFrameworkVersion", version);
Microsoft.CodeAnalysis (15)
Compilation\Compilation.cs (1)
3512return _features.TryGetValue(p, out v) ? v : null;
Emit\EditAndContinue\DefinitionMap.cs (2)
38=> ClosureTree.TryGetValue(closureId, out var node) ? node : default; 599? (synthesizedMemberMap.TryGetValue(displayClass, out var m) ? m : [])
Emit\EditAndContinue\DeltaMetadataWriter.cs (4)
524(changes.DeletedMembers.TryGetValue(typeSymbol, out var deletedMembers) | 525changes.UpdatedMethods.TryGetValue(typeSymbol, out var updatedMethods))) 657if (_deletedMethodDefs.TryGetValue(typeDef, out var newMethodDefs)) 1906if (_deletedTypeMembers.TryGetValue(typeDefinition, out var deletedMembers))
Emit\EditAndContinue\EncVariableSlotAllocator.cs (6)
174if (!_previousLocalSlots.TryGetValue(localKey, out int slot)) 226return _hoistedLocalSlots.TryGetValue(localKey, out slotIndex); 244return _awaiterMap.TryGetValue(typeRef, out slotIndex); 311if (_closureMap.TryGetValue(syntaxOffset, out var closureMapValue) && 337if (_lambdaMap.TryGetValue(syntaxOffset, out var lambdaMapValue) && lambdaMapValue.IsCompatibleWith(closureOrdinal, structClosureIds)) 365_stateMachineStateMap.TryGetValue((syntaxOffset, awaitId), out state))
Emit\EditAndContinue\SymbolChanges.cs (1)
242if (_changes.TryGetValue(symbol, out var change))
Emit\EditAndContinue\SymbolMatcher.cs (1)
190if (!newMembers.TryGetValue(mappedContainer, out var newSynthesizedMembers))
Microsoft.CodeAnalysis.CodeStyle (5)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser.cs (2)
112var value = entries.TryGetValue(key, out var str) ? parser(str) : defaultValue; 122=> lines.TryGetValue(Key, out var line) ? line.Span : null;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser_NamingStyle.cs (1)
89if (!entries.TryGetValue(key, out var name))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser_SymbolSpec.cs (1)
85if (!entries.TryGetValue(key, out var name))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IReadOnlyDictionaryExtensions.cs (1)
14if (dictionary.TryGetValue(key, out var value))
Microsoft.CodeAnalysis.CSharp (11)
Binder\Binder.ValueChecks.cs (1)
1136primaryConstructor.GetCapturedParameters().TryGetValue(parameterSymbol, out FieldSymbol backingField))
CSharpParseOptions.cs (1)
190ImmutableArray<ImmutableArray<string>> previewNamespaces = Features.TryGetValue("InterceptorsNamespaces", out var namespaces) && namespaces.Length > 0
Emitter\EditAndContinue\CSharpSymbolMatcher.cs (3)
552if (otherMembersByName.TryGetValue(sourceMember.MetadataName, out var otherMembers)) 795if (_otherSynthesizedMembers != null && _otherSynthesizedMembers.TryGetValue(symbol, out var synthesizedMembers)) 800if (_otherDeletedMembers?.TryGetValue(symbol, out var deletedMembers) == true)
FlowAnalysis\NullableWalker.cs (1)
2187primaryConstructor.GetCapturedParameters().TryGetValue(parameter, out FieldSymbol? field))
Lowering\LocalRewriter\LocalRewriter.cs (1)
315primaryCtor.GetCapturedParameters().TryGetValue(node.ParameterSymbol, out var field))
Lowering\StateMachineRewriter\StateMachineRewriter.cs (4)
316if (proxies.TryGetValue(method.ThisParameter, out proxy)) 330if (proxies.TryGetValue(parameter, out proxy)) 470if (copyDest.TryGetValue(method.ThisParameter, out proxy)) 488if (copyDest.TryGetValue(parameter, out proxy))
Microsoft.CodeAnalysis.CSharp.Features (1)
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (1)
1433fromOtherMap.TryGetValue(GetContainingDeclaration(otherNode), out declaration);
Microsoft.CodeAnalysis.CSharp.Workspaces (3)
Workspace\LanguageServices\CSharpCompilationFactoryService.cs (1)
47if (!compilationOptionsMetadata.TryGetValue("output-kind", out var outputKindString) ||
Workspace\LanguageServices\CSharpSyntaxTreeFactoryService.cs (2)
37if (!metadata.TryGetValue("language-version", out var langVersionString) || 45preprocessorSymbols: metadata.TryGetValue("define", out var defines) ? defines.Split(',') : null);
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (1)
CodeActions\CodeChangeProviderMetadataTests.cs (1)
141if (!export.Metadata.TryGetValue("Name", out var nameObj)
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (1)
EEMetadataReferenceResolver.cs (1)
34if (_referencesBySimpleName.TryGetValue(referenceIdentity.Name, out var references))
Microsoft.CodeAnalysis.Features (5)
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (3)
1714if (forwardMap.TryGetValue(oldNode, out newAncestor)) 1752editMap.TryGetValue(node, out var parentEdit) && 1932else if (reverseMap.TryGetValue(newNode, out var oldPartner) && comparer((TSyntaxNode)oldPartner, (TSyntaxNode)newNode))
EditAndContinue\ActiveStatementsMap.cs (2)
219if (DocumentPathMap.TryGetValue(targetPath, out var activeStatementsInMappedFile)) 241if (DocumentPathMap.TryGetValue(oldTree.FilePath, out var activeStatements))
Microsoft.CodeAnalysis.Features.UnitTests (1)
FindUsages\DefinitionItemFactoryTests.cs (1)
42=> value != null && expressionMap.TryGetValue(value, out var syntax) ? syntax : Inspect(value);
Microsoft.CodeAnalysis.LanguageServer.Protocol (2)
Handler\SemanticTokens\SemanticTokensHelpers.cs (2)
372if (!tokenTypeMap.TryGetValue(classificationType, out var tokenTypeStr)) 377Contract.ThrowIfFalse(tokenTypesToIndex.TryGetValue(tokenTypeStr, out var tokenTypeIndex), "No matching token type index found.");
Microsoft.CodeAnalysis.Scripting (1)
ScriptState.cs (1)
91return GetVariableMap().TryGetValue(name, out index) ? Variables[index] : null;
Microsoft.CodeAnalysis.Scripting.UnitTests (1)
RuntimeMetadataReferenceResolverTests.cs (1)
80if (_map.TryGetValue(reference, out paths))
Microsoft.CodeAnalysis.UnitTests (1)
Collections\ImmutableDictionaryTestBase.cs (1)
250Assert.False(empty.TryGetValue(someKey, out V? value));
Microsoft.CodeAnalysis.VisualBasic (3)
Binding\Binder_XmlLiterals.vb (1)
1450If _namespaces.TryGetValue(prefix, result) Then
Binding\ImportAliasesBinder.vb (1)
57If _importedAliases.TryGetValue(name, [alias]) Then
Compilation\SyntaxTreeSemanticModel.vb (1)
1327If aliasImports IsNot Nothing AndAlso aliasImports.TryGetValue(aliasName, symbol) Then
Microsoft.CodeAnalysis.Workspaces (5)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser.cs (2)
112var value = entries.TryGetValue(key, out var str) ? parser(str) : defaultValue; 122=> lines.TryGetValue(Key, out var line) ? line.Span : null;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser_NamingStyle.cs (1)
89if (!entries.TryGetValue(key, out var name))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser_SymbolSpec.cs (1)
85if (!entries.TryGetValue(key, out var name))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IReadOnlyDictionaryExtensions.cs (1)
14if (dictionary.TryGetValue(key, out var value))
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (1)
FileSet.cs (1)
56if (_fileMap.TryGetValue(fileName, out var content))
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (1)
TestAnalyzerReferenceByLanguage.cs (1)
39if (_analyzersMap.TryGetValue(language, out var analyzers))
Microsoft.CodeAnalysis.Workspaces.UnitTests (1)
Host\LanguageServices\TestCSharpCompilationFactoryServiceWithIncrementalGeneratorTracking.cs (1)
49if (!compilationOptionsMetadata.TryGetValue("output-kind", out var outputKindString) ||
Microsoft.DotNet.Build.Tasks.Packaging (1)
NuGetAssetResolver.cs (1)
212allCompileItems.TryGetValue(referencePackageId, out thisPackageCompileItems);
Microsoft.DotNet.GenFacades (1)
SourceGenerator.cs (1)
61if (!_seedTypes.TryGetValue(type, out seedTypes))
Microsoft.DotNet.XliffTasks (1)
Model\TranslatableDocument.cs (1)
57if (translations.TryGetValue(node.Id, out string translation))
Microsoft.Extensions.AI (1)
Functions\AIFunctionFactory.cs (1)
375if (arguments.TryGetValue(parameter.Name, out object? value))
Microsoft.Extensions.AI.OpenAI (1)
OpenAIModelMapper.ChatCompletion.cs (1)
397aiFunction.Metadata.AdditionalProperties.TryGetValue("Strict", out object? strictObj) &&
Microsoft.Extensions.Diagnostics.Testing (1)
Metrics\CollectedMeasurement.cs (1)
63if (!Tags.TryGetValue(kvp.Key, out var value))
Microsoft.Extensions.Telemetry (6)
Http\HttpRouteFormatter.cs (4)
135if ((!parametersToRedact.TryGetValue(segment.ParamName, out DataClassification classification) && 145if (parametersToRedact.TryGetValue(segment.ParamName, out DataClassification classification) && classification != DataClassification.None) 201if (parametersToRedact.TryGetValue(httpRouteSegment.ParamName, out var classification)) 243if (parametersToRedact.TryGetValue(httpRouteSegment.ParamName, out DataClassification classification)
Http\HttpRouteParser.cs (2)
272if (parametersToRedact.TryGetValue(segment.ParamName, out DataClassification classification)) 303if (parametersToRedact.TryGetValue(segment.ParamName, out DataClassification classification)
Microsoft.JSInterop (2)
Infrastructure\DotNetDispatcher.cs (2)
357if (assemblyMethods.TryGetValue(methodIdentifier, out var result)) 390if (assemblyMethods.TryGetValue(methodIdentifier, out var result))
Microsoft.Maui (1)
Handlers\HybridWebView\FileExtensionContentTypeProvider.cs (1)
447 return Mappings.TryGetValue(extension, out contentType);
Microsoft.Maui.Graphics (2)
Text\TextAttributesExtensions.cs (1)
16 if (attributes.TryGetValue(type, out var value))
Text\XmlAttributedTextWriter.cs (1)
84 currentAttributes.TryGetValue(key, out var value);
Microsoft.ML.Tokenizers (10)
Model\CodeGenTokenizer.cs (3)
1464if (_vocabReverse.TryGetValue(id, out string? s)) 1531if (_vocabReverse.TryGetValue(id, out var value)) 1569if (unicodeToByte.TryGetValue(text[i], out char c))
Model\EnglishRobertaTokenizer.cs (4)
289if (unicodeToByte.TryGetValue(v[j], out var c)) 371if (byteToUnicode.TryGetValue(text[i], out var value)) 683if (byteToUnicode.TryGetValue(text[i], out var value)) 728if (byteToUnicode.TryGetValue(text[i], out var value))
Model\WordPieceTokenizer.cs (2)
687if (ignoreSpecialTokens && SpecialTokensReverse!.TryGetValue(id, out _)) 746if (ignoreSpecialTokens && SpecialTokensReverse!.TryGetValue(id, out _))
Utils\BytePairEncoder.cs (1)
40if (ranks.TryGetValue(slice, out var rank))
Microsoft.ML.Tokenizers.Tests (3)
CodeGenTests.cs (1)
519if (codeGenTokenizer.Vocabulary.TryGetValue(token, out int id))
LlamaTests.cs (1)
361Assert.True(bpe.Vocabulary.TryGetValue("▁", out _));
TiktokenTests.cs (1)
125Assert.True(externalEncoder.TryGetValue(kvp.Key, out int value));
Microsoft.VisualStudio.LanguageServices (4)
EditorConfigSettings\Common\EnumSettingViewModel.cs (1)
46if (_mapping.TryGetValue(propertyDescription, out var value))
NavigateTo\RoslynSearchItemsSource.cs (2)
75var includeTypeResults = searchQuery.FiltersStates.TryGetValue("Types", out var typesValue) && typesValue == "True"; 76var includeMembersResults = searchQuery.FiltersStates.TryGetValue("Members", out var membersValue) && membersValue == "True";
ProjectSystem\BrokeredService\WorkspaceProjectFactoryService.cs (1)
53return _buildSystemProperties.TryGetValue(name, out var value) ? value : "";
MSBuild (1)
CollectionHelpers.cs (1)
67if (!b.TryGetValue(aKvp.Key, out var bValue))
Sockets.FunctionalTests (1)
src\Servers\Kestrel\shared\test\MetricsAssert.cs (1)
24if (tags.TryGetValue(KestrelMetrics.ErrorTypeAttributeName, out var error))
System.Collections.Immutable (1)
System\Collections\Immutable\ImmutableDictionary.cs (1)
314if (dictionary.TryGetValue(key, out value!))
System.Formats.Tar (2)
System\Formats\Tar\TarHelpers.cs (2)
174if (dict.TryGetValue(fieldName, out string? strNumber) && !string.IsNullOrEmpty(strNumber)) 187if (dict.TryGetValue(fieldName, out string? strNumber) && !string.IsNullOrEmpty(strNumber))
System.Private.CoreLib (1)
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\CollectionExtensions.cs (1)
21return dictionary.TryGetValue(key, out TValue? value) ? value : defaultValue;
xunit.assert (1)
DictionaryAsserts.cs (1)
94 if (!collection.TryGetValue(expected, out value))