48 references to GetOrAdd
Aspire.Hosting (2)
ApplicationModel\ResourceLoggerService.cs (1)
328_loggers.GetOrAdd(resourceName, (name, context) =>
Dashboard\DashboardLifecycleHook.cs (1)
774var logger = loggerCache.GetOrAdd(logMessage.Category, static (string category, ILoggerFactory loggerFactory) =>
GenerateDocumentationAndConfigFiles (1)
src\Compilers\Core\Portable\InternalUtilities\ConcurrentDictionaryExtensions.cs (1)
32return dictionary.GetOrAdd(key, valueFactory, factoryArgument);
Microsoft.AspNetCore.Components (4)
PersistentState\PersistentServicesRegistry.cs (2)
103var accessors = _cachedAccessorsByType.GetOrAdd(instance.GetType(), static (runtimeType, declaredType) => new PropertiesAccessor(runtimeType, declaredType), type); 130var accessors = _cachedAccessorsByType.GetOrAdd(instance.GetType(), static (runtimeType, declaredType) => new PropertiesAccessor(runtimeType, declaredType), type);
PersistentState\PersistentValueProviderComponentSubscription.cs (1)
65_customSerializer = _serializerCache.GetOrAdd(_propertyType, SerializerFactory, serviceProvider);
src\Components\Shared\src\RootTypeCache.cs (1)
28return _typeToKeyLookUp.GetOrAdd(key, ResolveType, AppDomain.CurrentDomain.GetAssemblies());
Microsoft.AspNetCore.Components.Endpoints (2)
FormMapping\FormDataMapperOptions.cs (2)
55return (FormDataConverter<T>)_converters.GetOrAdd(typeof(T), CreateConverter, this); 77return _converters.GetOrAdd(type, CreateConverter, this);
Microsoft.AspNetCore.Components.Server (2)
src\Components\Shared\src\ComponentParametersTypeCache.cs (1)
23return _typeToKeyLookUp.GetOrAdd(key, ResolveType, AppDomain.CurrentDomain.GetAssemblies());
src\Components\Shared\src\RootTypeCache.cs (1)
28return _typeToKeyLookUp.GetOrAdd(key, ResolveType, AppDomain.CurrentDomain.GetAssemblies());
Microsoft.AspNetCore.Components.WebAssembly (2)
src\Components\Shared\src\ComponentParametersTypeCache.cs (1)
23return _typeToKeyLookUp.GetOrAdd(key, ResolveType, AppDomain.CurrentDomain.GetAssemblies());
src\Components\Shared\src\RootTypeCache.cs (1)
28return _typeToKeyLookUp.GetOrAdd(key, ResolveType, AppDomain.CurrentDomain.GetAssemblies());
Microsoft.AspNetCore.Diagnostics.Middleware (1)
Logging\IncomingHttpRouteUtility.cs (1)
63return _parametersToRedactCache.GetOrAdd(httpRoute, static (_, paramsToRedact) => paramsToRedact.ToFrozenDictionary(StringComparer.Ordinal), parametersToRedact);
Microsoft.AspNetCore.Grpc.JsonTranscoding (2)
Internal\Json\EnumNameHelpers.cs (1)
51return _enumMappings.GetOrAdd(
src\Grpc\JsonTranscoding\src\Shared\Server\InterceptorActivators.cs (1)
38return _cachedActivators.GetOrAdd<IServiceProvider>(type, CreateActivator, _serviceProvider);
Microsoft.AspNetCore.HeaderParsing (1)
HeaderRegistry.cs (1)
32return (HeaderKey<T>)_headerKeys.GetOrAdd(id, CreateKey<T>, parser);
Microsoft.AspNetCore.Http.Extensions (2)
src\Components\Endpoints\src\FormMapping\FormDataMapperOptions.cs (2)
55return (FormDataConverter<T>)_converters.GetOrAdd(typeof(T), CreateConverter, this); 77return _converters.GetOrAdd(type, CreateConverter, this);
Microsoft.CodeAnalysis (3)
CodeGen\PrivateImplementationDetails.cs (2)
297return _mappedFields.GetOrAdd((data, alignment), static (key, @this) => 339return @this._dataSectionStringLiteralTypes.GetOrAdd(text, static (text, arg) =>
InternalUtilities\ConcurrentDictionaryExtensions.cs (1)
32return dictionary.GetOrAdd(key, valueFactory, factoryArgument);
Microsoft.CodeAnalysis.CSharp (2)
Symbols\AnonymousTypes\AnonymousTypeManager.Templates.cs (1)
244var namedTemplate = this.AnonymousDelegates.GetOrAdd(
Symbols\Metadata\PE\PENamedTypeSymbol.cs (1)
489return uncommon.LazyImplementationMap.GetOrAdd(method, findCorrespondingExtensionImplementationMethod, this);
Microsoft.CodeAnalysis.CSharp.Features (1)
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\CSharpRemoveUnnecessaryNullableDirectiveDiagnosticAnalyzer.cs (1)
319return _codeBlockIntervals.GetOrAdd(
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider.Utilities (1)
Debugger\Engine\DkmClrType.cs (1)
194return appDomain.TypeToEvalAttributesMap.GetOrAdd(
Microsoft.CodeAnalysis.LanguageServer.Protocol (2)
Handler\Diagnostics\AbstractPullDiagnosticHandler.cs (1)
121var versionedCache = _categoryToVersionedCache.GetOrAdd(
Handler\PullHandlers\VersionedPullCache.cs (1)
75var cacheEntry = _idToLastReportedResult.GetOrAdd(
Microsoft.CodeAnalysis.UnitTests (2)
InternalUtilities\ConcurrentDictionaryExtensionsTests.cs (2)
31Assert.Same(first, dictionary.GetOrAdd(0, static (key, arg) => arg, first)); 34Assert.Same(first, dictionary.GetOrAdd(0, static (key, arg) => arg, second));
Microsoft.CodeAnalysis.Workspaces (3)
FindSymbols\FindReferences\FindReferenceCache.cs (1)
93=> _symbolInfoCache.GetOrAdd(node, static (n, arg) => arg.SemanticModel.GetSymbolInfo(n, arg.cancellationToken), (SemanticModel, cancellationToken));
src\Compilers\Core\Portable\InternalUtilities\ConcurrentDictionaryExtensions.cs (1)
32return dictionary.GetOrAdd(key, valueFactory, factoryArgument);
Workspace\Solution\SolutionState.cs (1)
1214return _lazyFilePathToRelatedDocumentIds.GetOrAdd(filePath, ComputeDocumentIdsWithFilePath, this);
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (1)
src\Compilers\Core\Portable\InternalUtilities\ConcurrentDictionaryExtensions.cs (1)
32return dictionary.GetOrAdd(key, valueFactory, factoryArgument);
Microsoft.Extensions.DependencyInjection (2)
ServiceLookup\Expressions\ExpressionResolverBuilder.cs (1)
64return _scopeResolverCache.GetOrAdd(callSite.Cache.Key, _buildTypeDelegate, callSite);
ServiceLookup\ILEmit\ILEmitResolverBuilder.cs (1)
79return _scopeResolverCache.GetOrAdd(callSite.Cache.Key, _buildTypeDelegate, callSite);
Microsoft.Extensions.Options (2)
OptionsCache.cs (2)
39value = _cache.GetOrAdd(name, static (name, createOptions) => new Lazy<TOptions>(createOptions), createOptions); 66return _cache.GetOrAdd(
Microsoft.Extensions.ServiceDiscovery (2)
Http\HttpServiceEndpointResolver.cs (1)
45var resolver = _resolvers.GetOrAdd(
ServiceEndpointResolver.cs (1)
53var resolver = _resolvers.GetOrAdd(
Microsoft.JSInterop (1)
Infrastructure\DotNetDispatcher.cs (1)
373var converterDelegate = _cachedConvertToTaskByType.GetOrAdd(type, (Type t, MethodInfo taskConverterMethodInfo) =>
System.Text.Json (2)
System\Text\Json\Serialization\JsonSerializerOptions.Caching.cs (1)
252return _cache.GetOrAdd(type, CreateCacheEntry, this);
System\Text\Json\Serialization\Metadata\ReflectionEmitCachingMemberAccessor.Cache.cs (1)
31CacheEntry entry = _cache.GetOrAdd(
Templates.Blazor.WebAssembly.Auth.Tests (1)
src\Shared\E2ETesting\BrowserFixture.cs (1)
126return _browsers.GetOrAdd(isolationContext, CreateBrowser, output);
Templates.Blazor.WebAssembly.Tests (1)
src\Shared\E2ETesting\BrowserFixture.cs (1)
126return _browsers.GetOrAdd(isolationContext, CreateBrowser, output);
Templates.Mvc.Tests (1)
src\Shared\E2ETesting\BrowserFixture.cs (1)
126return _browsers.GetOrAdd(isolationContext, CreateBrowser, output);
Templates.Tests (1)
src\Shared\E2ETesting\BrowserFixture.cs (1)
126return _browsers.GetOrAdd(isolationContext, CreateBrowser, output);
Test.Utilities (1)
src\Compilers\Core\Portable\InternalUtilities\ConcurrentDictionaryExtensions.cs (1)
32return dictionary.GetOrAdd(key, valueFactory, factoryArgument);