59 references to AddOrUpdate
Aspire.Dashboard (4)
Components\Pages\Resources.razor.cs (3)
385PageViewModel.ResourceTypesToVisibility.AddOrUpdate(resource.ResourceType, resourceTypeVisible(resource.ResourceType), (_, _) => resourceTypeVisible(resource.ResourceType)); 386PageViewModel.ResourceStatesToVisibility.AddOrUpdate(resource.State ?? string.Empty, stateVisible(resource.State ?? string.Empty), (_, _) => stateVisible(resource.State ?? string.Empty)); 387PageViewModel.ResourceHealthStatusesToVisibility.AddOrUpdate(resource.HealthStatus?.Humanize() ?? string.Empty, healthStatusVisible(resource.HealthStatus?.Humanize() ?? string.Empty), (_, _) => healthStatusVisible(resource.HealthStatus?.Humanize() ?? string.Empty));
Model\Assistant\AssistantChatViewModel.cs (1)
238_toolCallCounts.AddOrUpdate(toolName, 1, (_, count) => count + 1);
dotnet (3)
Commands\Test\MTP\MicrosoftTestingPlatformTestCommand.Help.cs (3)
113_commandLineOptionNameToModuleNames.AddOrUpdate( 119_moduleNamesToCommandLineOptions.AddOrUpdate(true, 123_moduleNamesToCommandLineOptions.AddOrUpdate(false,
GenerateDocumentationAndConfigFiles (4)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\SymbolNamesWithValueOption.cs (4)
315_wildcardMatchResult.AddOrUpdate(symbol, prefixedFirstMatchOrDefault.AsNullable(), (s, match) => prefixedFirstMatchOrDefault.AsNullable()); 325_wildcardMatchResult.AddOrUpdate(symbol, unprefixedFirstMatchOrDefault.AsNullable(), (s, match) => unprefixedFirstMatchOrDefault.AsNullable()); 335_wildcardMatchResult.AddOrUpdate(symbol, partialFirstMatchOrDefault.AsNullable(), (s, match) => partialFirstMatchOrDefault.AsNullable()); 342_wildcardMatchResult.AddOrUpdate(symbol, new KeyValuePair<string?, TValue?>(null, default), (s, match) => new KeyValuePair<string?, TValue?>(null, default));
Microsoft.AspNetCore.SignalR.Core (1)
Internal\HubGroupList.cs (1)
70group.AddOrUpdate(connection.ConnectionId, connection, (_, __) => connection);
Microsoft.Build (3)
BackEnd\Components\SdkResolution\SdkResolverService.cs (1)
559resolverState.AddOrUpdate(resolver, state, (sdkResolver, obj) => state);
Evaluation\ParserIgnoreConfiguration.cs (2)
260destination.AddOrUpdate(kvp.Key, kvp.Value, (_, count) => count + kvp.Value); 266_skippedItems.AddOrUpdate(key, 1, static (_, count) => count + 1);
Microsoft.CodeAnalysis.Analyzers (4)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\SymbolNamesWithValueOption.cs (4)
315_wildcardMatchResult.AddOrUpdate(symbol, prefixedFirstMatchOrDefault.AsNullable(), (s, match) => prefixedFirstMatchOrDefault.AsNullable()); 325_wildcardMatchResult.AddOrUpdate(symbol, unprefixedFirstMatchOrDefault.AsNullable(), (s, match) => unprefixedFirstMatchOrDefault.AsNullable()); 335_wildcardMatchResult.AddOrUpdate(symbol, partialFirstMatchOrDefault.AsNullable(), (s, match) => partialFirstMatchOrDefault.AsNullable()); 342_wildcardMatchResult.AddOrUpdate(symbol, new KeyValuePair<string?, TValue?>(null, default), (s, match) => new KeyValuePair<string?, TValue?>(null, default));
Microsoft.CodeAnalysis.AnalyzerUtilities (4)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\SymbolNamesWithValueOption.cs (4)
315_wildcardMatchResult.AddOrUpdate(symbol, prefixedFirstMatchOrDefault.AsNullable(), (s, match) => prefixedFirstMatchOrDefault.AsNullable()); 325_wildcardMatchResult.AddOrUpdate(symbol, unprefixedFirstMatchOrDefault.AsNullable(), (s, match) => unprefixedFirstMatchOrDefault.AsNullable()); 335_wildcardMatchResult.AddOrUpdate(symbol, partialFirstMatchOrDefault.AsNullable(), (s, match) => partialFirstMatchOrDefault.AsNullable()); 342_wildcardMatchResult.AddOrUpdate(symbol, new KeyValuePair<string?, TValue?>(null, default), (s, match) => new KeyValuePair<string?, TValue?>(null, default));
Microsoft.CodeAnalysis.NetAnalyzers (13)
Microsoft.NetCore.Analyzers\Performance\PreferReadOnlySpanOverSpan.cs (1)
93parameterReferenceCounts.AddOrUpdate(parameter, 1, (_, count) => count + 1);
Microsoft.NetCore.Analyzers\Runtime\DisposableFieldsShouldBeDisposed.cs (1)
80fieldDisposeValueMap.AddOrUpdate(field,
Microsoft.NetCore.Analyzers\Runtime\UseAsyncMethodInAsyncContext.cs (1)
210syncBlockingTypes.AddOrUpdate(key, typeValue, (k, v) => v);
Microsoft.NetCore.Analyzers\Security\PotentialReferenceCycleInDeserializedObjectGraph.cs (4)
185graph.AddOrUpdate(from, new ConcurrentDictionary<ISymbol, bool> { [to] = true }, (k, v) => 190degree.AddOrUpdate(from, 1, (k, v) => v + 1); 235degree.AddOrUpdate(start, -1, (k, v) => v - 1); 239degree.AddOrUpdate(vertex, -1, (k, v) => v - 1);
Microsoft.NetFramework.Analyzers\DoNotUseInsecureDtdProcessingInApiDesign.cs (2)
431_xmlDocumentDerivedTypes.AddOrUpdate(typeSymbol, explicitlyDeclared, (k, v) => explicitlyDeclared); 471_xmlTextReaderDerivedTypes.AddOrUpdate(typeSymbol, explicitlyDeclared,
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\Options\SymbolNamesWithValueOption.cs (4)
314_wildcardMatchResult.AddOrUpdate(symbol, prefixedFirstMatchOrDefault.AsNullable(), (s, match) => prefixedFirstMatchOrDefault.AsNullable()); 325_wildcardMatchResult.AddOrUpdate(symbol, unprefixedFirstMatchOrDefault.AsNullable(), (s, match) => unprefixedFirstMatchOrDefault.AsNullable()); 335_wildcardMatchResult.AddOrUpdate(symbol, partialFirstMatchOrDefault.AsNullable(), (s, match) => partialFirstMatchOrDefault.AsNullable()); 342_wildcardMatchResult.AddOrUpdate(symbol, new KeyValuePair<string?, TValue?>(null, default), (s, match) => new KeyValuePair<string?, TValue?>(null, default));
Microsoft.CodeAnalysis.ResxSourceGenerator (4)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\SymbolNamesWithValueOption.cs (4)
315_wildcardMatchResult.AddOrUpdate(symbol, prefixedFirstMatchOrDefault.AsNullable(), (s, match) => prefixedFirstMatchOrDefault.AsNullable()); 325_wildcardMatchResult.AddOrUpdate(symbol, unprefixedFirstMatchOrDefault.AsNullable(), (s, match) => unprefixedFirstMatchOrDefault.AsNullable()); 335_wildcardMatchResult.AddOrUpdate(symbol, partialFirstMatchOrDefault.AsNullable(), (s, match) => partialFirstMatchOrDefault.AsNullable()); 342_wildcardMatchResult.AddOrUpdate(symbol, new KeyValuePair<string?, TValue?>(null, default), (s, match) => new KeyValuePair<string?, TValue?>(null, default));
Microsoft.Extensions.AI.Evaluation.Reporting (2)
ResponseCachingChatClient.cs (2)
42_ = _stopWatches.AddOrUpdate(key, addValue: stopwatch, updateValueFactory: (_, _) => stopwatch); 75_ = _stopWatches.AddOrUpdate(key, addValue: stopwatch, updateValueFactory: (_, _) => stopwatch);
Microsoft.Extensions.Diagnostics.HealthChecks.Common (1)
ManualHealthCheckTracker.cs (1)
19_ = _checks.AddOrUpdate(check, true, (_, _) => true);
Microsoft.ML.IntegrationTests (1)
Debugging.cs (1)
206Lines.AddOrUpdate(e.Message, 1, (key, oldValue) => oldValue + 1);
Microsoft.TestPlatform.CrossPlatEngine (2)
Client\Parallel\DiscoveryDataAggregator.cs (1)
147_metricsAggregator.AddOrUpdate(
Client\Parallel\ParallelRunDataAggregator.cs (1)
201_metricsAggregator.AddOrUpdate(
NuGet.PackageManagement (1)
Resolution\ResolverGather.cs (1)
477_timeTaken.AddOrUpdate(request.Source.Source.PackageSource.Source, stopWatch.Elapsed, (k, v) => stopWatch.Elapsed + v);
NuGet.Protocol (4)
LegacyFeed\ODataServiceDocumentResourceV2Provider.cs (1)
68_cache.AddOrUpdate(url, cacheEntry, (key, value) => cacheEntry);
Plugins\RequestHandlers\GetCredentialsRequestHandler.cs (1)
91_repositories.AddOrUpdate(
Plugins\RequestHandlers\GetServiceIndexRequestHandler.cs (1)
75_repositories.AddOrUpdate(
Providers\ServiceIndexResourceV3Provider.cs (1)
88_cache.AddOrUpdate(url, cacheEntry, (key, value) => cacheEntry);
Roslyn.Diagnostics.Analyzers (4)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\SymbolNamesWithValueOption.cs (4)
315_wildcardMatchResult.AddOrUpdate(symbol, prefixedFirstMatchOrDefault.AsNullable(), (s, match) => prefixedFirstMatchOrDefault.AsNullable()); 325_wildcardMatchResult.AddOrUpdate(symbol, unprefixedFirstMatchOrDefault.AsNullable(), (s, match) => unprefixedFirstMatchOrDefault.AsNullable()); 335_wildcardMatchResult.AddOrUpdate(symbol, partialFirstMatchOrDefault.AsNullable(), (s, match) => partialFirstMatchOrDefault.AsNullable()); 342_wildcardMatchResult.AddOrUpdate(symbol, new KeyValuePair<string?, TValue?>(null, default), (s, match) => new KeyValuePair<string?, TValue?>(null, default));
System.ComponentModel.TypeConverter (1)
System\ComponentModel\PropertyDescriptor.cs (1)
176_valueChangedHandlers.AddOrUpdate(component, handler, (k, v) => (EventHandler?)Delegate.Combine(v, handler));
System.Net.Http (2)
System\Net\Http\Metrics\MetricsHandler.cs (1)
73_counts.AddOrUpdate(key, 1, static (_, currentValue) => currentValue + 1);
System\Net\Http\SocketsHttpHandler\Metrics\SocketsHttpHandlerMetrics.cs (1)
78_counts.AddOrUpdate(key, 1, static (_, currentValue) => currentValue + 1);
System.Private.Windows.Core.TestUtilities (1)
NoAssertContext.cs (1)
43s_suppressedThreads.AddOrUpdate(Environment.CurrentManagedThreadId, 1, (key, oldValue) => oldValue + 1);