共用方式為


IServiceCollection 介面

定義

指定服務描述元集合的合約。

public interface class IServiceCollection : System::Collections::Generic::ICollection<Microsoft::Extensions::DependencyInjection::ServiceDescriptor ^>, System::Collections::Generic::IEnumerable<Microsoft::Extensions::DependencyInjection::ServiceDescriptor ^>, System::Collections::Generic::IList<Microsoft::Extensions::DependencyInjection::ServiceDescriptor ^>
public interface IServiceCollection : System.Collections.Generic.ICollection<Microsoft.Extensions.DependencyInjection.ServiceDescriptor>, System.Collections.Generic.IEnumerable<Microsoft.Extensions.DependencyInjection.ServiceDescriptor>, System.Collections.Generic.IList<Microsoft.Extensions.DependencyInjection.ServiceDescriptor>
type IServiceCollection = interface
    interface IList<ServiceDescriptor>
    interface ICollection<ServiceDescriptor>
    interface seq<ServiceDescriptor>
    interface IEnumerable
Public Interface IServiceCollection
Implements ICollection(Of ServiceDescriptor), IEnumerable(Of ServiceDescriptor), IList(Of ServiceDescriptor)
衍生
實作

屬性

名稱 Description
Count

得到包含於 的 ICollection<T>元素數量。

(繼承來源 ICollection<T>)
IsReadOnly

取得值,指出 ICollection<T> 是否為唯讀。

(繼承來源 ICollection<T>)
Item[Int32]

取得或設定位於指定索引處的專案。

(繼承來源 IList<T>)

方法

名稱 Description
Add(T)

將一個項目加入 ICollection<T>

(繼承來源 ICollection<T>)
Clear()

移除所有項目。ICollection<T>

(繼承來源 ICollection<T>)
Contains(T)

判斷是否 ICollection<T> 包含特定值。

(繼承來源 ICollection<T>)
CopyTo(T[], Int32)

從特定 ICollection<T> 索引開始,將 Array 的專案複製到 Array

(繼承來源 ICollection<T>)
GetEnumerator()

傳回逐一查看集合的列舉值。

(繼承來源 IEnumerable)
IndexOf(T)

決定特定項目的 IList<T>索引。

(繼承來源 IList<T>)
Insert(Int32, T)

在指定的索引處插入一個項目 IList<T>

(繼承來源 IList<T>)
Remove(T)

移除特定物件 ICollection<T>首次出現的 。

(繼承來源 ICollection<T>)
RemoveAt(Int32)

移除 IList<T> 指定索引的項目。

(繼承來源 IList<T>)

擴充方法

名稱 Description
ActivateKeyedSingleton(IServiceCollection, Type, Object)

在啟動時,而不是在運行時間強制執行金鑰式單一啟用。

ActivateKeyedSingleton<TService>(IServiceCollection, Object)

在啟動時,而不是在運行時間強制執行金鑰式單一啟用。

ActivateSingleton(IServiceCollection, Type)

在啟動時,而不是在運行時間強制執行單一啟用。

ActivateSingleton<TService>(IServiceCollection)

在啟動時,而不是在運行時間強制執行單一啟用。

Add(IServiceCollection, IEnumerable<ServiceDescriptor>)

在 中加入 的ServiceDescriptor序列。collection

Add(IServiceCollection, ServiceDescriptor)

將指定的 descriptorcollection加入 。

AddActivatedKeyedSingleton(IServiceCollection, Type, Object, Func<IServiceProvider,Object,Object>)

新增自動啟動的索引鍵單一服務。

AddActivatedKeyedSingleton(IServiceCollection, Type, Object, Type)

新增自動啟動的索引鍵單一服務。

AddActivatedKeyedSingleton(IServiceCollection, Type, Object)

新增自動啟動的索引鍵單一服務。

AddActivatedKeyedSingleton<TService,TImplementation>(IServiceCollection, Object, Func<IServiceProvider,Object,TImplementation>)

新增自動啟動的索引鍵單一服務。

AddActivatedKeyedSingleton<TService,TImplementation>(IServiceCollection, Object)

新增自動啟動的索引鍵單一服務。

AddActivatedKeyedSingleton<TService>(IServiceCollection, Object, Func<IServiceProvider,Object,TService>)

新增自動啟動的索引鍵單一服務。

AddActivatedKeyedSingleton<TService>(IServiceCollection, Object)

新增自動啟動的索引鍵單一服務。

AddActivatedSingleton(IServiceCollection, Type, Func<IServiceProvider,Object>)

新增自動啟動的單一服務。

AddActivatedSingleton(IServiceCollection, Type, Type)

新增自動啟動的單一服務。

AddActivatedSingleton(IServiceCollection, Type)

將 serviceType 中指定的自動啟用單例服務加入 IServiceCollection

AddActivatedSingleton<TService,TImplementation>(IServiceCollection, Func<IServiceProvider,TImplementation>)

新增自動啟動的單一服務。

AddActivatedSingleton<TService,TImplementation>(IServiceCollection)

新增自動啟動的單一服務。

AddActivatedSingleton<TService>(IServiceCollection, Func<IServiceProvider,TService>)

新增自動啟動的單一服務。

AddActivatedSingleton<TService>(IServiceCollection)

新增自動啟動的單一服務。

AddApplicationLogEnricher(IServiceCollection, Action<ApplicationLogEnricherOptions>)

將應用增益器實例加入 IServiceCollection

AddApplicationLogEnricher(IServiceCollection, IConfigurationSection)

將應用增益器實例加入 IServiceCollection

AddApplicationLogEnricher(IServiceCollection)

將應用增益器實例加入 IServiceCollection

AddApplicationMetadata(IServiceCollection, Action<ApplicationMetadata>)

將 的 ApplicationMetadata 實例加入到相依注入容器中。

AddApplicationMetadata(IServiceCollection, IConfigurationSection)

將 的 ApplicationMetadata 實例加入到相依注入容器中。

AddAsyncState(IServiceCollection)

