50 references to TryAdd
Microsoft.AspNetCore.Authorization (5)
AuthorizationServiceCollectionExtensions.cs (5)
30services.TryAdd(ServiceDescriptor.Transient<IAuthorizationService, DefaultAuthorizationService>()); 31services.TryAdd(ServiceDescriptor.Transient<IAuthorizationPolicyProvider, DefaultAuthorizationPolicyProvider>()); 32services.TryAdd(ServiceDescriptor.Transient<IAuthorizationHandlerProvider, DefaultAuthorizationHandlerProvider>()); 33services.TryAdd(ServiceDescriptor.Transient<IAuthorizationEvaluator, DefaultAuthorizationEvaluator>()); 34services.TryAdd(ServiceDescriptor.Transient<IAuthorizationHandlerContextFactory, DefaultAuthorizationHandlerContextFactory>());
Microsoft.AspNetCore.Cors (2)
CorsServiceCollectionExtensions.cs (2)
25services.TryAdd(ServiceDescriptor.Transient<ICorsService, CorsService>()); 26services.TryAdd(ServiceDescriptor.Transient<ICorsPolicyProvider, DefaultCorsPolicyProvider>());
Microsoft.AspNetCore.Mvc.Core (1)
DependencyInjection\MvcCoreServiceCollectionExtensions.cs (1)
209services.TryAdd(ServiceDescriptor.Transient<ICompositeMetadataDetailsProvider>(s =>
Microsoft.AspNetCore.Mvc.Localization (3)
MvcLocalizationServices.cs (3)
41services.TryAdd(ServiceDescriptor.Singleton<IHtmlLocalizerFactory, HtmlLocalizerFactory>()); 42services.TryAdd(ServiceDescriptor.Transient(typeof(IHtmlLocalizer<>), typeof(HtmlLocalizer<>))); 43services.TryAdd(ServiceDescriptor.Transient<IViewLocalizer, ViewLocalizer>());
Microsoft.AspNetCore.Routing (1)
DependencyInjection\RoutingServiceCollectionExtensions.cs (1)
59services.TryAdd(ServiceDescriptor.Transient<TreeRouteBuilder>(s =>
Microsoft.Extensions.Caching.Memory (2)
MemoryCacheServiceCollectionExtensions.cs (2)
27services.TryAdd(ServiceDescriptor.Singleton<IMemoryCache, MemoryCache>()); 71services.TryAdd(ServiceDescriptor.Singleton<IDistributedCache, MemoryDistributedCache>());
Microsoft.Extensions.DependencyInjection.Abstractions (27)
Extensions\ServiceCollectionDescriptorExtensions.cs (14)
95collection.TryAdd(d); 113TryAdd(collection, descriptor); 134TryAdd(collection, descriptor); 155TryAdd(collection, descriptor); 202services.TryAdd(ServiceDescriptor.Transient(implementationFactory)); 219TryAdd(collection, descriptor); 240TryAdd(collection, descriptor); 261TryAdd(collection, descriptor); 308services.TryAdd(ServiceDescriptor.Scoped(implementationFactory)); 325TryAdd(collection, descriptor); 346TryAdd(collection, descriptor); 367TryAdd(collection, descriptor); 416TryAdd(collection, descriptor); 432services.TryAdd(ServiceDescriptor.Singleton(implementationFactory));
Extensions\ServiceCollectionDescriptorExtensions.Keyed.cs (13)
28ServiceCollectionDescriptorExtensions.TryAdd(collection, descriptor); 51ServiceCollectionDescriptorExtensions.TryAdd(collection, descriptor); 74ServiceCollectionDescriptorExtensions.TryAdd(collection, descriptor); 125services.TryAdd(ServiceDescriptor.KeyedTransient(serviceKey, implementationFactory)); 144ServiceCollectionDescriptorExtensions.TryAdd(collection, descriptor); 167ServiceCollectionDescriptorExtensions.TryAdd(collection, descriptor); 190ServiceCollectionDescriptorExtensions.TryAdd(collection, descriptor); 241services.TryAdd(ServiceDescriptor.KeyedScoped(serviceKey, implementationFactory)); 260ServiceCollectionDescriptorExtensions.TryAdd(collection, descriptor); 283ServiceCollectionDescriptorExtensions.TryAdd(collection, descriptor); 306ServiceCollectionDescriptorExtensions.TryAdd(collection, descriptor); 358ServiceCollectionDescriptorExtensions.TryAdd(collection, descriptor); 376services.TryAdd(ServiceDescriptor.KeyedSingleton(serviceKey, implementationFactory));
Microsoft.Extensions.Http (2)
DependencyInjection\HttpClientFactoryServiceCollectionExtensions.cs (2)
47services.TryAdd(ServiceDescriptor.Transient(typeof(ITypedHttpClientFactory<>), typeof(DefaultTypedHttpClientFactory<>))); 48services.TryAdd(ServiceDescriptor.Singleton(typeof(DefaultTypedHttpClientFactory<>.Cache), typeof(DefaultTypedHttpClientFactory<>.Cache)));
Microsoft.Extensions.Logging (2)
LoggingServiceCollectionExtensions.cs (2)
38services.TryAdd(ServiceDescriptor.Singleton<ILoggerFactory, LoggerFactory>()); 39services.TryAdd(ServiceDescriptor.Singleton(typeof(ILogger<>), typeof(Logger<>)));
Microsoft.Extensions.Options (5)
OptionsServiceCollectionExtensions.cs (5)
26services.TryAdd(ServiceDescriptor.Singleton(typeof(IOptions<>), typeof(UnnamedOptionsManager<>))); 27services.TryAdd(ServiceDescriptor.Scoped(typeof(IOptionsSnapshot<>), typeof(OptionsManager<>))); 28services.TryAdd(ServiceDescriptor.Singleton(typeof(IOptionsMonitor<>), typeof(OptionsMonitor<>))); 29services.TryAdd(ServiceDescriptor.Transient(typeof(IOptionsFactory<>), typeof(OptionsFactory<>))); 30services.TryAdd(ServiceDescriptor.Singleton(typeof(IOptionsMonitorCache<>), typeof(OptionsCache<>)));