131 implementations of TryGetValue
dotnet-svcutil-lib (1)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\MessageProperties.cs (1)
541public bool TryGetValue(string name, out object value)
InMemory.FunctionalTests (2)
Http2\Http2ConnectionTests.cs (1)
308public bool TryGetValue(string key, out StringValues value) => _innerHeaders.TryGetValue(key, out value);
Http3\Http3ConnectionTests.cs (1)
843public bool TryGetValue(string key, out StringValues value) => _innerHeaders.TryGetValue(key, out value);
Microsoft.AspNetCore.Components (1)
src\Http\Http.Abstractions\src\Routing\RouteValueDictionary.cs (1)
603public bool TryGetValue(string key, out object? value)
Microsoft.AspNetCore.Connections.Abstractions (1)
ConnectionItems.cs (1)
74bool IDictionary<object, object?>.TryGetValue(object key, out object? value)
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (1)
src\Shared\EmptyCollections\EmptyReadonlyDictionary.cs (1)
39public bool TryGetValue(TKey key, out TValue value)
Microsoft.AspNetCore.Hosting.Tests (1)
WebHostTests.cs (1)
1438public bool TryGetValue(string key, out StringValues value)
Microsoft.AspNetCore.Http (4)
HeaderDictionary.cs (1)
317public bool TryGetValue(string key, out StringValues value)
Internal\ItemsDictionary.cs (1)
70bool IDictionary<object, object?>.TryGetValue(object key, out object? value)
src\Shared\CopyOnWriteDictionary\CopyOnWriteDictionary.cs (1)
114public bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
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 (1)
ModelBinding\Validation\ValidationStateDictionary.cs (1)
129public bool TryGetValue(object key, [MaybeNullWhen(false)] out ValidationStateEntry value)
Microsoft.AspNetCore.Mvc.Core (1)
src\Shared\CopyOnWriteDictionary\CopyOnWriteDictionary.cs (1)
114public bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
Microsoft.AspNetCore.Mvc.IntegrationTests (2)
DictionaryModelBinderIntegrationTest.cs (2)
1615bool IDictionary<string, string>.TryGetValue(string key, out string value) 1720bool IDictionary<TKey, TValue>.TryGetValue(TKey key, out TValue value)
Microsoft.AspNetCore.Mvc.ViewFeatures (3)
AttributeDictionary.cs (1)
292public bool TryGetValue(string key, out string? value)
TempDataDictionary.cs (1)
234public bool TryGetValue(string key, out object? value)
ViewDataDictionary.cs (1)
546public bool TryGetValue(string key, out object? value)
Microsoft.AspNetCore.Owin (3)
DictionaryStringArrayWrapper.cs (1)
66bool IDictionary<string, string[]>.TryGetValue(string key, out string[] value)
DictionaryStringValuesWrapper.cs (1)
111bool IDictionary<string, StringValues>.TryGetValue(string key, out StringValues value)
OwinEnvironment.cs (1)
176bool IDictionary<string, object>.TryGetValue(string key, out object value)
Microsoft.AspNetCore.Razor.Runtime (1)
src\Shared\CopyOnWriteDictionary\CopyOnWriteDictionary.cs (1)
114public bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
Microsoft.AspNetCore.Server.HttpSys (2)
src\Shared\HttpSys\RequestProcessing\HeaderCollection.cs (1)
242public bool TryGetValue(string key, out StringValues value)
src\Shared\HttpSys\RequestProcessing\RequestHeaders.cs (1)
133public bool TryGetValue(string key, out StringValues value)
Microsoft.AspNetCore.Server.IIS (2)
src\Shared\HttpSys\RequestProcessing\HeaderCollection.cs (1)
242public bool TryGetValue(string key, out StringValues value)
src\Shared\HttpSys\RequestProcessing\RequestHeaders.cs (1)
133public bool TryGetValue(string key, out StringValues value)
Microsoft.AspNetCore.Server.Kestrel.Core (1)
Internal\Http\HttpHeaders.cs (1)
262bool IDictionary<string, StringValues>.TryGetValue(string key, out StringValues value)
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (1)
Http1\Http1ConnectionTests.cs (1)
1213public bool TryGetValue(string key, out StringValues value) => _innerHeaders.TryGetValue(key, out value);
Microsoft.AspNetCore.Shared.Tests (5)
ClosedGenericMatcherTest.cs (1)
338bool IDictionary<string, object>.TryGetValue(string key, out object value)
src\Shared\CopyOnWriteDictionary\CopyOnWriteDictionary.cs (1)
114public bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
src\Shared\Dictionary\AdaptiveCapacityDictionary.cs (1)
481public bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
src\Shared\HttpSys\RequestProcessing\HeaderCollection.cs (1)
242public bool TryGetValue(string key, out StringValues value)
src\Shared\HttpSys\RequestProcessing\RequestHeaders.cs (1)
133public bool TryGetValue(string key, out StringValues value)
Microsoft.Build (9)
Collections\ArrayDictionary.cs (1)
182public bool TryGetValue(TKey key, out TValue value)
Collections\CopyOnWritePropertyDictionary.cs (1)
263bool IDictionary<string, T>.TryGetValue(string key, out T value) => _backing.TryGetValue(key, out value);
Collections\PropertyDictionary.cs (1)
381bool IDictionary<string, T>.TryGetValue(string key, out T value)
Collections\ReadOnlyConvertingDictionary.cs (1)
112public bool TryGetValue(K key, out N value)
Collections\RetrievableEntryHashSet\RetrievableEntryHashSet.cs (1)
313public bool TryGetValue(string key, out T item)
CopyOnWriteDictionary.cs (1)
247public bool TryGetValue(string key, out V value)
Instance\ImmutableProjectCollections\ImmutableElementCollectionConverter.cs (1)
94public bool TryGetValue(string key, out T value) => _values.TryGetValue(key, out value);
Instance\ImmutableProjectCollections\ImmutableGlobalPropertiesCollectionConverter.cs (1)
139public bool TryGetValue(string key, out ProjectPropertyInstance 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 (2)
CopyOnWriteDictionary.cs (1)
247public bool TryGetValue(string key, out V value)
ReadOnlyEmptyDictionary.cs (1)
208public bool TryGetValue(K key, out V value)
Microsoft.Build.Utilities.Core (2)
CopyOnWriteDictionary.cs (1)
247public bool TryGetValue(string key, out V value)
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)
199bool IDictionary<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.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.Configuration (1)
ConfigurationManager.cs (1)
343public bool TryGetValue(string key, [NotNullWhen(true)] out object? 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.Interop.SourceGeneration (1)
ValueEqualityImmutableDictionary.cs (1)
57public bool TryGetValue(T key, out U value) => Map.TryGetValue(key, out value);
Microsoft.Maui.Controls (3)
OrderedDictionary.cs (1)
226 public bool TryGetValue(TKey key, out TValue value)
ResourceDictionary.cs (1)
307 public bool TryGetValue(string key, out object value)
Shell\ShellNavigationQueryParameters.cs (1)
101 public bool TryGetValue(string key, [MaybeNullWhen(false)] out object value)
Microsoft.ML.Core (1)
Utilities\Tree.cs (1)
98public bool TryGetValue(TKey key, out Tree<TKey, TValue> value)
Microsoft.ML.SearchSpace (3)
Option\NestOption.cs (1)
146public bool TryGetValue(string key, out OptionBase value)
Parameter.cs (1)
317public bool TryGetValue(string key, out Parameter value)
SearchSpace.cs (1)
329public bool TryGetValue(string key, out OptionBase value)
Microsoft.ML.TorchSharp (1)
Utils\DefaultDictionary.cs (1)
99public bool TryGetValue(TKey key, out TValue value)
MSBuild (2)
CopyOnWriteDictionary.cs (1)
247public bool TryGetValue(string key, out V value)
ReadOnlyEmptyDictionary.cs (1)
208public bool TryGetValue(K key, out V value)
MSBuildTaskHost (3)
CopyOnWriteDictionary.cs (1)
247public bool TryGetValue(string key, out V value)
Immutable\ImmutableDictionary.cs (1)
57public bool TryGetValue(K key, out V value)
ReadOnlyEmptyDictionary.cs (1)
208public bool TryGetValue(K key, out V value)
PresentationCore (4)
MS\Internal\FontCache\FontFaceLayoutInfo.cs (1)
635public bool TryGetValue(int key, out ushort value)
System\Windows\Media\CharacterMetricsDictionary.cs (1)
47public bool TryGetValue(int key, out CharacterMetrics value)
System\Windows\Media\CultureSpecificStringDictionary.cs (1)
52public bool TryGetValue(XmlLanguage key, out string value)
System\Windows\Media\GlyphTypeface.cs (1)
1756public bool TryGetValue(ushort key, out double value)
PresentationFramework (2)
MS\Internal\Annotations\ObservableDictionary.cs (1)
140public bool TryGetValue(string key, out string value)
MS\Internal\WeakDictionary.cs (1)
223public bool TryGetValue(TKey key, out TValue value)
Shared (1)
EmptyCollections\EmptyReadonlyDictionary.cs (1)
39public bool TryGetValue(TKey key, out TValue value)
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.Composition.Hosting (1)
System\Composition\Hosting\Core\CycleBreakingMetadataDictionary.cs (1)
53public bool TryGetValue(string key, out object value)
System.Diagnostics.DiagnosticSource (1)
System\Diagnostics\ActivityTagsCollection.cs (1)
252public bool TryGetValue(string key, out object? value)
System.Diagnostics.Process (1)
System\Collections\Specialized\DictionaryWrapper.cs (1)
79public bool TryGetValue(string key, out string? value) => _contents.TryGetValue(key, out value);
System.Linq.Expressions (1)
System\Dynamic\ExpandoObject.cs (1)
660bool IDictionary<string, object?>.TryGetValue(string key, out object? value)
System.Net.Http (1)
System\Net\Http\HttpRequestOptions.cs (1)
49bool IDictionary<string, object?>.TryGetValue(string key, out object? value) => Options.TryGetValue(key, out value);
System.Private.CoreLib (2)
src\libraries\System.Private.CoreLib\src\System\Collections\ObjectModel\ReadOnlyDictionary.cs (1)
46public bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\EventPayload.cs (1)
110public bool TryGetValue(string key, [MaybeNullWhen(false)] out object? 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.ServiceModel.Primitives (1)
netstandard.cs (1)
1747public bool TryGetValue(string name, out object value) { value = default; return default; }
System.Speech (1)
artifacts\obj\System.Speech\Debug\net10.0\System.Speech.notsupported.cs (1)
317bool System.Collections.Generic.IDictionary<System.String,System.Speech.Recognition.SemanticValue>.TryGetValue(string key, out System.Speech.Recognition.SemanticValue value) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_SystemSpeech); }
System.Text.Json (1)
System\Text\Json\Nodes\JsonObject.IDictionary.cs (1)
196bool IDictionary<string, JsonNode?>.TryGetValue(string propertyName, out JsonNode? jsonNode)
System.Xaml (2)
System\Xaml\NameScope.cs (1)
209public bool TryGetValue(string key, out object value)
System\Xaml\NameScopeDictionary.cs (1)
316bool IDictionary<string, object>.TryGetValue(string key, out object value)
System.Xaml.Tests (2)
System\Xaml\XamlTypeTests.cs (2)
3196bool IDictionary<string, int>.TryGetValue(string key, out int value) => throw new NotImplementedException(); 3198bool IDictionary<int, string>.TryGetValue(int key, out string value) => throw new NotImplementedException();
693 references to TryGetValue
AnalyzerRunner (1)
CodeRefactoringRunner.cs (1)
243data.TryGetValue(nameof(Languages), out var languages);
Aspire.Dashboard (2)
Authentication\OtlpApiKey\OtlpApiKeyAuthenticationHandler.cs (1)
26if (Context.Request.Headers.TryGetValue(ApiKeyHeaderName, out var apiKey))
Components\Pages\Resources.razor.cs (1)
96static bool IsKeyValueTrue(string key, IDictionary<string, bool> dictionary) => dictionary.TryGetValue(key, out var value) && value;
Aspire.Hosting (7)
Dcp\DcpExecutor.cs (2)
386else if (resource.Metadata.Annotations?.TryGetValue(CustomResource.ServiceProducerAnnotation, out var servicesProducedAnnotationJson) == true) 1432if (resource is Executable exe && exe.Metadata.Annotations.TryGetValue(CustomResource.ResourceReplicaCount, out var value) && int.TryParse(value, CultureInfo.InvariantCulture, out var replicas) && replicas > 1)
Dcp\Model\ModelCommon.cs (4)
31public string? AppModelResourceName => Metadata.Annotations?.TryGetValue(ResourceNameAnnotation, out var value) is true ? value : null; 33public string? AppModelInitialState => Metadata.Annotations?.TryGetValue(ResourceStateAnnotation, out var value) is true ? value : null; 73bool found = annotations.TryGetValue(annotationName, out annotationValue); 94if (annotations.TryGetValue(annotationName, out var annotationVal) && !string.IsNullOrWhiteSpace(annotationVal))
Dcp\Model\Service.cs (1)
91public string? EndpointName => Metadata.Annotations?.TryGetValue(EndpointNameAnnotation, out var value) is true ? value : null;
Aspire.Hosting.Azure (1)
AspireV8ResourceNamePropertyResolver.cs (1)
36if (resource.ProvisionableProperties.TryGetValue("Tags", out var tags) &&
BasicWebSite (2)
Controllers\TestingController.cs (2)
44if (!Request.Headers.TryGetValue("X-Added-Header", out var value)) 70if (Request.Headers.TryGetValue("X-Added-Header", out var value))
CSharpSyntaxGenerator (3)
AbstractFileWriter.cs (3)
223if (derivedTypeName != null && _parentMap.TryGetValue(derivedTypeName, out var baseType)) 241=> _nodeMap.TryGetValue(typeName, out var node) ? node : null; 244=> _typeMap.TryGetValue(typeName, out var node) ? node : null;
dotnet-openapi (1)
Commands\BaseCommand.cs (1)
198var version = urlPackages != null && urlPackages.TryGetValue(packageId, out var urlPackageVersion) ? urlPackageVersion : kvp.Value;
dotnet-svcutil-lib (7)
FrameworkFork\System.ServiceModel\System\IdentityModel\Policy\UnconditionalPolicy.cs (1)
233if (!evaluationContext.Properties.TryGetValue(SecurityUtils.Identities, out obj))
FrameworkFork\System.ServiceModel\System\IdentityModel\Selectors\SecurityTokenRequirement.cs (1)
159if (!Properties.TryGetValue(propertyName, out dictionaryValue))
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\UnrecognizedAssertionsBindingElement.cs (2)
66if (!OperationAssertions.TryGetValue(operation, out existent)) 80if (!MessageAssertions.TryGetValue(message, out existent))
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\ServiceMetadataExtension.cs (1)
277else if (!_updatePortsByScheme.TryGetValue(uri.Scheme, out port))
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\SecurityUtils.cs (1)
575if (authContext.Properties.TryGetValue(SecurityUtils.Identities, out obj))
FrameworkFork\System.ServiceModel\System\ServiceModel\ServiceSecurityContext.cs (1)
133if (authContext != null && authContext.Properties.TryGetValue(SecurityUtils.Identities, out identities))
dotnet-user-jwts (2)
Commands\PrintCommand.cs (1)
47if (!jwtStore.Jwts.TryGetValue(id, out var jwt))
Commands\RemoveCommand.cs (1)
53if (!jwtStore.Jwts.TryGetValue(id, out var jwt))
GenericHostWebSite (2)
Controllers\TestingController.cs (2)
43if (!Request.Headers.TryGetValue("X-Added-Header", out var value)) 56if (Request.Headers.TryGetValue("X-Added-Header", out var value))
illink (3)
InMemory.FunctionalTests (7)
Http2\Http2ConnectionTests.cs (2)
308public bool TryGetValue(string key, out StringValues value) => _innerHeaders.TryGetValue(key, out value); 505if (persistentStateCollection.TryGetValue("Counter", out var value))
Http2\Http2WebSocketTests.cs (3)
26Assert.False(context.Request.Headers.TryGetValue(":protocol", out var _)); 88Assert.False(context.Request.Headers.TryGetValue(":protocol", out var _)); 164Assert.False(context.Request.Headers.TryGetValue(":protocol", out var _));
Http3\Http3ConnectionTests.cs (1)
843public bool TryGetValue(string key, out StringValues value) => _innerHeaders.TryGetValue(key, out value);
RequestTests.cs (1)
2141if (persistentStateCollection.TryGetValue("Counter", out var value))
InProcessWebSite (3)
src\Servers\IIS\IIS\test\testassets\InProcessWebSite\Startup.cs (3)
472if (ctx.Request.Headers.TryGetValue(headerName, out var headerValue) || (string[])headerValue is not null) 659if (ctx.Request.Headers.TryGetValue("Response-Content-Type", out var contentType)) 691if (ctx.Request.Headers.TryGetValue("Response-Content-Type", out var contentType))
Interop.FunctionalTests (1)
Http3\Http3RequestTests.cs (1)
836if (persistentStateCollection.TryGetValue("Counter", out var value))
Kestrel.SampleApp (1)
ClientCertBufferingFeature.cs (1)
30&& !connectionItems.Items.TryGetValue("tls.clientcert.negotiated", out var _))
Microsoft.Analyzers.Local (2)
ApiLifecycle\Json\JsonObject.cs (2)
44get => _properties.TryGetValue(key, out var value) 106if (_properties.TryGetValue(oldKey, out var value))
Microsoft.AspNetCore (3)
WebApplication.cs (1)
300if (_webApplication.Properties.TryGetValue("__MiddlewareDescriptions", out var value) &&
WebApplicationBuilder.cs (2)
395if (app.Properties.TryGetValue(EndpointRouteBuilderKey, out var priorRouteBuilder)) 499app.Properties.TryGetValue(MiddlewareDescriptionsKey, out var destinationValue) &&
Microsoft.AspNetCore.Antiforgery (3)
Internal\DefaultAntiforgery.cs (2)
366if (responseHeaders.TryGetValue(HeaderNames.CacheControl, out var cacheControlHeader) && 381if (responseHeaders.TryGetValue(HeaderNames.Pragma, out var pragmaHeader) && pragmaHeader.Count > 0)
src\Shared\HttpExtensions.cs (1)
42if (endpoint == null && context.Items.TryGetValue(OriginalEndpointKey, out var e) && e is Endpoint originalEndpoint)
Microsoft.AspNetCore.App.Analyzers.Test (1)
RouteEmbeddedLanguage\Infrastructure\MarkupTestFile.cs (1)
180if (!dictionary.TryGetValue(key, out var value))
Microsoft.AspNetCore.Authentication (2)
RemoteAuthenticationHandler.cs (2)
205&& ticket.Properties.Items.TryGetValue(AuthSchemeKey, out var authenticatedScheme) 252if (!properties.Items.TryGetValue(CorrelationProperty, out var correlationId))
Microsoft.AspNetCore.Authentication.Abstractions (6)
AuthenticationProperties.cs (4)
126return Items.TryGetValue(key, out var value) ? value : null; 153=> Parameters.TryGetValue(key, out var obj) && obj is T value ? value : default; 171if (Items.TryGetValue(key, out var value) && bool.TryParse(value, out var boolValue)) 202if (Items.TryGetValue(key, out var value)
TokenExtensions.cs (2)
66return properties.Items.TryGetValue(tokenKey, out var value) ? value : null; 100if (properties.Items.TryGetValue(TokenNamesKey, out var value) && !string.IsNullOrEmpty(value))
Microsoft.AspNetCore.Authentication.Core (3)
AuthenticationSchemeProvider.cs (3)
123=> Task.FromResult(_schemes.TryGetValue(name, out var scheme) ? scheme : null); 187if (!_schemes.TryGetValue(name, out _)) 193if (_schemes.TryGetValue(name, out var scheme))
Microsoft.AspNetCore.Authentication.Google (1)
GoogleHandler.cs (1)
100else if (!properties.Items.TryGetValue(name, out value))
Microsoft.AspNetCore.Authentication.MicrosoftAccount (1)
MicrosoftAccountHandler.cs (1)
114else if (!properties.Items.TryGetValue(name, out value))
Microsoft.AspNetCore.Authentication.OAuth (1)
OAuthHandler.cs (1)
210if (context.Properties.Items.TryGetValue(OAuthConstants.CodeVerifierKey, out var codeVerifier))
Microsoft.AspNetCore.Authentication.OpenIdConnect (3)
OpenIdConnectHandler.cs (2)
958properties.Items.TryGetValue(OpenIdConnectDefaults.UserstatePropertiesKey, out var userstate); 1269if (properties.Items.TryGetValue(OAuthConstants.CodeVerifierKey, out var codeVerifier))
UniqueJsonKeyClaimAction.cs (1)
49return c.Properties.TryGetValue(JwtSecurityTokenHandler.ShortClaimTypeProperty, out var shortType)
Microsoft.AspNetCore.Authentication.Test (3)
OpenIdConnect\TestSettings.cs (1)
298if (actualParams.TryGetValue(parameterName, out actualValue))
WsFederation\WsFederationTest.cs (1)
305if (!context.ProtocolMessage.Parameters.TryGetValue("suppressWctx", out var suppress))
WsFederation\WsFederationTest_Handler.cs (1)
301if (!context.ProtocolMessage.Parameters.TryGetValue("suppressWctx", out var suppress))
Microsoft.AspNetCore.Authentication.WsFederation (2)
WsFederationHandler.cs (2)
197properties.Items.TryGetValue(WsFederationDefaults.UserstatePropertiesKey, out var userState); 214if (properties.Items.TryGetValue(CorrelationProperty, out string? correlationId)
Microsoft.AspNetCore.BrowserTesting (3)
BrowserManagerConfiguration.cs (2)
51if (!BrowserOptions.TryGetValue(browser, out var browserOptions)) 66Combine(GetContextOptions(browser.ToString()), ContextOptions.TryGetValue(contextName, out var context) ? context : throw new InvalidOperationException("Invalid context name"));
ContextInformation.cs (1)
45if (Pages.TryGetValue(page, out var info))
Microsoft.AspNetCore.Components (2)
PersistentComponentState.cs (1)
131if (_existingState.TryGetValue(key, out value))
src\Http\Routing\src\ParameterPolicyActivator.cs (1)
92return inlineParameterPolicyMap.TryGetValue(policyKey, out policyType);
Microsoft.AspNetCore.Components.Endpoints (3)
Rendering\EndpointHtmlRenderer.Prerendering.cs (1)
240if (!httpContext.Items.TryGetValue(ComponentSequenceKey, out var result))
Rendering\EndpointHtmlRenderer.PrerenderingState.cs (2)
171if (!httpContext.Items.TryGetValue(InvokedRenderModesKey, out var result)) 196return httpContext.Items.TryGetValue(InvokedRenderModesKey, out var result)
Microsoft.AspNetCore.Components.Server (2)
Circuits\CircuitHandleRegistry.cs (2)
10if (circuitHandles.TryGetValue(circuitKey, out var circuitHandle)) 20if (circuitHandles.TryGetValue(circuitKey, out var circuitHandle))
Microsoft.AspNetCore.Components.Tests (1)
Lifetime\ComponentStatePersistenceManagerTest.cs (1)
99Assert.True(store.State.TryGetValue("MyState", out var persisted));
Microsoft.AspNetCore.Components.WebAssembly.Server.Tests (18)
ContentEncodingNegotiatorTests.cs (18)
29Assert.True(httpContext.Response.Headers.TryGetValue(HeaderNames.ContentEncoding, out var selectedEncoding)); 31Assert.True(httpContext.Response.Headers.TryGetValue(HeaderNames.Vary, out var varyHeader)); 51Assert.False(httpContext.Response.Headers.TryGetValue(HeaderNames.ContentEncoding, out var selectedEncoding)); 52Assert.False(httpContext.Response.Headers.TryGetValue(HeaderNames.Vary, out var varyHeader)); 72Assert.True(httpContext.Response.Headers.TryGetValue(HeaderNames.ContentEncoding, out var selectedEncoding)); 74Assert.True(httpContext.Response.Headers.TryGetValue(HeaderNames.Vary, out var varyHeader)); 95Assert.True(httpContext.Response.Headers.TryGetValue(HeaderNames.ContentEncoding, out var selectedEncoding)); 97Assert.True(httpContext.Response.Headers.TryGetValue(HeaderNames.Vary, out var varyHeader)); 118Assert.True(httpContext.Response.Headers.TryGetValue(HeaderNames.ContentEncoding, out var selectedEncoding)); 120Assert.True(httpContext.Response.Headers.TryGetValue(HeaderNames.Vary, out var varyHeader)); 141Assert.True(httpContext.Response.Headers.TryGetValue(HeaderNames.ContentEncoding, out var selectedEncoding)); 143Assert.True(httpContext.Response.Headers.TryGetValue(HeaderNames.Vary, out var varyHeader)); 164Assert.True(httpContext.Response.Headers.TryGetValue(HeaderNames.ContentEncoding, out var selectedEncoding)); 166Assert.True(httpContext.Response.Headers.TryGetValue(HeaderNames.Vary, out var varyHeader)); 186Assert.False(httpContext.Response.Headers.TryGetValue(HeaderNames.ContentEncoding, out var selectedEncoding)); 187Assert.False(httpContext.Response.Headers.TryGetValue(HeaderNames.Vary, out var varyHeader)); 207Assert.True(httpContext.Response.Headers.TryGetValue(HeaderNames.ContentEncoding, out var selectedEncoding)); 209Assert.True(httpContext.Response.Headers.TryGetValue(HeaderNames.Vary, out var varyHeader));
Microsoft.AspNetCore.Components.WebView (2)
FileExtensionContentTypeProvider.cs (1)
446return Mappings.TryGetValue(extension, out contentType);
src\Shared\StaticWebAssets\ManifestStaticWebAssetFileProvider.cs (1)
390if (!existing.TryGetValue(key, out var existingNode))
Microsoft.AspNetCore.Components.WebView.Photino (1)
PhotinoWebViewManager.cs (1)
56headers.TryGetValue("Content-Type", out contentType);
Microsoft.AspNetCore.Components.WebView.Test (1)
StaticContentProviderTests.cs (1)
40Assert.True(headers.TryGetValue("Content-Type", out var contentTypeValue));
Microsoft.AspNetCore.ConcurrencyLimiter.Tests (2)
src\Shared\EventSource.Testing\TestCounterListener.cs (2)
52if (payload.TryGetValue("Increment", out var increment)) 56if (payload.TryGetValue("Mean", out var mean))
Microsoft.AspNetCore.Connections.Abstractions (3)
ConnectionItems.cs (3)
45if (Items.TryGetValue(key, out var value)) 76return Items.TryGetValue(key, out value); 116if (Items.TryGetValue(item.Key, out var value) && Equals(item.Value, value))
Microsoft.AspNetCore.Cors (2)
Infrastructure\CorsOptions.cs (1)
91if (PolicyMap.TryGetValue(name, out var result))
Infrastructure\DefaultCorsPolicyProvider.cs (1)
30if (_options.PolicyMap.TryGetValue(policyName, out var result))
Microsoft.AspNetCore.Diagnostics (4)
ExceptionHandler\ExceptionHandlerExtensions.cs (1)
114if (app.Properties.TryGetValue(RerouteHelper.GlobalRouteBuilderKey, out var routeBuilder) && routeBuilder is not null)
src\Shared\HttpExtensions.cs (1)
42if (endpoint == null && context.Items.TryGetValue(OriginalEndpointKey, out var e) && e is Endpoint originalEndpoint)
src\Shared\Reroute.cs (1)
16if (app.Properties.TryGetValue(UseRoutingKey, out var useRouting) && useRouting is Func<IApplicationBuilder, IApplicationBuilder> useRoutingFunc)
StatusCodePage\StatusCodePagesExtensions.cs (1)
150if (app.Properties.TryGetValue(RerouteHelper.GlobalRouteBuilderKey, out var routeBuilder) && routeBuilder is not null)
Microsoft.AspNetCore.Diagnostics.HealthChecks (1)
HealthCheckMiddleware.cs (1)
49if (!_healthCheckOptions.ResultStatusCodes.TryGetValue(result.Status, out var statusCode))
Microsoft.AspNetCore.Diagnostics.Middleware (3)
Latency\AddServerTimingHeaderMiddleware.cs (1)
42if (httpContext.Response.Headers.TryGetValue(ServerTimingHeaderName, out var existing))
Logging\HeaderReader.cs (1)
40if (headers.TryGetValue(header.Key, out var headerValue))
Logging\RequestHeadersLogEnricher.cs (1)
69if (request.Headers.TryGetValue(header.Key, out var headerValue) && !string.IsNullOrEmpty(headerValue))
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (2)
Latency\RequestLatencyTelemetryMiddlewareTests.cs (2)
74Assert.False(httpContextMock.Response.Headers.TryGetValue(TelemetryConstants.ServerApplicationNameHeader, out var val)); 133Assert.False(httpContextMock.Response.Headers.TryGetValue(TelemetryConstants.ServerApplicationNameHeader, out var val));
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (2)
UnaryServerCallHandlerTests.cs (2)
1379c.UserState.TryGetValue("__HttpContext", out requestHttpContext); 1401c.UserState.TryGetValue("IntercepterRun", out interceptorRun);
Microsoft.AspNetCore.Grpc.Swagger.Tests (18)
Binding\BodyTests.cs (4)
28Assert.True(path.Operations.TryGetValue(OperationType.Post, out var operation)); 47Assert.True(path.Operations.TryGetValue(OperationType.Post, out var operation)); 63Assert.True(path.Operations.TryGetValue(OperationType.Post, out var operation)); 77Assert.True(path.Operations.TryGetValue(OperationType.Post, out var operation));
Binding\ParametersTests.cs (9)
28Assert.True(path.Operations.TryGetValue(OperationType.Get, out var operation)); 44Assert.True(path.Operations.TryGetValue(OperationType.Get, out var operation)); 60Assert.True(path.Operations.TryGetValue(OperationType.Post, out var operation)); 81Assert.True(path.Operations.TryGetValue(OperationType.Post, out var operation)); 98Assert.True(path.Operations.TryGetValue(OperationType.Get, out var operation)); 112Assert.True(path.Operations.TryGetValue(OperationType.Get, out var operation)); 128Assert.True(path.Operations.TryGetValue(OperationType.Get, out var operation)); 150Assert.True(path.Operations.TryGetValue(OperationType.Get, out var operation)); 178Assert.True(path.Operations.TryGetValue(OperationType.Get, out var operation));
Binding\ResponseBodyTests.cs (4)
29Assert.True(path.Operations.TryGetValue(OperationType.Post, out var operation)); 43Assert.True(path.Operations.TryGetValue(OperationType.Post, out var operation)); 59Assert.True(path.Operations.TryGetValue(OperationType.Post, out var operation)); 84Assert.True(path.Operations.TryGetValue(OperationType.Post, out var operation));
GrpcSwaggerServiceExtensionsTests.cs (1)
48Assert.True(path.Operations.TryGetValue(OperationType.Get, out var operation));
Microsoft.AspNetCore.HeaderParsing (3)
HeaderParsingFeature.cs (1)
139if (feature.Context!.Request.Headers.TryGetValue(header.Name, out var values))
HeaderRegistry.cs (2)
41if (!_options.MaxCachedValuesPerHeader.TryGetValue(id.HeaderName, out maxCachedValues)) 48if (_options.DefaultValues.TryGetValue(id.HeaderName, out var defValue))
Microsoft.AspNetCore.HeaderPropagation (2)
HeaderPropagationMessageHandler.cs (1)
64if (captured.TryGetValue(entry.CapturedHeaderName, out var stringValues) &&
HeaderPropagationMiddleware.cs (1)
71context.Request.Headers.TryGetValue(entry.InboundHeaderName, out var value);
Microsoft.AspNetCore.HostFiltering.Tests (2)
HostFilteringMiddlewareTests.cs (2)
65Assert.False(c.Request.Headers.TryGetValue(HeaderNames.Host, out var host)); 106Assert.True(c.Request.Headers.TryGetValue(HeaderNames.Host, out var host));
Microsoft.AspNetCore.Hosting (3)
GenericHost\WebHostBuilderBase.cs (1)
76if (!context.Properties.TryGetValue(typeof(WebHostBuilderContext), out var contextVal))
src\Shared\HttpExtensions.cs (1)
42if (endpoint == null && context.Items.TryGetValue(OriginalEndpointKey, out var e) && e is Endpoint originalEndpoint)
src\Shared\StaticWebAssets\ManifestStaticWebAssetFileProvider.cs (1)
390if (!existing.TryGetValue(key, out var existingNode))
Microsoft.AspNetCore.Hosting.Tests (2)
src\Shared\EventSource.Testing\TestCounterListener.cs (2)
52if (payload.TryGetValue("Increment", out var increment)) 56if (payload.TryGetValue("Mean", out var mean))
Microsoft.AspNetCore.Http (5)
Internal\ItemsDictionary.cs (3)
32if (_items != null && _items.TryGetValue(key, out var value)) 73return _items != null && _items.TryGetValue(key, out value); 122if (_items.TryGetValue(item.Key, out var value) && Equals(item.Value, value))
src\Shared\CopyOnWriteDictionary\CopyOnWriteDictionary.cs (1)
116return ReadDictionary.TryGetValue(key, out value);
Timeouts\RequestTimeoutsMiddleware.cs (1)
67if (options.Policies.TryGetValue(timeoutMetadata.PolicyName!, out var policy))
Microsoft.AspNetCore.Http.Abstractions (4)
Extensions\UsePathBaseExtensions.cs (1)
33if (app.Properties.TryGetValue(RerouteHelper.GlobalRouteBuilderKey, out var routeBuilder) && routeBuilder is not null)
Internal\ParsingHelpers.cs (2)
14return headers.TryGetValue(key, out value) ? value : StringValues.Empty; 46return headers.TryGetValue(key, out values) ? values : StringValues.Empty;
src\Shared\Reroute.cs (1)
16if (app.Properties.TryGetValue(UseRoutingKey, out var useRouting) && useRouting is Func<IApplicationBuilder, IApplicationBuilder> useRoutingFunc)
Microsoft.AspNetCore.Http.Connections.Client (1)
Internal\AccessTokenHttpMessageHandler.cs (1)
30request.Properties.TryGetValue("IsNegotiate", out var value) && value is true
Microsoft.AspNetCore.HttpLogging (5)
W3CLoggingMiddleware.cs (5)
146if (request.Headers.TryGetValue(HeaderNames.Host, out var host)) 154if (request.Headers.TryGetValue(HeaderNames.Referer, out var referer)) 162if (request.Headers.TryGetValue(HeaderNames.UserAgent, out var agent)) 172if (request.Headers.TryGetValue(HeaderNames.Cookie, out var cookie)) 184if (request.Headers.TryGetValue(additionalRequestHeaders[i], out var headerValue))
Microsoft.AspNetCore.Identity (2)
SignInManager.cs (2)
691if (auth?.Principal == null || items == null || !items.TryGetValue(LoginProviderKey, out var provider)) 698if (!items.TryGetValue(XsrfKey, out var userId) ||
Microsoft.AspNetCore.Identity.EntityFrameworkCore.Test (1)
src\Identity\test\Shared\PriorityOrderer.cs (1)
72if (dictionary.TryGetValue(key, out var result))
Microsoft.AspNetCore.Identity.FunctionalTests (1)
Infrastructure\HtmlPageContext.cs (1)
25_properties.TryGetValue(key, out var rawValue) ? (TValue)rawValue : default;
Microsoft.AspNetCore.Identity.InMemory.Test (1)
src\Identity\test\Shared\PriorityOrderer.cs (1)
72if (dictionary.TryGetValue(key, out var result))
Microsoft.AspNetCore.Identity.Test (1)
src\Identity\test\Shared\PriorityOrderer.cs (1)
72if (dictionary.TryGetValue(key, out var result))
Microsoft.AspNetCore.JsonPatch (3)
Internal\DictionaryAdapterOfTU.cs (3)
61if (!dictionary.TryGetValue(convertedKey, out var valueAsT)) 150if (!dictionary.TryGetValue(convertedKey, out var currentValue)) 197if (dictionary.TryGetValue(convertedKey, out var valueAsT))
Microsoft.AspNetCore.JsonPatch.Tests (8)
CustomNamingStrategyTests.cs (2)
81cont.TryGetValue("customStringProperty", out var valueFromDictionary); 109cont.TryGetValue("customTest", out var valueFromDictionary);
IntegrationTests\ExpandoObjectIntegrationTest.cs (4)
233cont.TryGetValue("IntegerValue", out object valueFromDictionary); 255cont.TryGetValue("StringProperty", out var valueFromDictionary); 295cont.TryGetValue("Test", out object valueFromDictionary); 336cont.TryGetValue("Test", out object valueFromDictionary);
TestObjectModels\DynamicTestObject.cs (1)
70return ((IDictionary<string, object>)_dictionary).TryGetValue(key, out value);
WriteOnceDynamicTestObject.cs (1)
84return ((IDictionary<string, object>)_dictionary).TryGetValue(key, out value);
Microsoft.AspNetCore.MiddlewareAnalysis (1)
AnalysisBuilder.cs (1)
66if (Properties.TryGetValue(NextMiddlewareName, out var middlewareNameObj) && middlewareNameObj != null)
Microsoft.AspNetCore.Mvc.Abstractions (1)
Abstractions\ActionDescriptorExtensions.cs (1)
22if (actionDescriptor.Properties.TryGetValue(typeof(T), out var value))
Microsoft.AspNetCore.Mvc.ApiExplorer (3)
ApiDescriptionExtensions.cs (1)
22if (apiDescription.Properties.TryGetValue(typeof(T), out var value))
ApiResponseTypeProvider.cs (2)
40action.Properties.TryGetValue(typeof(ApiConventionResult), out var result)) 48if (action.Properties.TryGetValue(typeof(ProducesErrorResponseTypeAttribute), out result))
Microsoft.AspNetCore.Mvc.Core (17)
ApplicationModels\AttributeRouteModel.cs (1)
409if (!values.TryGetValue(token, out var value))
Formatters\TextOutputFormatter.cs (1)
184OutputMediaTypeCache.TryGetValue(mediaType, out var mediaTypeWithCharset))
Infrastructure\ActionSelectionTable.cs (2)
73a.RouteValues?.TryGetValue(key, out value); 95e.Metadata.GetMetadata<ActionDescriptor>()?.RouteValues?.TryGetValue(key, out value);
Infrastructure\ControllerActionInvoker.cs (1)
545if (!actionParameters.TryGetValue(parameterInfo.Name!, out var value) || value is null)
Infrastructure\DefaultProblemDetailsFactory.cs (1)
99if (_options.ClientErrorMapping.TryGetValue(statusCode, out var clientErrorData))
Infrastructure\ResourceInvoker.Log.cs (2)
42if (action.RouteValues.TryGetValue("page", out var page) && page != null) 103if (action.RouteValues.TryGetValue("page", out var page) && page != null)
ModelBinding\Binders\HeaderModelBinder.cs (1)
107if (request.Headers.TryGetValue(headerName, out var header))
ModelBinding\JQueryFormValueProvider.cs (1)
30if (values.TryGetValue(FormValueHelper.CultureInvariantFieldName, out var invariantKeys) && invariantKeys.Count > 0)
ModelBinding\JQueryValueProvider.cs (1)
77if (_values.TryGetValue(key, out var values) && values.Count > 0)
ModelBinding\Validation\ShortFormDictionaryValidationStrategy.cs (1)
98if (_model.TryGetValue(_keyMappingEnumerator.Current.Value, out value))
ResponseCacheAttribute.cs (1)
89options.CacheProfiles.TryGetValue(CacheProfileName, out selectedProfile);
Routing\KnownRouteValueConstraint.cs (1)
103if (action.RouteValues.TryGetValue(routeKey, out var value) &&
Routing\NormalizedRouteValue.cs (1)
35if (actionDescriptor.RouteValues.TryGetValue(key, out var value) &&
Routing\UrlHelperFactory.cs (1)
38if (httpContext.Items.TryGetValue(typeof(IUrlHelper), out var value) && value is IUrlHelper urlHelper)
src\Shared\CopyOnWriteDictionary\CopyOnWriteDictionary.cs (1)
116return ReadDictionary.TryGetValue(key, out value);
Microsoft.AspNetCore.Mvc.Core.Test (4)
ResponseCacheAttributeTest.cs (4)
221Assert.True(response.Headers.TryGetValue("Cache-Control", out values)); 224Assert.True(response.Headers.TryGetValue("Vary", out values)); 277Assert.True(context.HttpContext.Response.Headers.TryGetValue("Cache-Control", out values)); 296Assert.True(context.HttpContext.Response.Headers.TryGetValue("Cache-Control", out values));
Microsoft.AspNetCore.Mvc.Cors (1)
CorsHttpMethodActionConstraint.cs (1)
34request.Headers.TryGetValue(AccessControlRequestMethod, out var accessControlRequestMethod) &&
Microsoft.AspNetCore.Mvc.FunctionalTests (9)
RoutingAcrossPipelineBranchesTest.cs (4)
58Assert.True(subdirContent.RouteValues.TryGetValue("subdir", out var subdir)); 62Assert.True(commonContent.RouteValues.TryGetValue("common", out var common)); 66Assert.True(defaultContent.RouteValues.TryGetValue("default", out var @default)); 171Assert.True(content.RouteValues.TryGetValue("action", out var action));
RoutingDynamicOrderTest.cs (4)
74Assert.True(content.RouteValues.TryGetValue("identifier", out var identifier)); 97Assert.False(content.RouteValues.TryGetValue("identifier", out var identifier)); 119Assert.True(content.RouteValues.TryGetValue("identifier", out var identifier)); 163Assert.True(content.RouteValues.TryGetValue("identifier", out var identifier));
RoutingGroupsTest.cs (1)
46Assert.True(content.RouteValues.TryGetValue("org", out var org));
Microsoft.AspNetCore.Mvc.IntegrationTests (2)
DictionaryModelBinderIntegrationTest.cs (2)
1617return _data.TryGetValue(key, out value); 1722return _data.TryGetValue(key, out value);
Microsoft.AspNetCore.Mvc.Razor (2)
LanguageViewLocationExpander.cs (1)
59context.Values.TryGetValue(ValueKey, out var value);
RazorPage.cs (1)
161if (PreviousSectionWriters.TryGetValue(sectionName, out var renderDelegate))
Microsoft.AspNetCore.Mvc.RazorPages (2)
Builder\PageActionEndpointConventionBuilderResourceCollectionExtensions.cs (2)
30if (builder.Items.TryGetValue(EndpointRouteBuilderKey, out var endpointBuilder)) 32var (resolver, registered) = builder.Items.TryGetValue(ResourceCollectionResolverKey, out var value)
Microsoft.AspNetCore.Mvc.RazorPages.Test (1)
Infrastructure\PageBinderFactoryTest.cs (1)
832if (_args.TryGetValue(parameter.Name, out var result))
Microsoft.AspNetCore.Mvc.TagHelpers (1)
OptionTagHelper.cs (1)
74context.Items.TryGetValue(typeof(SelectTagHelper), out var formDataEntry);
Microsoft.AspNetCore.Mvc.ViewFeatures (14)
DefaultEditorTemplates.cs (1)
199if (htmlAttributes.TryGetValue("class", out var htmlClassObject))
DefaultHtmlGenerator.cs (1)
1536htmlAttributeDictionary.TryGetValue(fallbackAttributeName, out var attributeObject);
Filters\SaveTempDataFilter.cs (1)
120if (httpContext.Items.TryGetValue(SaveTempDataFilterContextKey, out var value))
Filters\SaveTempDataPropertyFilterBase.cs (1)
49OriginalValues.TryGetValue(property.PropertyInfo, out var originalValue);
NameAndIdProvider.cs (2)
46if (items.TryGetValue(PreviousNameAndIdKey, out previousNameAndIdObject) && 145if (items.TryGetValue(PreviousNameAndIdKey, out previousNameAndIdObject) &&
PartialViewResultExecutor.cs (1)
175if (actionDescriptor.RouteValues.TryGetValue(ActionNameKey, out var value) &&
TempDataDictionaryFactory.cs (1)
35if (context.Items.TryGetValue(Key, out obj))
TryGetValueDelegate.cs (1)
7/// A delegate for <see cref="System.Collections.Generic.IDictionary{TKey, TValue}.TryGetValue(TKey, out TValue)"/>.
TryGetValueProvider.cs (1)
89var success = strongDict.TryGetValue((TKey)(object)key, out strongValue);
ViewDataDictionary.cs (2)
310_data.TryGetValue(index, out var result); 550return _data.TryGetValue(key, out value);
ViewDataEvaluator.cs (1)
162success = dict.TryGetValue(key, out value);
ViewResultExecutor.cs (1)
175if (actionDescriptor.RouteValues.TryGetValue(ActionNameKey, out var value) &&
Microsoft.AspNetCore.OpenApi (6)
Services\OpenApiDocumentService.cs (2)
164if (!pathItem.Operations.TryGetValue(operationType, out var operation)) 170annotations.TryGetValue(OpenApiConstants.DescriptionId, out var descriptionId) &&
Services\Schemas\OpenApiSchemaService.cs (4)
149schema.Annotations.TryGetValue(OpenApiConstants.SchemaId, out var resolvedBaseSchemaId)) 205schema.Annotations.TryGetValue(OpenApiConstants.SchemaId, out var schemaId) && 217schema.Annotations.TryGetValue(OpenApiConstants.SchemaId, out var referenceId) && 292if (schema.Properties.TryGetValue(propertyInfo.Name, out var propertySchema))
Microsoft.AspNetCore.OpenApi.Tests (40)
Services\CreateSchemaReferenceIdTests.cs (3)
39Assert.True(requestBody.TryGetValue("application/json", out var mediaType)); 53Assert.True(document.Components.Schemas.TryGetValue("MyShapeMyTriangle", out var triangleSchema)); 56Assert.True(document.Components.Schemas.TryGetValue("MyShapeMySquare", out var squareSchema));
Services\OpenApiSchemaService\OpenApiSchemaService.ParameterSchemas.cs (1)
692Assert.True(response.Content.TryGetValue("application/json", out var mediaType));
Services\OpenApiSchemaService\OpenApiSchemaService.PolymorphicSchemas.cs (25)
25Assert.True(requestBody.TryGetValue("application/json", out var mediaType)); 39Assert.True(document.Components.Schemas.TryGetValue("ShapeTriangle", out var triangleSchema)); 42Assert.True(document.Components.Schemas.TryGetValue("ShapeSquare", out var squareSchema)); 62Assert.True(requestBody.TryGetValue("application/json", out var mediaType)); 78Assert.True(document.Components.Schemas.TryGetValue("WeatherForecastBaseWeatherForecastWithCity", out var citySchema)); 82Assert.True(document.Components.Schemas.TryGetValue("WeatherForecastBaseWeatherForecastWithTimeSeries", out var timeSeriesSchema)); 86Assert.True(document.Components.Schemas.TryGetValue("WeatherForecastBaseWeatherForecastWithLocalNews", out var newsSchema)); 107Assert.True(requestBody.TryGetValue("application/json", out var mediaType)); 121Assert.True(document.Components.Schemas.TryGetValue("PersonStudent", out var citySchema)); 125Assert.True(document.Components.Schemas.TryGetValue("PersonTeacher", out var timeSeriesSchema)); 146Assert.True(requestBody.TryGetValue("application/json", out var mediaType)); 157Assert.True(document.Components.Schemas.TryGetValue("ColorPaintColor", out var paintSchema)); 161Assert.True(document.Components.Schemas.TryGetValue("ColorFabricColor", out var fabricSchema)); 165Assert.True(document.Components.Schemas.TryGetValue("ColorBase", out var colorSchema)); 185Assert.True(requestBody.TryGetValue("application/json", out var mediaType)); 209Assert.True(document.Components.Schemas.TryGetValue("PetDog", out var dogSchema)); 213Assert.True(document.Components.Schemas.TryGetValue("PetCat", out var catSchema)); 217Assert.True(document.Components.Schemas.TryGetValue("PetPet", out var petSchema)); 238Assert.True(requestBody.TryGetValue("application/json", out var mediaType)); 249Assert.True(document.Components.Schemas.TryGetValue("OrganismAnimal", out var animalSchema)); 251Assert.True(document.Components.Schemas.TryGetValue("OrganismPlant", out var plantSchema)); 253Assert.True(document.Components.Schemas.TryGetValue("OrganismBase", out var baseSchema)); 273Assert.True(requestBody.TryGetValue("application/json", out var mediaType)); 291Assert.True(document.Components.Schemas.TryGetValue("EmployeeManager", out var managerSchema)); 293Assert.True(document.Components.Schemas.TryGetValue("EmployeeEmployee", out var employeeSchema));
Services\OpenApiSchemaService\OpenApiSchemaService.RequestBodySchemas.cs (2)
310Assert.True(requestBody.TryGetValue("application/json", out var mediaType)); 350Assert.True(requestBody.TryGetValue("application/json", out var mediaType));
Transformers\Implementations\OpenApiSchemaReferenceTransformerTests.cs (1)
298Assert.False(responseSchema.Extensions.TryGetValue("x-my-extension", out var _));
Transformers\SchemaTransformerTests.cs (8)
231Assert.False(responseSchema.Extensions.TryGetValue("x-my-extension", out var _)); 509Assert.True(triangleSubschema.Extensions.TryGetValue("x-my-extension", out var _)); 585Assert.True(triangleSubschema.Extensions.TryGetValue("x-my-extension", out var triangleExtension)); 591Assert.True(squareSubschema.Extensions.TryGetValue("x-my-extension", out var squareExtension)); 626Assert.True(triangleSubschema.Extensions.TryGetValue("x-my-extension", out var triangleExtension)); 632Assert.True(squareSubschema.Extensions.TryGetValue("x-my-extension", out var squareExtension)); 667Assert.True(triangleSubschema.Extensions.TryGetValue("x-my-extension", out var triangleExtension)); 673Assert.True(squareSubschema.Extensions.TryGetValue("x-my-extension", out var squareExtension));
Microsoft.AspNetCore.Owin (23)
DictionaryStringArrayWrapper.cs (1)
69if (Inner.TryGetValue(key, out temp))
DictionaryStringValuesWrapper.cs (3)
32return Inner.TryGetValue(key, out values) ? values : null; 50if (!Inner.TryGetValue(HeaderNames.ContentLength, out rawValue)) 114if (Inner.TryGetValue(key, out temp))
OwinEnvironment.cs (6)
155return ((IDictionary<string, object>)this).TryGetValue(key, out _); 179if (_entries.TryGetValue(key, out entry) && entry.TryGet(_context, out value)) 183return _context.Items.TryGetValue(key, out value); 197if (_entries.TryGetValue(key, out entry) && entry.TryGet(_context, out value)) 201if (_context.Items.TryGetValue(key, out value)) 210if (_entries.TryGetValue(key, out entry))
OwinExtensions.cs (1)
137if (env.TryGetValue(typeof(HttpContext).FullName, out obj))
OwinFeatureCollection.cs (6)
63if (Environment.TryGetValue(key, out value) && value is T) 232if (Environment.TryGetValue(OwinConstants.SendFiles.SendAsync, out obj)) 246&& (Environment.TryGetValue(OwinConstants.CommonKeys.LoadClientCertAsync, out obj) 247|| Environment.TryGetValue(OwinConstants.CommonKeys.ClientCertificate, out obj)) 307return Environment.TryGetValue(OwinConstants.WebSocket.AcceptAlt, out _); 314if (!Environment.TryGetValue(OwinConstants.WebSocket.AcceptAlt, out obj))
WebSockets\OwinWebSocketAcceptAdapter.cs (1)
119if (environment.TryGetValue(OwinConstants.WebSocket.Accept, out accept) && accept is WebSocketAccept)
WebSockets\OwinWebSocketAcceptContext.cs (1)
37if (_options != null && _options.TryGetValue(OwinConstants.WebSocket.SubProtocol, out obj))
WebSockets\OwinWebSocketAdapter.cs (2)
61if (_websocketContext.TryGetValue(OwinConstants.WebSocket.ClientCloseStatus, out obj)) 75if (_websocketContext.TryGetValue(OwinConstants.WebSocket.ClientCloseDescription, out obj))
WebSockets\WebSocketAcceptAdapter.cs (2)
66if (environment.TryGetValue(OwinConstants.WebSocket.AcceptAlt, out accept) && accept is WebSocketAcceptAlt) 76if (adapter._options != null && adapter._options.TryGetValue(typeof(WebSocketAcceptContext).FullName, out obj))
Microsoft.AspNetCore.Owin.Tests (5)
OwinEnvironmentTests.cs (4)
15return environment.TryGetValue(key, out value) ? (T)value : default(T); 106Assert.False(env.TryGetValue(key, out value)); 121Assert.True(env.TryGetValue("owin.CallCancelled", out value), "owin.CallCancelled"); 122Assert.True(env.TryGetValue("owin.Version", out value), "owin.Version");
OwinFeatureCollectionTests.cs (1)
19return env.TryGetValue(key, out value) ? (T)value : default(T);
Microsoft.AspNetCore.Razor.Runtime (1)
src\Shared\CopyOnWriteDictionary\CopyOnWriteDictionary.cs (1)
116return ReadDictionary.TryGetValue(key, out value);
Microsoft.AspNetCore.RequestDecompression (1)
DefaultRequestDecompressionProvider.cs (1)
48if (_providers.TryGetValue(encodingName, out var matchingProvider))
Microsoft.AspNetCore.ResponseCaching (1)
ResponseCachingMiddleware.cs (1)
161if (context.CachedResponseHeaders.TryGetValue(key, out var values))
Microsoft.AspNetCore.Rewrite (5)
ApacheModRewrite\FlagParser.cs (1)
77if (!_ruleFlagLookup.TryGetValue(tokenSpan[hasPayload[0]].ToString(), out flag))
ApacheModRewrite\Flags.cs (2)
36if (!FlagDictionary.TryGetValue(flag, out var res)) 49if (!FlagDictionary.TryGetValue(flag, out var res))
RewriteBuilderExtensions.cs (1)
48if (app.Properties.TryGetValue(RerouteHelper.GlobalRouteBuilderKey, out var routeBuilder) && routeBuilder is not null)
src\Shared\Reroute.cs (1)
16if (app.Properties.TryGetValue(UseRoutingKey, out var useRouting) && useRouting is Func<IApplicationBuilder, IApplicationBuilder> useRoutingFunc)
Microsoft.AspNetCore.Routing (8)
Builder\EndpointRoutingApplicationBuilderExtensions.cs (2)
46if (builder.Properties.TryGetValue(GlobalEndpointRouteBuilderKey, out var obj)) 131if (!app.Properties.TryGetValue(EndpointRouteBuilder, out var obj))
Matching\HttpMethodMatcherPolicy.cs (2)
120headers.TryGetValue(HeaderNames.AccessControlRequestMethod, out var accessControlRequestMethod) && 426headers.TryGetValue(HeaderNames.AccessControlRequestMethod, out accessControlRequestMethod) &&
ParameterPolicyActivator.cs (1)
92return inlineParameterPolicyMap.TryGetValue(policyKey, out policyType);
src\Shared\HttpExtensions.cs (1)
42if (endpoint == null && context.Items.TryGetValue(OriginalEndpointKey, out var e) && e is Endpoint originalEndpoint)
Tree\TreeRouter.cs (2)
107if (_namedEntries.TryGetValue(entry.RouteName, out var namedMatch) && 268if (_namedEntries.TryGetValue(context.RouteName, out var match))
Microsoft.AspNetCore.Routing.Tests (2)
Builder\EndpointRoutingApplicationBuilderExtensionsTest.cs (2)
339Assert.True(app.Properties.TryGetValue("__EndpointRouteBuilder", out var local)); 340Assert.True(app.Properties.TryGetValue("__GlobalEndpointRouteBuilder", out var global));
Microsoft.AspNetCore.Server.HttpSys (6)
src\Shared\HttpSys\RequestProcessing\HeaderCollection.cs (3)
190Store.TryGetValue(key, out values); 223if (Store.TryGetValue(key, out values)) 244return Store.TryGetValue(key, out value);
src\Shared\HttpSys\RequestProcessing\RequestHeaders.cs (2)
135return PropertiesTryGetValue(key, out value) || Extra.TryGetValue(key, out value); 161return ((IDictionary<string, StringValues>)this).TryGetValue(item.Key, out var value) && Equals(value, item.Value);
UrlPrefixCollection.cs (1)
78return _prefixes.TryGetValue(id, out var prefix) ? prefix : null;
Microsoft.AspNetCore.Server.IIS (5)
src\Shared\HttpSys\RequestProcessing\HeaderCollection.cs (3)
190Store.TryGetValue(key, out values); 223if (Store.TryGetValue(key, out values)) 244return Store.TryGetValue(key, out value);
src\Shared\HttpSys\RequestProcessing\RequestHeaders.cs (2)
135return PropertiesTryGetValue(key, out value) || Extra.TryGetValue(key, out value); 161return ((IDictionary<string, StringValues>)this).TryGetValue(item.Key, out var value) && Equals(value, item.Value);
Microsoft.AspNetCore.Server.IntegrationTesting.IIS (2)
IISDeployer.cs (2)
165if (IISDeploymentParameters.HandlerSettings.TryGetValue("debugFile", out var debugFile)) 170if (DeploymentParameters.EnvironmentVariables.TryGetValue("ASPNETCORE_MODULE_DEBUG_FILE", out debugFile))
Microsoft.AspNetCore.Server.Kestrel.Core (6)
Internal\Http\HttpProtocol.cs (1)
943((IHeaderDictionary)HttpRequestHeaders).TryGetValue(HeaderNames.Expect, out var expect) &&
Internal\Http3\Http3Connection.cs (1)
605if (!persistentStateFeature.State.TryGetValue(StreamPersistentStateKey, out var s))
Internal\Http3\Http3Stream.cs (1)
855if (((AspNetCore.Http.IHeaderDictionary)HttpRequestHeaders).TryGetValue(WebTransportSession.CurrentSupportedVersion, out var version) && string.Equals(version, WebTransportSession.VersionEnabledIndicator, StringComparison.Ordinal))
KestrelConfigurationLoader.cs (1)
407if (EndpointConfigurations.TryGetValue(endpoint.Name, out var configureEndpoint))
TlsConfigurationLoader.cs (2)
129if (configurationReader.Certificates.TryGetValue("Default", out var defaultCertConfig)) 149if (configurationReader.Certificates.TryGetValue("Development", out var certificateConfig) &&
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (45)
Http1\Http1ConnectionTests.cs (1)
1213public bool TryGetValue(string key, out StringValues value) => _innerHeaders.TryGetValue(key, out value);
HttpHeadersTests.cs (6)
256Assert.False(headers.TryGetValue("Content-Length", out var value)); 261Assert.True(headers.TryGetValue("Content-Length", out value)); 267Assert.True(headers.TryGetValue("Content-Length", out value)); 273Assert.False(headers.TryGetValue("Content-Length", out value)); 291Assert.False(headers.TryGetValue("Content-Length", out value)); 298Assert.False(headers.TryGetValue("Content-Length", out value));
HttpRequestHeadersTests.cs (38)
72Assert.False(headers.TryGetValue("host", out value)); 73Assert.False(headers.TryGetValue("custom", out value)); 74Assert.False(headers.TryGetValue("Content-Length", out value)); 77Assert.True(headers.TryGetValue("host", out value)); 78Assert.False(headers.TryGetValue("custom", out value)); 79Assert.False(headers.TryGetValue("Content-Length", out value)); 82Assert.True(headers.TryGetValue("host", out value)); 83Assert.True(headers.TryGetValue("custom", out value)); 84Assert.False(headers.TryGetValue("Content-Length", out value)); 87Assert.True(headers.TryGetValue("host", out value)); 88Assert.True(headers.TryGetValue("custom", out value)); 89Assert.True(headers.TryGetValue("Content-Length", out value)); 288Assert.False(headers.TryGetValue("host", out value)); 289Assert.False(headers.TryGetValue("custom", out value)); 290Assert.False(headers.TryGetValue("Content-Length", out value)); 295Assert.True(headers.TryGetValue("host", out value)); 296Assert.True(headers.TryGetValue("custom", out value)); 297Assert.True(headers.TryGetValue("Content-Length", out value)); 302Assert.True(headers.TryGetValue("host", out value)); 303Assert.True(headers.TryGetValue("custom", out value)); 304Assert.True(headers.TryGetValue("Content-Length", out value)); 317Assert.True(headers.TryGetValue("host", out value)); 318Assert.True(headers.TryGetValue("custom", out value)); 319Assert.True(headers.TryGetValue("Content-Length", out value)); 324Assert.False(headers.TryGetValue("host", out value)); 325Assert.False(headers.TryGetValue("custom", out value)); 326Assert.False(headers.TryGetValue("Content-Length", out value)); 339Assert.True(headers.TryGetValue("host", out value)); 340Assert.True(headers.TryGetValue("custom", out value)); 341Assert.True(headers.TryGetValue("Content-Length", out value)); 347Assert.False(headers.TryGetValue("host", out value)); 348Assert.True(headers.TryGetValue("custom", out value)); 354Assert.False(headers.TryGetValue("host", out value)); 355Assert.False(headers.TryGetValue("custom", out value)); 356Assert.True(headers.TryGetValue("Content-Length", out value)); 362Assert.False(headers.TryGetValue("host", out value)); 363Assert.False(headers.TryGetValue("custom", out value)); 364Assert.False(headers.TryGetValue("Content-Length", out value));
Microsoft.AspNetCore.Shared.Tests (7)
CopyOnWriteDictionaryTest.cs (1)
41sourceDictionary.Setup(d => d.TryGetValue("different-key", out value))
src\Shared\CopyOnWriteDictionary\CopyOnWriteDictionary.cs (1)
116return ReadDictionary.TryGetValue(key, out value);
src\Shared\HttpSys\RequestProcessing\HeaderCollection.cs (3)
190Store.TryGetValue(key, out values); 223if (Store.TryGetValue(key, out values)) 244return Store.TryGetValue(key, out value);
src\Shared\HttpSys\RequestProcessing\RequestHeaders.cs (2)
135return PropertiesTryGetValue(key, out value) || Extra.TryGetValue(key, out value); 161return ((IDictionary<string, StringValues>)this).TryGetValue(item.Key, out var value) && Equals(value, item.Value);
Microsoft.AspNetCore.SignalR.Core (1)
Internal\DefaultHubDispatcher.cs (1)
872headers.TryGetValue(fieldName, out fieldValue);
Microsoft.AspNetCore.StaticFiles (1)
FileExtensionContentTypeProvider.cs (1)
440return Mappings.TryGetValue(extension, out contentType);
Microsoft.AspNetCore.Tests (1)
WebApplicationTests.cs (1)
1968Assert.False(newBuilder.Properties.TryGetValue(WebApplication.GlobalEndpointRouteBuilderKey, out _));
Microsoft.Build (88)
BackEnd\BuildManager\GlobalPropertiesLookup.cs (1)
47if (_backingProperties.TryGetValue(key, out var property))
BackEnd\BuildManager\LegacyThreadingData.cs (4)
127_legacyThreadingEventsById.TryGetValue(submissionId, out legacyThreadingEvents); 145_legacyThreadingEventsById.TryGetValue(submissionId, out legacyThreadingEvents); 168_legacyThreadingEventsById.TryGetValue(submissionId, out legacyThreadingEvents); 190_legacyThreadingEventsById.TryGetValue(submissionId, out legacyThreadingEvents);
BackEnd\BuildManager\RequestedProjectState.cs (1)
97if (!another.ItemFilters.TryGetValue(kvp.Key, out List<string> metadata))
BackEnd\Components\Caching\ConfigCache.cs (2)
124if (!_configurationIdsByMetadata.TryGetValue(configMetadata, out int configId)) 236if (_configurations.TryGetValue(configId, out BuildRequestConfiguration configuration))
BackEnd\Components\Communications\NodeProviderOutOfProcTaskHost.cs (3)
280if (_nodeIdToPacketFactory.TryGetValue(nodeId, out INodePacketFactory nodePacketFactory)) 297if (_nodeIdToPacketFactory.TryGetValue(nodeId, out INodePacketFactory nodePacketFactory)) 319if (_nodeIdToPacketHandler.TryGetValue(node, out INodePacketHandler packetHandler))
BackEnd\Components\Logging\LoggingService.cs (5)
695if (warningsByProject != null && warningsByProject.TryGetValue(key, out ISet<string> newWarnings)) 1972if (_warningsAsMessagesByProject.TryGetValue(GetWarningsConfigKey(warningEvent), out ISet<string> codesByProject)) 1985return WarningsNotAsErrors?.Contains(warningEvent.Code) != true && !(_warningsNotAsErrorsByProject?.TryGetValue(key, out ISet<string> notToError) == true && notToError.Contains(warningEvent.Code)); 2011if (_warningsAsErrorsByProject.TryGetValue(key, out ISet<string> codesByProject)) 2016_warningsNotAsErrorsByProject?.TryGetValue(key, out codesToIgnoreByProject);
BackEnd\Components\RequestBuilder\IntrinsicTasks\ItemGroupIntrinsicTask.cs (1)
159Project.ItemDefinitions.TryGetValue(child.ItemType, out itemDefinition);
BackEnd\Components\RequestBuilder\IntrinsicTasks\MSBuild.cs (1)
676if (targetOutputsPerProject[i].TryGetValue(targetName, out ITaskItem[] outputItemsFromTarget))
BackEnd\Components\RequestBuilder\RequestBuilder.cs (1)
1365if (!currentEnvironment.TryGetValue(entry.Key, out value) || !String.Equals(entry.Value, value, StringComparison.Ordinal))
BackEnd\Components\RequestBuilder\TargetBuilder.cs (3)
148var targetExists = _projectInstance.Targets.TryGetValue(targetName.name, out ProjectTargetInstance targetInstance); 784if (_buildResult.ResultsByTarget.TryGetValue(targetName.name, out TargetResult targetBuildResult)) 801_buildResult.ResultsByTarget.TryGetValue(afterTarget.TargetName, out TargetResult result);
BackEnd\Components\RequestBuilder\TargetEntry.cs (1)
936_requestEntry.RequestConfiguration.Project.Targets.TryGetValue(_targetSpecification.TargetName, out _target);
BackEnd\Shared\BuildResult.cs (1)
765if (existingResults.ResultsByTarget?.TryGetValue(target, out TargetResult? targetResult) ?? false)
BackEnd\TaskExecutionHost\TaskExecutionHost.cs (4)
893returnClass.FactoryIdentityParameters.TryGetValue(XMakeAttributes.runtime, out usingTaskRuntime); 894returnClass.FactoryIdentityParameters.TryGetValue(XMakeAttributes.architecture, out usingTaskArchitecture); 897taskIdentityParameters.TryGetValue(XMakeAttributes.runtime, out string taskRuntime); 898taskIdentityParameters.TryGetValue(XMakeAttributes.architecture, out string taskArchitecture);
Collections\CopyOnWritePropertyDictionary.cs (1)
231if (!otherDict.TryGetValue(thisProp.Key, out T thatProp) ||
Collections\PropertyDictionary.cs (2)
194_properties.TryGetValue(name, out projectProperty); 415if (_properties.TryGetValue(item.Key, out T value))
Collections\ReadOnlyConvertingDictionary.cs (1)
114if (_backing.TryGetValue(key, out V originalValue))
CommunicationsUtilities.cs (2)
624ErrorUtilities.VerifyThrow(taskHostParameters.TryGetValue(XMakeAttributes.runtime, out string runtimeVersion), "Should always have an explicit runtime when we call this method."); 625ErrorUtilities.VerifyThrow(taskHostParameters.TryGetValue(XMakeAttributes.architecture, out string architecture), "Should always have an explicit architecture when we call this method.");
Construction\Solution\SolutionProjectGenerator.cs (3)
630globalProperties.TryGetValue("Configuration", out string activeSolutionConfiguration); 631globalProperties.TryGetValue("Platform", out string activeSolutionPlatform); 2101_globalProperties.TryGetValue("ProjectToolsVersion", out string childProjectToolsVersion);
Definition\ProjectCollection.cs (1)
2627if (!globalProperties.TryGetValue(leftProperty.Key, out var rightValue))
Definition\ProjectItem.cs (3)
337if (_project.ItemDefinitions.TryGetValue(ItemType, out itemDefinition)) 895if (_project.ItemDefinitions.TryGetValue(ItemType, out itemDefinition)) 1080if (_project.ItemDefinitions.TryGetValue(source.ItemType, out sourceItemDefinition))
Definition\Toolset.cs (3)
669if (SubToolsets.TryGetValue(subToolsetVersion, out subToolset)) 836if (overrideGlobalProperties != null && overrideGlobalProperties.TryGetValue(Constants.SubToolsetVersionPropertyName, out visualStudioVersion)) 932if (SubToolsets.TryGetValue(subToolsetVersion, out subToolset))
Evaluation\Evaluator.cs (1)
1232if (_data.Toolset.SubToolsets.TryGetValue(_data.SubToolsetVersion, out SubToolset subToolset))
Graph\GraphBuilder.cs (3)
378var solutionConfiguration = globalProperties != null && globalProperties.TryGetValue("Configuration", out string configuration) 382var solutionPlatform = globalProperties != null && globalProperties.TryGetValue("Platform", out string platform) 470if (nodeState.TryGetValue(referenceNode, out var projectReferenceNodeState))
Instance\ImmutableProjectCollections\ImmutableElementCollectionConverter.cs (3)
208if (_projectElements.TryGetValue(key, out TCached element)) 223if (_constrainedProjectElements.TryGetValue((keyString, startIndex, length), out TCached element)) 234if (!_projectElements.TryGetValue(key, out TCached element))
Instance\ImmutableProjectCollections\ImmutableItemDictionary.cs (2)
51if (!_itemsByType.TryGetValue(itemType, out ICollection<TCached>? list)) 153if (_itemsByType.TryGetValue(itemType, out ICollection<TCached>? items))
Instance\ImmutableProjectCollections\ImmutablePropertyCollectionConverter.cs (3)
23if (_projectElements.TryGetValue(name, out TCached? value)) 50if (!otherImmutableDict._projectElements.TryGetValue(propKvp.Key, out TCached? otherProperty) || 61if (!other.TryGetValue(thisProp.Key, out T? thatProp) ||
Instance\ImmutableProjectCollections\ImmutableValuedElementCollectionConverter.cs (1)
27if (_projectElements.TryGetValue(key, out TCached value) && value != null)
Instance\ProjectInstance.cs (5)
1783_itemDefinitions.TryGetValue(itemType, out itemDefinitionInstance); 1822_targets.TryGetValue(targetName, out targetInstance); 2743if (((IEvaluatorData<ProjectPropertyInstance, ProjectItemInstance, ProjectMetadataInstance, ProjectItemDefinitionInstance>)this).BeforeTargets.TryGetValue(target, out beforeTargetsForTarget)) 2760if (((IEvaluatorData<ProjectPropertyInstance, ProjectItemInstance, ProjectMetadataInstance, ProjectItemDefinitionInstance>)this).AfterTargets.TryGetValue(target, out afterTargetsForTarget)) 3383linkedProject.ItemDefinitions.TryGetValue(item.ItemType, out ProjectItemDefinition itemTypeDefinition);
Instance\ProjectItemInstance.cs (2)
720if (projectToUse.ItemDefinitions.TryGetValue(itemTypeToUse, out itemDefinition)) 2097if (_project.ItemDefinitions.TryGetValue(source.ItemType, out sourceItemDefinition))
Instance\TaskFactories\AssemblyTaskFactory.cs (14)
477if (identityParameters.TryGetValue(XMakeAttributes.runtime, out runtime)) 495if (identityParameters.TryGetValue(XMakeAttributes.architecture, out architecture)) 528taskIdentityParameters.TryGetValue(XMakeAttributes.runtime, out taskRuntime); 530factoryIdentityParameters.TryGetValue(XMakeAttributes.runtime, out usingTaskRuntime); 534taskIdentityParameters.TryGetValue(XMakeAttributes.architecture, out taskArchitecture); 536factoryIdentityParameters.TryGetValue(XMakeAttributes.architecture, out usingTaskArchitecture); 569mergedParameters.TryGetValue(XMakeAttributes.runtime, out mergedRuntime); 570mergedParameters.TryGetValue(XMakeAttributes.architecture, out mergedArchitecture); 579taskIdentityParameters.TryGetValue(XMakeAttributes.runtime, out string taskRuntime); 580factoryIdentityParameters.TryGetValue(XMakeAttributes.runtime, out string usingTaskRuntime); 591taskIdentityParameters.TryGetValue(XMakeAttributes.architecture, out string taskArchitecture); 592factoryIdentityParameters.TryGetValue(XMakeAttributes.architecture, out string usingTaskArchitecture); 620if (mergedParameters.TryGetValue(XMakeAttributes.runtime, out runtime)) 632if (mergedParameters.TryGetValue(XMakeAttributes.architecture, out architecture))
Instance\TaskFactories\TaskHostTask.cs (1)
211if (_setParameters.TryGetValue(property.Name, out object value))
Instance\TaskRegistry.cs (7)
946obj.TaskIdentityParameters.TryGetValue(XMakeAttributes.runtime, out runtime); 947obj.TaskIdentityParameters.TryGetValue(XMakeAttributes.architecture, out architecture); 1000if (y.TryGetValue(param.Key, out value)) 1023x.TryGetValue(XMakeAttributes.runtime, out runtimeX); 1024x.TryGetValue(XMakeAttributes.architecture, out architectureX); 1029y.TryGetValue(XMakeAttributes.runtime, out runtimeY); 1030y.TryGetValue(XMakeAttributes.architecture, out architectureY);
Logging\ProfilerLogger.cs (2)
180if (aggregatedLocations.TryGetValue(pairToMerge.Key, out existingProfiledLocation)) 196if (pairToMerge.Key.ParentId.HasValue && mergeMap.TryGetValue(pairToMerge.Key.ParentId.Value, out mergedParent))
Microsoft.Build.Engine.OM.UnitTests (5)
Definition\ProjectMetadata_Tests.cs (3)
370project.ItemDefinitions.TryGetValue("i", out itemDefinition); 399project.ItemDefinitions.TryGetValue("i", out itemDefinition); 433project.ItemDefinitions.TryGetValue("i", out itemDefinition);
ObjectModelRemoting\Helpers\ViewValidation.cs (2)
328Assert.True(viewCollection.TryGetValue(k, out var vv)); 329Assert.True(realCollection.TryGetValue(k, out var rv));
Microsoft.Build.Engine.UnitTests (5)
Definition\Toolset_Tests.cs (1)
135if (t2.SubToolsets.TryGetValue(key, out subToolset2))
Evaluation\Evaluator_Tests.cs (2)
1973if (!allEvaluatedPropertiesWithNoBackingXmlAndNoDuplicates.TryGetValue(property.Name, out propertyFromAllEvaluated)) 2137if (!allEvaluatedPropertiesWithNoBackingXmlAndNoDuplicates.TryGetValue(property.Name, out propertyFromAllEvaluated))
Graph\ProjectGraph_Tests.cs (2)
2105var innerBuildWithCommonReferences = GetNodesWithProjectNumber(graph, 1).First(n => n.ProjectInstance.GlobalProperties.TryGetValue(InnerBuildPropertyName, out string p) && p == "a"); 2111var innerBuildWithAdditionalReferences = GetNodesWithProjectNumber(graph, 1).First(n => n.ProjectInstance.GlobalProperties.TryGetValue(InnerBuildPropertyName, out string p) && p == "b");
Microsoft.Build.Framework (3)
BuildCheck\EnumerableExtensions.cs (2)
89if (!dict.TryGetValue(pair.Key, out TValue? value)) 118if (!dict.TryGetValue(key, out TValue? value))
TaskItemData.cs (1)
74Metadata.TryGetValue(metadataName, out var result);
Microsoft.Build.Tasks.Core (8)
AssignProjectConfiguration.cs (2)
286if (_defaultToVcxMap.TryGetValue(CurrentProjectPlatform, out transformedPlatform)) 293if (_vcxToDefaultMap.TryGetValue(CurrentProjectPlatform, out transformedPlatform))
GetSDKReferenceFiles.cs (2)
475if (sdkInfo.PathToReferenceMetadata != null && sdkInfo.PathToReferenceMetadata.TryGetValue(reference.AssemblyLocation, out SdkReferenceInfo referenceInfo)) 570if (info.DirectoryToFileList != null && info.DirectoryToFileList.TryGetValue(FileUtilities.EnsureNoTrailingSlash(path), out List<string> referenceFiles) && referenceFiles != null)
MSBuild.cs (1)
624if (targetOutputsPerProject[i].TryGetValue(targetName, out ITaskItem[] outputItemsFromTarget))
ResGenDependencies.cs (3)
127if (!resXFiles.TryGetValue(resxFile, out ResXFile retVal)) 161portableLibraries.TryGetValue(libraryPath, out PortableLibraryFile retVal); 177if (!portableLibraries.TryGetValue(library.FileName, out PortableLibraryFile cached) || !library.Equals(cached))
Microsoft.Build.UnitTests.Shared (1)
ObjectModelHelpers.cs (1)
1811string extraContent = extraContentPerProjectNumber != null && extraContentPerProjectNumber.TryGetValue(projectNum, out string extraContentForProject)
Microsoft.CodeAnalysis (2)
Collections\CachingDictionary.cs (1)
167if (localMap.TryGetValue(key, out elements))
DiagnosticAnalyzer\SuppressMessageAttributeState.cs (1)
305if (!builder.TryGetValue(info.Id, out currentInfo))
Microsoft.CodeAnalysis.CodeStyle (13)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.SubstituteTypesVisitor.cs (1)
36if (symbol is TType1 && _map.TryGetValue((TType1)symbol, out var converted))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IDictionaryExtensions.cs (12)
19if (!dictionary.TryGetValue(key, out var value)) 31if (!dictionary.TryGetValue(key, out var value)) 43if (dictionary.TryGetValue(key, out var value)) 67if (!dictionary.TryGetValue(key, out var collection)) 79if (!dictionary.TryGetValue(key, out var builder)) 91if (!dictionary.TryGetValue(key, out var builder)) 103if (dictionary.TryGetValue(key, out var set)) 123if (!dictionary.TryGetValue(key, out var existingArray)) 135if (!dictionary.TryGetValue(key, out var existingArray)) 147if (dictionary.TryGetValue(key, out var collection)) 186if (dictionary.TryGetValue(key, out var collection)) 215if (dictionary.TryGetValue(key, out var collection))
Microsoft.CodeAnalysis.CodeStyle.Fixes (2)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions.cs (2)
275dictionary.TryGetValue(key, out value); 281if (dictionary != null && dictionary.TryGetValue(key, out var symbol))
Microsoft.CodeAnalysis.CSharp (3)
Compilation\CSharpDiagnosticFilter.cs (1)
189if (specificDiagnosticOptions.TryGetValue(id, out report))
SymbolDisplay\SymbolDisplayVisitor_Minimal.cs (1)
322return AliasMap.TryGetValue(symbol, out result) ? result : null;
Symbols\Source\SourceAssemblySymbol.cs (1)
2857if (_lazyForwardedTypesFromSource.TryGetValue(emittedName.FullName, out result))
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (1)
ExtractMethod\ExtractMethodBase.cs (1)
180if (status.Succeeded && namedSpans.TryGetValue("r", out var revisedSpans))
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
Rename\CSharpRenameRewriterLanguageService.cs (1)
967if (location.IsInSource && reverseMappedLocations.TryGetValue(location, out var conflictingLocation))
Microsoft.CodeAnalysis.EditorFeatures (1)
Options\EditorAnalyzerConfigOptions.cs (1)
28if (_configOptions.TryGetValue(key.ToLowerInvariant(), out var objectValue))
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (4)
AbstractCommandHandlerTestState.cs (1)
85if (cursorDocument.AnnotatedSpans.TryGetValue("Selection", out var selectionSpanList))
RefactoringHelpers\RefactoringHelpersTestBase.cs (3)
76!spans.TryGetValue(string.Empty, out var selections) || selections.Length != 1) 90!spans.TryGetValue(string.Empty, out var selections) || selections.Length != 1 || 91!spans.TryGetValue("result", out var results) || results.Length != 1)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (3)
EditorConfigSettings\Data\CodeStyleSettingsTest.cs (1)
107=> _dictionary.TryGetValue(key, out value);
InheritanceMargin\InheritanceMarginTests.cs (2)
101if (testHostDocument.AnnotatedSpans.TryGetValue(SearchAreaTag, out var spans) && spans.IsSingle()) 335if (annotatedSpans.TryGetValue(tag, out var spans))
Microsoft.CodeAnalysis.Features (10)
Completion\Providers\ImportCompletionProvider\AbstractTypeImportCompletionService.cs (2)
122else if (CacheService.PEItemsCache.TryGetValue(peReferenceKey, out var cacheEntry)) 218if (cache.TryGetValue(key, out var cacheEntry) && cacheEntry.Checksum == checksum)
Completion\Providers\ImportCompletionProvider\ExtensionMethodImportCompletionHelper.cs (1)
258if (!cacheService.ProjectItemsCache.TryGetValue(project.Id, out var cacheEntry) ||
Completion\Providers\ImportCompletionProvider\ExtensionMethodImportCompletionHelper.SymbolComputer.cs (1)
164else if (!_cacheService.ProjectItemsCache.TryGetValue(project.Id, out cacheEntry))
LanguageServices\AnonymousTypeDisplayService\StructuralTypeDisplayInfo.cs (1)
53if (structuralTypeToName.TryGetValue(type, out var name) &&
QuickInfo\QuickInfoUtilities.cs (5)
72if (groups.TryGetValue(SymbolDescriptionGroups.Documentation, out var docParts) && !docParts.IsDefaultOrEmpty) 82groups.TryGetValue(SymbolDescriptionGroups.RemarksDocumentation, out var remarksDocumentation) && 93if (groups.TryGetValue(SymbolDescriptionGroups.ReturnsDocumentation, out var returnsDocumentation) && 102if (groups.TryGetValue(SymbolDescriptionGroups.ValueDocumentation, out var valueDocumentation) && 162=> groups.TryGetValue(group, out taggedParts) && !taggedParts.IsDefaultOrEmpty;
Microsoft.CodeAnalysis.LanguageServer.Protocol (1)
Features\UnifiedSuggestions\UnifiedSuggestedActionsSource.cs (1)
182if (!map.TryGetValue(groupKey, out var suggestedActions))
Microsoft.CodeAnalysis.Test.Utilities (1)
MarkedSource\MarkupTestFile.cs (1)
182if (!dictionary.TryGetValue(key, out var value))
Microsoft.CodeAnalysis.UnitTests (3)
Collections\ImmutableDictionaryBuilderTestBase.cs (3)
149Assert.True(builder.TryGetValue("five", out int value) && value == 5); 150Assert.True(builder.TryGetValue("six", out value) && value == 6); 151Assert.False(builder.TryGetValue("four", out value));
Microsoft.CodeAnalysis.Workspaces (16)
Rename\ConflictEngine\ConflictResolver.cs (1)
333if (reverseMappedLocations.TryGetValue(newLocation, out var oldLocation))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.SubstituteTypesVisitor.cs (1)
36if (symbol is TType1 && _map.TryGetValue((TType1)symbol, out var converted))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IDictionaryExtensions.cs (12)
19if (!dictionary.TryGetValue(key, out var value)) 31if (!dictionary.TryGetValue(key, out var value)) 43if (dictionary.TryGetValue(key, out var value)) 67if (!dictionary.TryGetValue(key, out var collection)) 79if (!dictionary.TryGetValue(key, out var builder)) 91if (!dictionary.TryGetValue(key, out var builder)) 103if (dictionary.TryGetValue(key, out var set)) 123if (!dictionary.TryGetValue(key, out var existingArray)) 135if (!dictionary.TryGetValue(key, out var existingArray)) 147if (dictionary.TryGetValue(key, out var collection)) 186if (dictionary.TryGetValue(key, out var collection)) 215if (dictionary.TryGetValue(key, out var collection))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions.cs (2)
275dictionary.TryGetValue(key, out value); 281if (dictionary != null && dictionary.TryGetValue(key, out var symbol))
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (1)
MSBuild\ProjectFile\ProjectFile.cs (1)
67if (!_loadedProject.GlobalProperties.TryGetValue(PropertyNames.TargetFramework, out var initialGlobalTargetFrameworkValue))
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (1)
Workspaces\TestHostDocument.cs (1)
116if (spans.TryGetValue(string.Empty, out var textSpans))
Microsoft.CodeAnalysis.Workspaces.UnitTests (1)
CodeCleanup\CodeCleanupTests.cs (1)
373var expectedResult = namedSpans.TryGetValue("r", out var spans) ? spans : SpecializedCollections.EmptyEnumerable<TextSpan>();
Microsoft.DotNet.ArcadeLogging (2)
PipelinesLogger.cs (2)
204if (!e.Properties.TryGetValue("Category", out string telemetryCategory)) 304if (e.GlobalProperties.TryGetValue("TargetFramework", out string targetFramework))
Microsoft.DotNet.Build.Tasks.Packaging (3)
GenerateRuntimeDependencies.cs (1)
154if (!String.IsNullOrEmpty(targetPackageAlias) && !packageAliases.TryGetValue(targetPackageAlias, out targetPackageId))
GetPackageFromModule.cs (1)
65if (modulesToPackages.TryGetValue(moduleName, out packageId))
HarvestPackage.cs (1)
563if (pathsIncluded.TryGetValue(probePath, out result))
Microsoft.DotNet.Build.Tasks.Templating (1)
GenerateFileFromTemplate.cs (1)
123if (values.TryGetValue(varName, out string value))
Microsoft.DotNet.SwaggerGenerator.CodeGenerator (1)
Modeler\ServiceClientModelFactory.cs (1)
308if (extensions.TryGetValue("x-ms-enum", out IOpenApiExtension ext) && ext is EnumOpenApiExtension enumExtension)
Microsoft.DotNet.VersionTools (3)
Dependencies\BuildManifest\OrchestratedBuildIdentityMatch.cs (1)
49if (!Match.Attributes.TryGetValue(name, out value))
Dependencies\BuildOutput\OrchestratedBuild\OrchestratedBuildUpdateHelpers.cs (1)
28if (match.Match.Attributes.TryGetValue(attributeName, out value))
Util\EnumerableExtensions.cs (1)
15attributes.TryGetValue(key, out value);
Microsoft.DotNet.XliffTasks (1)
Tasks\TransformTemplates.cs (1)
100if (resourceMap.TryGetValue(templateItemFullPath, out ITaskItem unstructuredResource))
Microsoft.Extensions.AI.Abstractions.Tests (1)
AssertExtensions.cs (1)
30if (!actual.TryGetValue(expectedEntry.Key, out object? actualValue))
Microsoft.Extensions.AI.AzureAIInference.Tests (1)
test\Libraries\Microsoft.Extensions.AI.Abstractions.Tests\AssertExtensions.cs (1)
30if (!actual.TryGetValue(expectedEntry.Key, out object? actualValue))
Microsoft.Extensions.AI.Ollama.Tests (1)
test\Libraries\Microsoft.Extensions.AI.Abstractions.Tests\AssertExtensions.cs (1)
30if (!actual.TryGetValue(expectedEntry.Key, out object? actualValue))
Microsoft.Extensions.AI.OpenAI.Tests (1)
test\Libraries\Microsoft.Extensions.AI.Abstractions.Tests\AssertExtensions.cs (1)
30if (!actual.TryGetValue(expectedEntry.Key, out object? actualValue))
Microsoft.Extensions.AI.Tests (1)
test\Libraries\Microsoft.Extensions.AI.Abstractions.Tests\AssertExtensions.cs (1)
30if (!actual.TryGetValue(expectedEntry.Key, out object? actualValue))
Microsoft.Extensions.Configuration (1)
ConfigurationProvider.cs (1)
39=> Data.TryGetValue(key, out value);
Microsoft.Extensions.Configuration.FileExtensions (2)
FileConfigurationExtensions.cs (2)
41if (builder.Properties.TryGetValue(FileProviderKey, out object? provider)) 86if (builder.Properties.TryGetValue(FileLoadExceptionHandlerKey, out object? handler))
Microsoft.Extensions.Configuration.Xml (1)
XmlStreamConfigurationProvider.cs (1)
77if (!parent.ChildrenBySiblingName.TryGetValue(element.SiblingName, out var siblings))
Microsoft.Extensions.Http.Polly (2)
HttpRequestMessageExtensions.cs (1)
36request.Properties.TryGetValue(PolicyExecutionContextKey, out var context);
PolicyHttpMessageHandler.cs (1)
163if (request.Properties.TryGetValue(PriorResponseKey, out var priorResult) && priorResult is IDisposable disposable)
Microsoft.Extensions.Http.Resilience.Tests (1)
Helpers\OptionsUtilities.cs (1)
39if (!propertiesValuesByName2.TryGetValue(propertyName, out var propertyValue2) ||
Microsoft.Extensions.Logging.Console (1)
ConsoleLoggerSettings.cs (1)
43return Switches.TryGetValue(name, out level);
Microsoft.Extensions.Logging.EventSource (1)
LoggingEventSource.cs (1)
355if (!command.Arguments!.TryGetValue("FilterSpecs", out string? filterSpec))
Microsoft.Maui.Controls (1)
Application\Application.cs (1)
432 if (activationState?.State?.TryGetValue(MauiWindowIdKey, out var requestedWindowId) ?? false)
Microsoft.Maui.Controls.Compatibility (3)
iOS\iOSAppLinks.cs (3)
167 if (!deepLinkUri.KeyValues.TryGetValue(nameof(contentType), out contentType)) 170 if (deepLinkUri.KeyValues.TryGetValue(nameof(publicIndex), out publicIndex)) 173 deepLinkUri.KeyValues.TryGetValue(nameof(associatedWebPage), out associatedWebPage);
Microsoft.Maui.Controls.SourceGen (1)
CodeBehindGenerator.cs (1)
497 if (typeCache.TryGetValue(xmlType, out string returnType))
Microsoft.Maui.Essentials (1)
FilePicker\FilePicker.shared.cs (1)
166 if (fileTypes.TryGetValue(platform, out var type))
Microsoft.Maui.Resizetizer (1)
TizenResourceXmlGenerator.cs (1)
71 if (resolutionMap.TryGetValue(resolution, out string dpiRange))
Microsoft.ML.AutoML (1)
TrainerExtensions\TrainerExtensionUtil.cs (1)
214props.TryGetValue(WeightColumn, out var weightColumn);
Microsoft.ML.SearchSpace (2)
Option\NestOption.cs (1)
148return ((IDictionary<string, OptionBase>)_options).TryGetValue(key, out value);
SearchSpace.cs (1)
331return ((IDictionary<string, OptionBase>)_options).TryGetValue(key, out value);
Microsoft.VisualStudio.LanguageServices (1)
CodeLens\CodeLensCallbackListener.cs (1)
237return descriptorContext.Properties.TryGetValue(key, out var guidStringUntyped) &&
Microsoft.VisualStudio.LanguageServices.CSharp (1)
ProjectSystemShim\CSharpProjectShim.OptionsProcessor.cs (1)
111if (ruleSetSpecificDiagnosticOptions.TryGetValue(diagnosticID, out var ruleSetOption))
MSBuild (8)
CommunicationsUtilities.cs (2)
624ErrorUtilities.VerifyThrow(taskHostParameters.TryGetValue(XMakeAttributes.runtime, out string runtimeVersion), "Should always have an explicit runtime when we call this method."); 625ErrorUtilities.VerifyThrow(taskHostParameters.TryGetValue(XMakeAttributes.architecture, out string architecture), "Should always have an explicit architecture when we call this method.");
OutOfProcTaskHostNode.cs (4)
1030environment.TryGetValue(variable.Key, out environmentValue); 1097environment.TryGetValue(variable.Key, out environmentValue); 1146if (!environment.TryGetValue(variable.Key, out newValue)) 1163if (!_savedEnvironment.TryGetValue(variable.Key, out oldValue))
TerminalLogger\TerminalLogger.cs (1)
535if (e.GlobalProperties?.TryGetValue("TargetFramework", out string? targetFramework) != true)
XMake.cs (1)
1623nodeResultKvp.Key.ProjectInstance.GlobalProperties.All(propertyKvp => entryPoint.GlobalProperties.TryGetValue(propertyKvp.Key, out string entryValue) &&
MSBuildTaskHost (6)
CommunicationsUtilities.cs (2)
624ErrorUtilities.VerifyThrow(taskHostParameters.TryGetValue(XMakeAttributes.runtime, out string runtimeVersion), "Should always have an explicit runtime when we call this method."); 625ErrorUtilities.VerifyThrow(taskHostParameters.TryGetValue(XMakeAttributes.architecture, out string architecture), "Should always have an explicit architecture when we call this method.");
OutOfProcTaskHostNode.cs (4)
1030environment.TryGetValue(variable.Key, out environmentValue); 1097environment.TryGetValue(variable.Key, out environmentValue); 1146if (!environment.TryGetValue(variable.Key, out newValue)) 1163if (!_savedEnvironment.TryGetValue(variable.Key, out oldValue))
PresentationCore (4)
MS\Internal\Shaping\TypefaceMap.cs (2)
314if (!_intMaps.TryGetValue(culture, out map)) 373if (!_intMaps.TryGetValue(culture, out map))
System\Windows\Media\CultureSpecificStringDictionary.cs (1)
54return _innerDictionary.TryGetValue(key, out value);
System\Windows\Media\GlyphsSerializer.cs (1)
162!_glyphTypeface.CharacterToGlyphMap.TryGetValue(sourceCharacter, out glyphIndexFromCmap) ||
PresentationFramework (4)
System\Windows\Documents\FixedDocument.cs (1)
422if (_asyncOps.TryGetValue(userState,out asyncRequest))
System\Windows\Documents\FixedSOMTextRun.cs (1)
114gtf.FamilyNames.TryGetValue(run._cultureInfo, out run._fontFamily);
System\Windows\Documents\Glyphs.cs (1)
451glyphTypeface.CharacterToGlyphMap.TryGetValue(character, out glyphIndex);
System\Windows\Markup\XamlTypeMapperSchemaContext.cs (1)
394return dict.TryGetValue(key, out value);
ReachFramework (9)
MS\Internal\Printing\MostFrequentlyUsedCache.cs (2)
23if(!this._dictionary.TryGetValue(key, out entry)) 47if(this._dictionary.TryGetValue(key, out entry))
PrintConfig\PrintSchemaShim.cs (6)
22return dmPaperSizeToPageMediaSize.TryGetValue(paperSizeCode, out pageMediaSizeName); 27return dmResToQResolution.TryGetValue(paperQualityCode, out resolution); 39if (paperSourceOptions.TryGetValue(paperSourceCode, out option)) 69if (mediaTypeOptions.TryGetValue(mediaTypeCode, out option)) 96if (outputQualityOptions.TryGetValue(dmResX, out option)) 1149if (dictionary.TryGetValue(key, out value))
Serialization\XpsFontSubsetter.cs (1)
400if (!_fontEmbeddingManagerCache.TryGetValue(fontUri, out manager))
Shared.Tests (1)
EmptyCollections\EmptyReadonlyDictionaryTests.cs (1)
44Assert.False(dict.TryGetValue(1, out string? value));
System.ComponentModel.Composition (7)
System\ComponentModel\Composition\AttributedModel\AttributedExportDefinition.cs (1)
49if (partMetadata != null && partMetadata.TryGetValue(CompositionConstants.PartCreationPolicyMetadataName, out object? value))
System\ComponentModel\Composition\Hosting\CompositionContainer.cs (1)
572if (!definition.Metadata.TryGetValue(CompositionConstants.ImportSourceMetadataName, out object? source))
System\ComponentModel\Composition\Hosting\CompositionServices.cs (1)
337if (!dictionary.TryGetValue(name, out object? metadataValue))
System\ComponentModel\Composition\Hosting\ScopingExtensions.cs (1)
114if (part.Metadata.TryGetValue(key, out object? untypedValue))
System\ComponentModel\Composition\MetadataServices.cs (1)
33if (metadata.TryGetValue(key, out object? untypedValue) && untypedValue is T t)
System\ComponentModel\Composition\Primitives\ContractBasedImportDefinition.cs (1)
324if (!definition.Metadata.TryGetValue(metadataKey, out object? metadataValue))
System\ComponentModel\Composition\ReflectionModel\PartCreatorExportDefinition.cs (1)
47if (exportDefinition.Metadata.TryGetValue(CompositionConstants.ProductDefinitionMetadataName, out object? productValue))
System.Composition.Hosting (3)
System\Composition\Hosting\Core\CycleBreakingMetadataDictionary.cs (1)
55return ActualMetadata.TryGetValue(key, out value);
System\Composition\Hosting\Core\ExportDescriptorRegistryUpdate.cs (1)
140if (_partDefinitions.TryGetValue(contract, out definitions))
System\Composition\Hosting\Providers\Metadata\MetadataViewProvider.cs (1)
79if (metadata.TryGetValue(name, out result))
System.Composition.Runtime (2)
System\Composition\Hosting\Core\CompositionContract.cs (2)
154if (!_metadataConstraints.TryGetValue(constraintName, out object value)) 188if (!second.TryGetValue(firstItem.Key, out object secondValue))
System.Composition.TypedParts (2)
System\Composition\TypedParts\ActivationFeatures\LifetimeFeature.cs (1)
28if (!partMetadata.TryGetValue(SharingBoundaryPartMetadataName, out sharingBoundaryMetadata))
System\Composition\TypedParts\Discovery\TypeInspector.cs (1)
125if (!metadata.TryGetValue(name, out existingValue))
System.Diagnostics.DiagnosticSource (7)
System\Diagnostics\DiagnosticSourceEventSource.cs (1)
385command.Arguments!.TryGetValue("FilterAndPayloadSpecs", out filterAndPayloadSpecs);
System\Diagnostics\Metrics\MetricsEventSource.cs (6)
403if (command.Arguments!.TryGetValue(ClientIdKey, out string? clientId)) 502if (arguments.TryGetValue("Metrics", out metricsSpecs)) 526if (command.Arguments!.TryGetValue(ClientIdKey, out string? clientIdArg) && !string.IsNullOrEmpty(clientIdArg)) 565if (arguments.TryGetValue(argumentsKey, out string? maxString)) 612if (arguments!.TryGetValue(RefreshIntervalKey, out string? refreshInterval)) 634if (command.Arguments!.TryGetValue("SessionId", out string? id))
System.Private.CoreLib (4)
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\CollectionExtensions.cs (1)
47if (dictionary.TryGetValue(key, out value))
src\libraries\System.Private.CoreLib\src\System\Collections\ObjectModel\ReadOnlyDictionary.cs (2)
48return m_dictionary.TryGetValue(key, out value!); 163if (m_dictionary.TryGetValue((TKey)key, out TValue? value))
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\CounterGroup.cs (1)
56if (!e.Arguments.TryGetValue("EventCounterIntervalSec", out string? valueStr)
System.Private.Windows.Core (1)
System\Private\Windows\BinaryFormat\Deserializer\ObjectRecordDeserializer.cs (1)
70if (!Deserializer.DeserializedObjects.TryGetValue(id, out object? value))
System.Resources.Extensions (1)
System\Resources\Extensions\BinaryFormat\Deserializer\ObjectRecordDeserializer.cs (1)
69if (!Deserializer.DeserializedObjects.TryGetValue(id, out object? value))
System.ServiceModel.NetFramingBase (1)
System\ServiceModel\Security\SecurityUtilsEx.cs (1)
138if (authContext.Properties.TryGetValue(SecurityUtils.Identities, out obj))
System.Windows.Forms (1)
System\Windows\Forms\ComponentModel\COM2Interop\COM2TypeInfoProcessor.cs (1)
507if (!properties.TryGetValue(name, out PropertyInfo? info))
System.Xaml (4)
System\Xaml\MS\Impl\XmlNsInfo.cs (3)
532_subsumeCount.TryGetValue(ns1, out ns1count); 533_subsumeCount.TryGetValue(ns2, out ns2count); 582_subsumeCount.TryGetValue(ns, out currentCount);
System\Xaml\XamlSchemaContext.cs (1)
465if (oldToNewNs.TryGetValue(oldNs, out newNs))
WebPubSubWeb (1)
Program.cs (1)
61if (context.Request.Method != "POST" || !context.Request.Headers.TryGetValue("ce-type", out var eventType))
xunit.assert (1)
DictionaryAsserts.cs (1)
60 if (!collection.TryGetValue(expected, out value))
xunit.console (3)
common\AssemblyResolution\Microsoft.Extensions.DependencyModel\DependencyContextJsonReader.cs (1)
467if (!_stringPool.TryGetValue(s, out result))
common\DictionaryExtensions.cs (1)
25if (!dictionary.TryGetValue(key, out result))
common\Json.cs (1)
738if (!_data.TryGetValue(key, out result))