新增 IAsyncStateIAsyncContext<T>Microsoft.Extensions.AsyncState.IAsyncLocalContext`1 服務的預設實作。 請注意,這些介面的實作不是安全線程。

AddBuildMetadata(IServiceCollection, Action<BuildMetadata>)

在 中加入一個BuildMetadata實例。IServiceCollection

AddBuildMetadata(IServiceCollection, IConfigurationSection)

在 中加入一個BuildMetadata實例。IServiceCollection

AddChatClient(IServiceCollection, Func<IServiceProvider,IChatClient>, ServiceLifetime)

在 中登記一個單例IChatClientIServiceCollection

AddChatClient(IServiceCollection, IChatClient, ServiceLifetime)

在 中登記一個單例IChatClientIServiceCollection

AddConsoleLatencyDataExporter(IServiceCollection, Action<LatencyConsoleOptions>)

為主控台新增延遲數據匯出工具。

AddConsoleLatencyDataExporter(IServiceCollection, IConfigurationSection)

為主控台新增延遲數據匯出工具。

AddConsoleLatencyDataExporter(IServiceCollection)

為主控台新增延遲數據匯出工具。

AddContextualOptions(IServiceCollection)

新增使用關係型選項所需的服務。

AddDistributedMemoryCache(IServiceCollection, Action<MemoryDistributedCacheOptions>)

新增一個預設實作 IDistributedCache ,將項目儲存在記憶體中到 IServiceCollection. 需要分散式快取運作的架構可以安全地新增此相依性作為其相依性清單的一部分,以確保至少有一個實作可供使用。

AddDistributedMemoryCache(IServiceCollection)

新增一個預設實作 IDistributedCache ,將項目儲存在記憶體中到 IServiceCollection. 需要分散式快取運作的架構可以安全地新增此相依性作為其相依性清單的一部分,以確保至少有一個實作可供使用。

AddDistributedRedisCache(IServiceCollection, Action<RedisCacheOptions>)

新增 Redis 分散式快取服務至指定 IServiceCollection

AddDistributedSqlServerCache(IServiceCollection, Action<SqlServerCacheOptions>)

在指定的 IServiceCollection 中新增Microsoft SQL Server分散式快取服務。

AddDownstreamDependencyMetadata(IServiceCollection, IDownstreamDependencyMetadata)

新增相依性元數據。

AddDownstreamDependencyMetadata<T>(IServiceCollection)

新增相依性元數據。

AddEmbeddingGenerator<TInput,TEmbedding>(IServiceCollection, Func<IServiceProvider,IEmbeddingGenerator<TInput,TEmbedding>>, ServiceLifetime)

在 中註冊一個單例嵌入產生元。IServiceCollection

AddEmbeddingGenerator<TInput,TEmbedding>(IServiceCollection, IEmbeddingGenerator<TInput,TEmbedding>, ServiceLifetime)

在 中註冊一個單例嵌入產生元。IServiceCollection

AddExceptionSummarizer(IServiceCollection, Action<IExceptionSummarizationBuilder>)

將例外狀況摘要器註冊至相依性插入容器。

AddExceptionSummarizer(IServiceCollection)

將例外狀況摘要器註冊至相依性插入容器。

AddExtendedHttpClientLogging(IServiceCollection, Action<LoggingOptions>)

新增 以 IHttpClientAsyncLogger 發送所有使用 IHttpClientFactoryHTTP 用戶端的外出請求日誌。

AddExtendedHttpClientLogging(IServiceCollection, IConfigurationSection)

新增 以 IHttpClientAsyncLogger 發送所有使用 IHttpClientFactoryHTTP 用戶端的外出請求日誌。

AddExtendedHttpClientLogging(IServiceCollection)

新增 以 IHttpClientAsyncLogger 發送所有使用 IHttpClientFactoryHTTP 用戶端的外出請求日誌。

AddFakeLogging(IServiceCollection, Action<FakeLogCollectorOptions>)

設定假記錄。

AddFakeLogging(IServiceCollection, IConfigurationSection)

設定假記錄。

AddFakeLogging(IServiceCollection)

使用預設選項設定假記錄。

AddFakeRedaction(IServiceCollection, Action<FakeRedactorOptions>)

註冊一律傳回假的 redactor 實例的假重構函式提供者。

AddFakeRedaction(IServiceCollection)

註冊一律傳回假的 redactor 實例的假重構函式提供者。

AddHealthChecks(IServiceCollection)

將 加入 HealthCheckService 容器,利用提供的代理來登錄健康檢查。

AddHostedService<THostedService>(IServiceCollection, Func<IServiceProvider,THostedService>)

為該類型新增 IHostedService 註冊。

AddHostedService<THostedService>(IServiceCollection)

為該類型新增 IHostedService 註冊。

AddHttpClient(IServiceCollection, String, Action<HttpClient>)

將 及相關服務加入 IHttpClientFactoryIServiceCollection 並配置一個命名 HttpClient的 。

AddHttpClient(IServiceCollection, String, Action<IServiceProvider,HttpClient>)

將 及相關服務加入 IHttpClientFactoryIServiceCollection 並配置一個命名 HttpClient的 。

AddHttpClient(IServiceCollection, String)

將 及相關服務加入 IHttpClientFactoryIServiceCollection 並配置一個命名 HttpClient的 。

AddHttpClient(IServiceCollection)

新增 及 IHttpClientFactory 相關服務至 IServiceCollection

AddHttpClient<TClient,TImplementation>(IServiceCollection, Action<HttpClient>)

IHttpClientFactory 及相關服務加入 ,IServiceCollection並在型別與命名 HttpClient之間配置綁定TClient。 客戶端名稱會被設定為型別名稱 TClient

AddHttpClient<TClient,TImplementation>(IServiceCollection, Action<IServiceProvider,HttpClient>)

IHttpClientFactory 及相關服務加入 ,IServiceCollection並在型別與命名 HttpClient之間配置綁定TClient。 客戶端名稱會被設定為型別名稱 TClient

AddHttpClient<TClient,TImplementation>(IServiceCollection, Func<HttpClient,IServiceProvider,TImplementation>)

IHttpClientFactory 及相關服務加入 ,IServiceCollection並在型別與命名 HttpClient之間配置綁定TClient

AddHttpClient<TClient,TImplementation>(IServiceCollection, Func<HttpClient,TImplementation>)

IHttpClientFactory 及相關服務加入 ,IServiceCollection並在型別與命名 HttpClient之間配置綁定TClient

AddHttpClient<TClient,TImplementation>(IServiceCollection, String, Action<HttpClient>)

IHttpClientFactory 及相關服務加入 ,IServiceCollection並在型別與命名 HttpClient之間配置綁定TClient

AddHttpClient<TClient,TImplementation>(IServiceCollection, String, Action<IServiceProvider,HttpClient>)

IHttpClientFactory 及相關服務加入 ,IServiceCollection並在型別與命名 HttpClient之間配置綁定TClient

AddHttpClient<TClient,TImplementation>(IServiceCollection, String, Func<HttpClient,IServiceProvider,TImplementation>)

IHttpClientFactory 及相關服務加入 ,IServiceCollection並在型別與命名 HttpClient之間配置綁定TClient

AddHttpClient<TClient,TImplementation>(IServiceCollection, String, Func<HttpClient,TImplementation>)

IHttpClientFactory 及相關服務加入 ,IServiceCollection並在型別與命名 HttpClient之間配置綁定TClient

AddHttpClient<TClient,TImplementation>(IServiceCollection, String)

IHttpClientFactory 及相關服務加入 ,IServiceCollection並在型別與命名 HttpClient之間配置綁定TClient

AddHttpClient<TClient,TImplementation>(IServiceCollection)

IHttpClientFactory 及相關服務加入 ,IServiceCollection並在型別與命名 HttpClient之間配置綁定TClient。 客戶端名稱會被設定為型別名稱 TClient

AddHttpClient<TClient>(IServiceCollection, Action<HttpClient>)

IHttpClientFactory 及相關服務加入 ,IServiceCollection並在型別與命名 HttpClient之間配置綁定TClient。 客戶端名稱會被設定為型別名稱 TClient

AddHttpClient<TClient>(IServiceCollection, Action<IServiceProvider,HttpClient>)

IHttpClientFactory 及相關服務加入 ,IServiceCollection並在型別與命名 HttpClient之間配置綁定TClient。 客戶端名稱會被設定為型別名稱 TClient

AddHttpClient<TClient>(IServiceCollection, String, Action<HttpClient>)

IHttpClientFactory 及相關服務加入 ,IServiceCollection並在型別與命名 HttpClient之間配置綁定TClient

AddHttpClient<TClient>(IServiceCollection, String, Action<IServiceProvider,HttpClient>)

IHttpClientFactory 及相關服務加入 ,IServiceCollection並在型別與命名 HttpClient之間配置綁定TClient

AddHttpClient<TClient>(IServiceCollection, String)

IHttpClientFactory 及相關服務加入 ,IServiceCollection並在型別與命名 HttpClient之間配置綁定TClient

AddHttpClient<TClient>(IServiceCollection)

IHttpClientFactory 及相關服務加入 ,IServiceCollection並在型別與命名 HttpClient之間配置綁定TClient。 客戶端名稱會被設定為型別名稱 TClient

AddHttpClientLatencyTelemetry(IServiceCollection, Action<HttpClientLatencyTelemetryOptions>)

新增 a DelegatingHandler 以收集延遲資訊並豐富所有 HTTP 用戶端的外出請求日誌。

AddHttpClientLatencyTelemetry(IServiceCollection, IConfigurationSection)

新增 a DelegatingHandler 以收集延遲資訊並豐富所有 HTTP 用戶端的外出請求日誌。

AddHttpClientLatencyTelemetry(IServiceCollection)

新增 a DelegatingHandler 以收集延遲資訊並豐富所有 HTTP 用戶端的外出請求日誌。

AddHttpClientLogEnricher<T>(IServiceCollection)

為豐富日誌加入一個更豐富的實例 TIServiceCollectionHttpClient

AddImageGenerator(IServiceCollection, Func<IServiceProvider,IImageGenerator>, ServiceLifetime)

在 中登記一個單例IImageGeneratorIServiceCollection

AddImageGenerator(IServiceCollection, IImageGenerator, ServiceLifetime)

在 中登記一個單例IImageGeneratorIServiceCollection

AddKeyedChatClient(IServiceCollection, Object, Func<IServiceProvider,IChatClient>, ServiceLifetime)

在 中註冊一個帶鍵的單例IChatClientIServiceCollection

AddKeyedChatClient(IServiceCollection, Object, IChatClient, ServiceLifetime)

在 中註冊一個帶鍵的單例IChatClientIServiceCollection

AddKeyedEmbeddingGenerator<TInput,TEmbedding>(IServiceCollection, Object, Func<IServiceProvider,IEmbeddingGenerator<TInput,TEmbedding>>, ServiceLifetime)

在 中註冊一個帶鍵控的單例嵌入產生器。IServiceCollection

AddKeyedEmbeddingGenerator<TInput,TEmbedding>(IServiceCollection, Object, IEmbeddingGenerator<TInput,TEmbedding>, ServiceLifetime)

在 中註冊一個帶鍵控的單例嵌入產生器。IServiceCollection

AddKeyedImageGenerator(IServiceCollection, Object, Func<IServiceProvider,IImageGenerator>, ServiceLifetime)

在 中註冊一個帶鍵的單例IImageGeneratorIServiceCollection

AddKeyedImageGenerator(IServiceCollection, Object, IImageGenerator, ServiceLifetime)

在 中註冊一個帶鍵的單例IImageGeneratorIServiceCollection

AddKeyedScoped(IServiceCollection, Type, Object, Func<IServiceProvider,Object,Object>)

在指定的 IServiceCollection中加入一個類型的範圍服務serviceType,並指定工廠implementationFactory

AddKeyedScoped(IServiceCollection, Type, Object, Type)

新增一個指定類型的 serviceType 有作用域服務,並以指定類型實作 implementationType 加入指定的 IServiceCollection

AddKeyedScoped(IServiceCollection, Type, Object)

將指定類型中指定的 serviceType 作用域服務加入 IServiceCollection

AddKeyedScoped<TService,TImplementation>(IServiceCollection, Object, Func<IServiceProvider,Object,TImplementation>)

在指定IServiceCollection工廠中新增一個類型為 的TService有作用域服務,並使用在 中implementationFactory指定的工廠中指定TImplementation實作類型。

AddKeyedScoped<TService,TImplementation>(IServiceCollection, Object)

在指定的 IServiceCollection中加入一個類型為 的 TService scoped 服務,並對 中指定的TImplementation實作類型。

AddKeyedScoped<TService>(IServiceCollection, Object, Func<IServiceProvider,Object,TService>)

在指定的 IServiceCollection中加入一個類型的範圍服務TService,並指定工廠implementationFactory

AddKeyedScoped<TService>(IServiceCollection, Object)

將指定類型中指定的 TService 作用域服務加入 IServiceCollection

AddKeyedSingleton(IServiceCollection, Type, Object, Func<IServiceProvider,Object,Object>)

將一個與 中serviceType指定的類型相同的單例服務,IServiceCollection並加上 中implementationFactory指定的工廠。

AddKeyedSingleton(IServiceCollection, Type, Object, Object)

將一個類型與 中 serviceType 指定的單例服務,並以 中指定的 implementationInstance 實例加入 IServiceCollection指定的服務。

AddKeyedSingleton(IServiceCollection, Type, Object, Type)

將 中 serviceType 指定的類型中單一服務,並以 中指定的 implementationType 實作加入 IServiceCollection

AddKeyedSingleton(IServiceCollection, Type, Object)

將指定型別 serviceType 的單例服務加入指定的 IServiceCollection

AddKeyedSingleton<TService,TImplementation>(IServiceCollection, Object, Func<IServiceProvider,Object,TImplementation>)

新增一個 所TService指定的單例服務,並使用中指定的implementationFactory工廠,並加入 中指定的TImplementation實作類型。IServiceCollection

AddKeyedSingleton<TService,TImplementation>(IServiceCollection, Object)

將一個與 中 TService 指定的類型相同的單例服務,以及 中 TImplementation 指定的實作類型,加入 IServiceCollection指定的 。

AddKeyedSingleton<TService>(IServiceCollection, Object, Func<IServiceProvider,Object,TService>)

將一個與 中TService指定的類型相同的單例服務,IServiceCollection並加上 中implementationFactory指定的工廠。

AddKeyedSingleton<TService>(IServiceCollection, Object, TService)

將一個類型與 中 TService 指定的單例服務,並以 中指定的 implementationInstance 實例加入 IServiceCollection指定的服務。

AddKeyedSingleton<TService>(IServiceCollection, Object)

將指定型別 TService 的單例服務加入指定的 IServiceCollection

AddKeyedSpeechToTextClient(IServiceCollection, Object, Func<IServiceProvider,ISpeechToTextClient>, ServiceLifetime)

在 中註冊一個帶鍵的單例ISpeechToTextClientIServiceCollection

AddKeyedSpeechToTextClient(IServiceCollection, Object, ISpeechToTextClient, ServiceLifetime)

在 中註冊一個帶鍵的單例ISpeechToTextClientIServiceCollection

AddKeyedTextToSpeechClient(IServiceCollection, Object, Func<IServiceProvider,ITextToSpeechClient>, ServiceLifetime)

在 中註冊一個帶鍵的單例ITextToSpeechClientIServiceCollection

AddKeyedTextToSpeechClient(IServiceCollection, Object, ITextToSpeechClient, ServiceLifetime)

在 中註冊一個帶鍵的單例ITextToSpeechClientIServiceCollection

AddKeyedTransient(IServiceCollection, Type, Object, Func<IServiceProvider,Object,Object>)

在指定 IServiceCollection中加入一個與 中serviceType指定的類型及工廠implementationFactory的暫態服務。

AddKeyedTransient(IServiceCollection, Type, Object, Type)

在指定中加入一個類型所指定的 serviceType 暫態服務,並以該類型 implementationType 實作於指定 IServiceCollection

AddKeyedTransient(IServiceCollection, Type, Object)

將指定型別 serviceType 的暫態服務加入指定的 IServiceCollection

AddKeyedTransient<TService,TImplementation>(IServiceCollection, Object, Func<IServiceProvider,Object,TImplementation>)

將 中TService指定的臨時服務加入一個暫態服務,並使用中implementationFactory指定的工廠,並以 中指定的TImplementation實作類型加入IServiceCollection

AddKeyedTransient<TService,TImplementation>(IServiceCollection, Object)

在指定IServiceCollection中加入一個類型為 的TService暫態服務,並在 中指定TImplementation了實作類型。

AddKeyedTransient<TService>(IServiceCollection, Object, Func<IServiceProvider,Object,TService>)

在指定 IServiceCollection中加入一個與 中TService指定的類型及工廠implementationFactory的暫態服務。

AddKeyedTransient<TService>(IServiceCollection, Object)

將指定型別 TService 的暫態服務加入指定的 IServiceCollection

AddKubernetesProbes(IServiceCollection, Action<KubernetesProbesOptions>)

使用已設定的選項來註冊活躍度、啟動和整備探查。

AddKubernetesProbes(IServiceCollection, IConfigurationSection)

使用已設定的選項來註冊活躍度、啟動和整備探查。

AddKubernetesProbes(IServiceCollection)

使用預設選項來註冊活躍度、啟動和整備探查。

AddKubernetesResourceMonitoring(IServiceCollection, String)

配置並新增 Kubernetes 資源監控元件,包含必要的基本資源監控元件,整合服務集合。

AddLatencyContext(IServiceCollection, Action<LatencyContextOptions>)

新增延遲內容。

AddLatencyContext(IServiceCollection, IConfigurationSection)

新增延遲內容。

AddLatencyContext(IServiceCollection)

新增延遲內容。

AddLocalization(IServiceCollection, Action<LocalizationOptions>)

新增應用程式當地語系化所需的服務。

AddLocalization(IServiceCollection)

新增應用程式當地語系化所需的服務。

AddLogEnricher(IServiceCollection, ILogEnricher)

註冊記錄擴充器實例。

AddLogEnricher<T>(IServiceCollection)

註冊記錄擴充器類型。

AddLogging(IServiceCollection, Action<ILoggingBuilder>)

新增日誌服務至指定的 IServiceCollection

AddLogging(IServiceCollection)

新增日誌服務至指定的 IServiceCollection

AddMemoryCache(IServiceCollection, Action<MemoryCacheOptions>)

在 中加入一個IMemoryCache非分散式的記憶體實作。IServiceCollection

AddMemoryCache(IServiceCollection)

在 中加入一個IMemoryCache非分散式的記憶體實作。IServiceCollection

AddMetrics(IServiceCollection, Action<IMetricsBuilder>)

新增指標服務至指定的 IServiceCollection

AddMetrics(IServiceCollection)

新增指標服務至指定的 IServiceCollection

AddNullLatencyContext(IServiceCollection)

為相依注入容器加入 no-op 延遲上下文。

AddOptions(IServiceCollection)

新增使用選項所需的服務。

AddOptions<TOptions>(IServiceCollection, String)

會獲得一個選項建構器,將同名稱 TOptions 的配置呼叫轉發到底層的服務集合。

AddOptions<TOptions>(IServiceCollection)

會有一個選項建構器,將配置呼叫 TOptions 轉發給底層的服務集合。

AddOptionsWithValidateOnStart<TOptions,TValidateOptions>(IServiceCollection, String)

新增使用選項所需的服務,並在啟動時強制執行選項驗證檢查,而不是在運行時間執行。

AddOptionsWithValidateOnStart<TOptions>(IServiceCollection, String)

新增使用選項所需的服務,並在啟動時強制執行選項驗證檢查,而不是在運行時間執行。

AddPolicyRegistry(IServiceCollection, Action<IServiceProvider,IPolicyRegistry<String>>)

在服務集合中註冊 PolicyRegistry 一個空位,包含服務類型 IPolicyRegistry<TKey>IReadOnlyPolicyRegistry<TKey>、, IConcurrentPolicyRegistry<TKey> 並使用指定的代理來配置。

AddPolicyRegistry(IServiceCollection, IPolicyRegistry<String>)

在服務集合中註冊所提供的 IPolicyRegistry<TKey> 服務類型 IPolicyRegistry<TKey>IReadOnlyPolicyRegistry<TKey>,並 IConcurrentPolicyRegistry<TKey> 回傳所提供的登錄檔。

AddPolicyRegistry(IServiceCollection)

在服務集合中註冊 PolicyRegistry 一個空位,包含服務類型 IPolicyRegistry<TKey>IReadOnlyPolicyRegistry<TKey>IConcurrentPolicyRegistry<TKey> ,如果服務類型尚未註冊,則回傳現有或新建立的登錄檔。

AddPooled<TService,TImplementation>(IServiceCollection, Action<DependencyInjectionPoolOptions>)

新增 , ObjectPool<T> 並讓 DI 回傳 的 作用域實例 TService

AddPooled<TService>(IServiceCollection, Action<DependencyInjectionPoolOptions>)

新增 , ObjectPool<T> 並讓 DI 回傳 的 作用域實例 TService

AddProcessLogEnricher(IServiceCollection, Action<ProcessLogEnricherOptions>)

將過程 enricher 的實例加入 IServiceCollection

AddProcessLogEnricher(IServiceCollection, IConfigurationSection)

在 中加入一個宿主豐富子實例。IServiceCollection

AddProcessLogEnricher(IServiceCollection)

將過程 enricher 的實例加入 IServiceCollection

AddRedaction(IServiceCollection, Action<IRedactionBuilder>)

註冊實作 IRedactorProviderIServiceCollection 配置可用的編輯者。

AddRedaction(IServiceCollection)

在 中註冊 的IRedactorProvider實作。IServiceCollection

AddResilienceEnricher(IServiceCollection)

新增復原擴充器。

AddResourceMonitoring(IServiceCollection, Action<IResourceMonitorBuilder>)
已淘汰.

配置並將 IResourceMonitor 實作加入服務集合。

AddResourceMonitoring(IServiceCollection)

配置並將 IResourceMonitor 實作加入服務集合。

AddScoped(IServiceCollection, Type, Func<IServiceProvider,Object>)

在指定的 IServiceCollection中加入一個類型的範圍服務serviceType,並指定工廠implementationFactory

AddScoped(IServiceCollection, Type, Type)

新增一個指定類型的 serviceType 有作用域服務,並以指定類型實作 implementationType 加入指定的 IServiceCollection

AddScoped(IServiceCollection, Type)

將指定類型中指定的 serviceType 作用域服務加入 IServiceCollection

AddScoped<TService,TImplementation>(IServiceCollection, Func<IServiceProvider,TImplementation>)

在指定IServiceCollection工廠中新增一個類型為 的TService有作用域服務,並使用在 中implementationFactory指定的工廠中指定TImplementation實作類型。

AddScoped<TService,TImplementation>(IServiceCollection)

在指定的 IServiceCollection中加入一個類型為 的 TService scoped 服務,並對 中指定的TImplementation實作類型。

AddScoped<TService>(IServiceCollection, Func<IServiceProvider,TService>)

在指定的 IServiceCollection中加入一個類型的範圍服務TService,並指定工廠implementationFactory

AddScoped<TService>(IServiceCollection)

將指定類型中指定的 TService 作用域服務加入 IServiceCollection

AddServiceLogEnricher(IServiceCollection, Action<ApplicationLogEnricherOptions>)
已淘汰.

將服務豐富化的實例加入 IServiceCollection

AddServiceLogEnricher(IServiceCollection, IConfigurationSection)
已淘汰.

將服務豐富化的實例加入 IServiceCollection

AddServiceLogEnricher(IServiceCollection)
已淘汰.

將服務豐富化的實例加入 IServiceCollection

AddSingleton(IServiceCollection, Type, Func<IServiceProvider,Object>)

將一個與 中serviceType指定的類型相同的單例服務,IServiceCollection並加上 中implementationFactory指定的工廠。

AddSingleton(IServiceCollection, Type, Object)

將一個類型與 中 serviceType 指定的單例服務,並以 中指定的 implementationInstance 實例加入 IServiceCollection指定的服務。

AddSingleton(IServiceCollection, Type, Type)

將 中 serviceType 指定的類型中單一服務,並以 中指定的 implementationType 實作加入 IServiceCollection

AddSingleton(IServiceCollection, Type)

將指定型別 serviceType 的單例服務加入指定的 IServiceCollection

AddSingleton<TService,TImplementation>(IServiceCollection, Func<IServiceProvider,TImplementation>)

新增一個 所TService指定的單例服務,並使用中指定的implementationFactory工廠,並加入 中指定的TImplementation實作類型。IServiceCollection

AddSingleton<TService,TImplementation>(IServiceCollection)

將一個與 中 TService 指定的類型相同的單例服務,以及 中 TImplementation 指定的實作類型,加入 IServiceCollection指定的 。

AddSingleton<TService>(IServiceCollection, Func<IServiceProvider,TService>)

將一個與 中TService指定的類型相同的單例服務,IServiceCollection並加上 中implementationFactory指定的工廠。

AddSingleton<TService>(IServiceCollection, TService)

將一個類型與 中 TService 指定的單例服務,並以 中指定的 implementationInstance 實例加入 IServiceCollection指定的服務。

AddSingleton<TService>(IServiceCollection)

將指定型別 TService 的單例服務加入指定的 IServiceCollection

AddSpeechToTextClient(IServiceCollection, Func<IServiceProvider,ISpeechToTextClient>, ServiceLifetime)

在 中登記一個單例ISpeechToTextClientIServiceCollection

AddSpeechToTextClient(IServiceCollection, ISpeechToTextClient, ServiceLifetime)

在 中登記一個單例ISpeechToTextClientIServiceCollection

AddStackExchangeRedisCache(IServiceCollection, Action<RedisCacheOptions>)

新增 Redis 分散式快取服務至指定 IServiceCollection

AddStaticLogEnricher(IServiceCollection, IStaticLogEnricher)

註冊靜態記錄擴充器實例。

AddStaticLogEnricher<T>(IServiceCollection)

註冊靜態記錄擴充器類型。

AddSystemd(IServiceCollection)

設定建置自 servicesSystemdLifetime的壽命IHost,提供應用程式啟動與停止的通知訊息,並將主控台日誌設定為 systemd 格式。

AddTcpEndpointProbe(IServiceCollection, Action<TcpEndpointProbesOptions>)

若服務被視為健康 IHealthCheck狀態,則使用 TCP 埠註冊健康狀態。

AddTcpEndpointProbe(IServiceCollection, IConfigurationSection)

若服務被視為健康 IHealthCheck狀態,則使用 TCP 埠註冊健康狀態。

AddTcpEndpointProbe(IServiceCollection, String, Action<TcpEndpointProbesOptions>)

若服務被視為健康 IHealthCheck狀態,則使用 TCP 埠註冊健康狀態。

AddTcpEndpointProbe(IServiceCollection, String, IConfigurationSection)

若服務被視為健康 IHealthCheck狀態,則使用 TCP 埠註冊健康狀態。

AddTcpEndpointProbe(IServiceCollection, String)

若服務被視為健康 IHealthCheck狀態,則使用 TCP 埠註冊健康狀態。

AddTcpEndpointProbe(IServiceCollection)

若服務被視為健康 IHealthCheck狀態,則使用 TCP 埠註冊健康狀態。

AddTelemetryHealthCheckPublisher(IServiceCollection, Action<TelemetryHealthCheckPublisherOptions>)

註冊健康情況檢查發行者,其會發出代表應用程式健康情況的遙測。

AddTelemetryHealthCheckPublisher(IServiceCollection, IConfigurationSection)

註冊健康情況檢查發行者,其會發出代表應用程式健康情況的遙測。

AddTelemetryHealthCheckPublisher(IServiceCollection)

註冊健康情況檢查發行者,其會發出代表應用程式健康情況的遙測。

AddTextToSpeechClient(IServiceCollection, Func<IServiceProvider,ITextToSpeechClient>, ServiceLifetime)

在 中登記一個單例ITextToSpeechClientIServiceCollection

AddTextToSpeechClient(IServiceCollection, ITextToSpeechClient, ServiceLifetime)

在 中登記一個單例ITextToSpeechClientIServiceCollection

AddTransient(IServiceCollection, Type, Func<IServiceProvider,Object>)

在指定 IServiceCollection中加入一個與 中serviceType指定的類型及工廠implementationFactory的暫態服務。

AddTransient(IServiceCollection, Type, Type)

在指定中加入一個類型所指定的 serviceType 暫態服務,並以該類型 implementationType 實作於指定 IServiceCollection

AddTransient(IServiceCollection, Type)

將指定型別 serviceType 的暫態服務加入指定的 IServiceCollection

AddTransient<TService,TImplementation>(IServiceCollection, Func<IServiceProvider,TImplementation>)

將 中TService指定的臨時服務加入一個暫態服務,並使用中implementationFactory指定的工廠,並以 中指定的TImplementation實作類型加入IServiceCollection

AddTransient<TService,TImplementation>(IServiceCollection)

在指定IServiceCollection中加入一個類型為 的TService暫態服務,並在 中指定TImplementation了實作類型。

AddTransient<TService>(IServiceCollection, Func<IServiceProvider,TService>)

在指定 IServiceCollection中加入一個與 中TService指定的類型及工廠implementationFactory的暫態服務。

AddTransient<TService>(IServiceCollection)

將指定型別 TService 的暫態服務加入指定的 IServiceCollection

AddValidation(IServiceCollection, Action<ValidationOptions>)

將驗證服務加入指定的 IServiceCollection

AddWebEncoders(IServiceCollection, Action<WebEncoderOptions>)

在指定的 services上加上 HtmlEncoder和 。UrlEncoderJavaScriptEncoder

AddWebEncoders(IServiceCollection)

在指定的 services上加上 HtmlEncoder和 。UrlEncoderJavaScriptEncoder

AddWindowsService(IServiceCollection, Action<WindowsServiceLifetimeOptions>)

設定建置自 services 到 的WindowsServiceLifetime存續期間IHost,並啟用以應用程式名稱作為預設來源名稱的事件日誌日誌。

AddWindowsService(IServiceCollection)

設定建置自 services 到 的WindowsServiceLifetime存續期間IHost,並啟用以應用程式名稱作為預設來源名稱的事件日誌日誌。

BuildServiceProvider(IServiceCollection, Boolean)

從提供的IServiceCollection可選啟用範圍驗證建立ServiceProvider包含服務的版本。

BuildServiceProvider(IServiceCollection, ServiceProviderOptions)

從提供的IServiceCollection可選啟用範圍驗證建立ServiceProvider包含服務的版本。

BuildServiceProvider(IServiceCollection)

從所提供的 IServiceCollection建立ServiceProvider包含服務的 。

Configure<TOptions>(IServiceCollection, Action<IOptionsContext,TOptions>)

註冊用來設定特定選項類型的動作。

Configure<TOptions>(IServiceCollection, Action<TOptions>)

註冊用來設定特定選項類型的動作。 注意:這些測試會在所有 PostConfigure<TOptions>(IServiceCollection, Action<TOptions>)之前執行。

Configure<TOptions>(IServiceCollection, Func<IOptionsContext,CancellationToken,ValueTask<IConfigureContextualOptions<TOptions>>>)

註冊用來設定特定選項類型的動作。

Configure<TOptions>(IServiceCollection, IConfiguration, Action<BinderOptions>)

註冊一個設定實例,該實例會 TOptions 綁定。

Configure<TOptions>(IServiceCollection, IConfiguration)

註冊一個設定實例,該實例會 TOptions 綁定。

Configure<TOptions>(IServiceCollection, String, Action<IOptionsContext,TOptions>)

註冊用來設定特定選項類型的動作。

Configure<TOptions>(IServiceCollection, String, Action<TOptions>)

註冊用來設定特定選項類型的動作。 注意:這些測試會在所有 PostConfigure<TOptions>(IServiceCollection, Action<TOptions>)之前執行。

Configure<TOptions>(IServiceCollection, String, Func<IOptionsContext,CancellationToken,ValueTask<IConfigureContextualOptions<TOptions>>>)

註冊用來設定特定選項類型的動作。

Configure<TOptions>(IServiceCollection, String, IConfiguration, Action<BinderOptions>)

註冊一個設定實例,該實例會 TOptions 綁定。

Configure<TOptions>(IServiceCollection, String, IConfiguration)

註冊一個設定實例,該實例會 TOptions 綁定。

ConfigureAll<TOptions>(IServiceCollection, Action<IOptionsContext,TOptions>)

註冊用來設定特定選項類型之所有實例的動作。

ConfigureAll<TOptions>(IServiceCollection, Action<TOptions>)

註冊用來設定特定選項類型之所有實例的動作。

ConfigureAll<TOptions>(IServiceCollection, Func<IOptionsContext,CancellationToken,ValueTask<IConfigureContextualOptions<TOptions>>>)

註冊用來設定特定選項類型之所有實例的動作。

ConfigureHttpClientDefaults(IServiceCollection, Action<IHttpClientBuilder>)

新增一個代理,用於配置所有 HttpClient 實例。

ConfigureOptions(IServiceCollection, Object)

註冊一個物件,該物件將擁有所有 IConfigureOptions<TOptions>IPostConfigureOptions<TOptions>IValidateOptions<TOptions> 註冊。

ConfigureOptions(IServiceCollection, Type)

註冊一個類型,該類型將擁有所有 IConfigureOptions<TOptions>IPostConfigureOptions<TOptions>IValidateOptions<TOptions> 註冊。

ConfigureOptions<TConfigureOptions>(IServiceCollection)

註冊一個類型,該類型將擁有所有 IConfigureOptions<TOptions>IPostConfigureOptions<TOptions>IValidateOptions<TOptions> 註冊。

ConfigurePool<TService>(IServiceCollection, Action<DependencyInjectionPoolOptions>)

暫存器是一種用於配置類型池的 DependencyInjectionPoolOptions 動作。

ConfigurePools(IServiceCollection, IConfigurationSection)

設定 DI 集區。

PostConfigure<TOptions>(IServiceCollection, Action<TOptions>)

註冊用來初始化特定選項類型的動作。 注意:畢竟 Configure<TOptions>(IServiceCollection, Action<TOptions>)這些是會運行的。

PostConfigure<TOptions>(IServiceCollection, String, Action<TOptions>)

註冊用來設定特定選項類型的動作。 注意:畢竟 Configure<TOptions>(IServiceCollection, Action<TOptions>)這些是會運行的。

PostConfigureAll<TOptions>(IServiceCollection, Action<TOptions>)

註冊用來張貼特定選項類型之所有實例的動作。 注意:畢竟 Configure<TOptions>(IServiceCollection, Action<TOptions>)這些是會運行的。

RegisterCheckpointNames(IServiceCollection, String[])

為延遲內容註冊一組檢查點名稱。

RegisterMeasureNames(IServiceCollection, String[])

為延遲內容註冊一組量值名稱。

RegisterTagNames(IServiceCollection, String[])

註冊延遲內容的一組標記名稱。

RemoveAll(IServiceCollection, Type)

移除所有類型 serviceTypeIServiceCollection的服務。

RemoveAll<T>(IServiceCollection)

移除所有類型 TIServiceCollection的服務。

RemoveAllKeyed(IServiceCollection, Type, Object)

移除所有類型 serviceTypeIServiceCollection的服務。

RemoveAllKeyed<T>(IServiceCollection, Object)

移除所有類型 TIServiceCollection的服務。

Replace(IServiceCollection, ServiceDescriptor)

移除與相同服務類型的descriptor第一個服務IServiceCollection,並加入descriptor集合。

ToAsyncEnumerable<TSource>(IEnumerable<TSource>)

會產生 IAsyncEnumerable<T> 一個新的,會迭 source代 。

ToFrozenDictionary<TSource,TKey,TElement>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TElement>, IEqualityComparer<TKey>)

根據指定的索引鍵選取器和項目選取器函式,從 FrozenDictionary<TKey,TValue> 建立 IEnumerable<T>

ToFrozenDictionary<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>, IEqualityComparer<TKey>)

根據指定的鍵選擇函式從 FrozenDictionary<TKey,TValue> a 建立 。IEnumerable<T>

ToFrozenSet<T>(IEnumerable<T>, IEqualityComparer<T>)

建立 FrozenSet<T> 一個符合指定值的 。

ToImmutableArray<TSource>(IEnumerable<TSource>)

從指定的集合建立不可變的陣列。

ToImmutableDictionary<TSource,TKey,TValue>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TValue>, IEqualityComparer<TKey>, IEqualityComparer<TValue>)

列舉和轉換序列,並使用指定的索引鍵和值比較子產生其內容的不可變字典。

ToImmutableDictionary<TSource,TKey,TValue>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TValue>, IEqualityComparer<TKey>)

列舉和轉換序列,並使用指定的索引鍵比較子產生其內容的不可變字典。

ToImmutableDictionary<TSource,TKey,TValue>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TValue>)

列舉和轉換序列,併產生其內容的不可變字典。

ToImmutableDictionary<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>, IEqualityComparer<TKey>)

根據序列的一些轉換,建構不可變的字典。

ToImmutableDictionary<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>)

從現有的專案集合建構不可變的字典,將轉換函式套用至來源索引鍵。

ToImmutableHashSet<TSource>(IEnumerable<TSource>, IEqualityComparer<TSource>)

列舉序列、產生其內容的不可變哈希集,並使用集合類型的指定相等比較子。

ToImmutableHashSet<TSource>(IEnumerable<TSource>)

列舉序列,併產生其內容的不可變哈希集。

ToImmutableList<TSource>(IEnumerable<TSource>)

列舉序列,併產生其內容的不可變清單。

ToImmutableSortedDictionary<TSource,TKey,TValue>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TValue>, IComparer<TKey>, IEqualityComparer<TValue>)

列舉和轉換序列,並使用指定的索引鍵和值比較子產生其內容的不可變排序字典。

ToImmutableSortedDictionary<TSource,TKey,TValue>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TValue>, IComparer<TKey>)

列舉和轉換序列,並使用指定的索引鍵比較子產生其內容的不可變排序字典。

ToImmutableSortedDictionary<TSource,TKey,TValue>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TValue>)

列舉和轉換序列,併產生其內容的不可變排序字典。

ToImmutableSortedSet<TSource>(IEnumerable<TSource>, IComparer<TSource>)

列舉序列、產生其內容的不可變排序集,並使用指定的比較子。

ToImmutableSortedSet<TSource>(IEnumerable<TSource>)

列舉序列,併產生其內容的不可變排序集。

TryAdd(IServiceCollection, IEnumerable<ServiceDescriptor>)

如果服務類型還沒註冊,會把指定的 descriptors 資料加到裡面 collection

TryAdd(IServiceCollection, ServiceDescriptor)

如果服務類型還沒註冊,會把指定的 descriptor 資料加到裡面 collection

TryAddActivatedKeyedSingleton(IServiceCollection, Type, Object, Func<IServiceProvider,Object,Object>)

嘗試新增自動啟用的金鑰單一服務。

TryAddActivatedKeyedSingleton(IServiceCollection, Type, Object, Type)

嘗試新增自動啟用的金鑰單一服務。

TryAddActivatedKeyedSingleton(IServiceCollection, Type, Object)

嘗試新增自動啟用的金鑰單一服務。

TryAddActivatedKeyedSingleton<TService,TImplementation>(IServiceCollection, Object)

嘗試新增自動啟用的金鑰單一服務。

TryAddActivatedKeyedSingleton<TService>(IServiceCollection, Object, Func<IServiceProvider,Object,TService>)

嘗試新增自動啟用的金鑰單一服務。

TryAddActivatedKeyedSingleton<TService>(IServiceCollection, Object)

嘗試新增自動啟用的金鑰單一服務。

TryAddActivatedSingleton(IServiceCollection, Type, Func<IServiceProvider,Object>)

嘗試新增自動啟動的單一服務。

TryAddActivatedSingleton(IServiceCollection, Type, Type)

嘗試新增自動啟動的單一服務。

TryAddActivatedSingleton(IServiceCollection, Type)

嘗試新增自動啟動的單一服務。

TryAddActivatedSingleton<TService,TImplementation>(IServiceCollection)

嘗試新增自動啟動的單一服務。

TryAddActivatedSingleton<TService>(IServiceCollection, Func<IServiceProvider,TService>)

嘗試新增自動啟動的單一服務。

TryAddActivatedSingleton<TService>(IServiceCollection)

嘗試新增自動啟動的單一服務。

TryAddEnumerable(IServiceCollection, IEnumerable<ServiceDescriptor>)

若已有描述符與 相同ServiceType且實作尚未存在於 services,則加入指定的 ServiceDescriptors。

TryAddEnumerable(IServiceCollection, ServiceDescriptor)

加入 ServiceDescriptor 一個 ,若一個已有描述符的描述符,且一個尚未 ServiceType 存在於 services中的實作。

TryAddKeyedScoped(IServiceCollection, Type, Object, Func<IServiceProvider,Object,Object>)

如果服務類型尚未註冊,則會將指定的serviceScoped服務加入工廠設定的服務implementationFactorycollection

TryAddKeyedScoped(IServiceCollection, Type, Object, Type)

如果服務類型尚未註冊,則會將指定serviceScoped服務加入實implementationTypecollection中。

TryAddKeyedScoped(IServiceCollection, Type, Object)

如果服務類型尚未註冊,則會將指定的serviceScoped服務加入 。collection

TryAddKeyedScoped<TService,TImplementation>(IServiceCollection, Object)

如果服務類型尚未註冊,則會將指定的TServiceScoped服務實作TImplementation類型加入 。collection

TryAddKeyedScoped<TService>(IServiceCollection, Object, Func<IServiceProvider,Object,TService>)

如果服務類型尚未註冊,則會將指定的TServiceScoped服務加入工廠設定的服務implementationFactoryservices

TryAddKeyedScoped<TService>(IServiceCollection, Object)

如果服務類型尚未註冊,則會將指定的TServiceScoped服務加入 。collection

TryAddKeyedSingleton(IServiceCollection, Type, Object, Func<IServiceProvider,Object,Object>)

如果服務類型尚未註冊,則會將指定的serviceSingleton服務加入工廠設定的服務implementationFactorycollection

TryAddKeyedSingleton(IServiceCollection, Type, Object, Type)

如果服務類型尚未註冊,則會將指定serviceSingleton服務加入實implementationTypecollection中。

TryAddKeyedSingleton(IServiceCollection, Type, Object)

如果服務類型尚未註冊,則會將指定的serviceSingleton服務加入 。collection

TryAddKeyedSingleton<TService,TImplementation>(IServiceCollection, Object)

如果服務類型尚未註冊,則會將指定的TServiceSingleton服務實作TImplementation類型加入 。collection

TryAddKeyedSingleton<TService>(IServiceCollection, Object, Func<IServiceProvider,Object,TService>)

如果服務類型尚未註冊,則會將指定的TServiceSingleton服務加入工廠設定的服務implementationFactoryservices

TryAddKeyedSingleton<TService>(IServiceCollection, Object, TService)

如果服務類型尚未註冊,則會將指定的TServiceSingleton服務加入並指定實例。collectioninstance

TryAddKeyedSingleton<TService>(IServiceCollection, Object)

如果服務類型尚未註冊,則會將指定的TServiceSingleton服務加入 。collection

TryAddKeyedTransient(IServiceCollection, Type, Object, Func<IServiceProvider,Object,Object>)

如果服務類型尚未註冊,則會將指定的serviceTransient服務加入工廠設定的服務implementationFactorycollection

TryAddKeyedTransient(IServiceCollection, Type, Object, Type)

如果服務類型尚未註冊,則會將指定serviceTransient服務加入實implementationTypecollection中。

TryAddKeyedTransient(IServiceCollection, Type, Object)

如果服務類型尚未註冊,則會將指定的serviceTransient服務加入 。collection

TryAddKeyedTransient<TService,TImplementation>(IServiceCollection, Object)

如果服務類型尚未註冊,則會將指定的TServiceTransient服務實作TImplementation類型加入 。collection

TryAddKeyedTransient<TService>(IServiceCollection, Object, Func<IServiceProvider,Object,TService>)

如果服務類型尚未註冊,則會將指定的TServiceTransient服務加入工廠設定的服務implementationFactoryservices

TryAddKeyedTransient<TService>(IServiceCollection, Object)

如果服務類型尚未註冊,則會將指定的TServiceTransient服務加入 。collection

TryAddScoped(IServiceCollection, Type, Func<IServiceProvider,Object>)

如果服務類型尚未註冊,則會將指定的serviceScoped服務加入工廠設定的服務implementationFactorycollection

TryAddScoped(IServiceCollection, Type, Type)

如果服務類型尚未註冊,則會將指定serviceScoped服務加入實implementationTypecollection中。

TryAddScoped(IServiceCollection, Type)

如果服務類型尚未註冊,則會將指定的serviceScoped服務加入 。collection

TryAddScoped<TService,TImplementation>(IServiceCollection)

如果服務類型尚未註冊,則會將指定的TServiceScoped服務實作TImplementation類型加入 。collection

TryAddScoped<TService>(IServiceCollection, Func<IServiceProvider,TService>)

如果服務類型尚未註冊,則會將指定的TServiceScoped服務加入工廠設定的服務implementationFactoryservices

TryAddScoped<TService>(IServiceCollection)

如果服務類型尚未註冊,則會將指定的TServiceScoped服務加入 。collection

TryAddSingleton(IServiceCollection, Type, Func<IServiceProvider,Object>)

如果服務類型尚未註冊,則會將指定的serviceSingleton服務加入工廠設定的服務implementationFactorycollection

TryAddSingleton(IServiceCollection, Type, Type)

如果服務類型尚未註冊,則會將指定serviceSingleton服務加入實implementationTypecollection中。

TryAddSingleton(IServiceCollection, Type)

如果服務類型尚未註冊,則會將指定的serviceSingleton服務加入 。collection

TryAddSingleton<TService,TImplementation>(IServiceCollection)

如果服務類型尚未註冊,則會將指定的TServiceSingleton服務實作TImplementation類型加入 。collection

TryAddSingleton<TService>(IServiceCollection, Func<IServiceProvider,TService>)

如果服務類型尚未註冊,則會將指定的TServiceSingleton服務加入工廠設定的服務implementationFactoryservices

TryAddSingleton<TService>(IServiceCollection, TService)

如果服務類型尚未註冊,則會將指定的TServiceSingleton服務加入並指定實例。collectioninstance

TryAddSingleton<TService>(IServiceCollection)

如果服務類型尚未註冊,則會將指定的TServiceSingleton服務加入 。collection

TryAddTransient(IServiceCollection, Type, Func<IServiceProvider,Object>)

如果服務類型尚未註冊,則會將指定的serviceTransient服務加入工廠設定的服務implementationFactorycollection

TryAddTransient(IServiceCollection, Type, Type)

如果服務類型尚未註冊,則會將指定serviceTransient服務加入實implementationTypecollection中。

TryAddTransient(IServiceCollection, Type)

如果服務類型尚未註冊,則會將指定的serviceTransient服務加入 。collection

TryAddTransient<TService,TImplementation>(IServiceCollection)

如果服務類型尚未註冊,則會將指定的TServiceTransient服務實作TImplementation類型加入 。collection

TryAddTransient<TService>(IServiceCollection, Func<IServiceProvider,TService>)

如果服務類型尚未註冊,則會將指定的TServiceTransient服務加入工廠設定的服務implementationFactoryservices

TryAddTransient<TService>(IServiceCollection)

如果服務類型尚未註冊,則會將指定的TServiceTransient服務加入 。collection

適用於