語言

ServiceCollectionDescriptorExtensions 類別

定義

新增與移除服務的 IServiceCollection擴充方法

public ref class ServiceCollectionDescriptorExtensions abstract sealed
public static class ServiceCollectionDescriptorExtensions
type ServiceCollectionDescriptorExtensions = class
Public Module ServiceCollectionDescriptorExtensions
繼承
ServiceCollectionDescriptorExtensions

方法

名稱 Description
Add(IServiceCollection, IEnumerable<ServiceDescriptor>)

在 中加入 的ServiceDescriptor序列。collection

Add(IServiceCollection, ServiceDescriptor)

將指定的 descriptorcollection加入 。

RemoveAll(IServiceCollection, Type)

移除所有類型 serviceType 為 IServiceCollection的服務。

RemoveAll<T>(IServiceCollection)

移除所有類型 T 為 IServiceCollection的服務。

RemoveAllKeyed(IServiceCollection, Type, Object)

移除所有類型 serviceType 為 IServiceCollection的服務。

RemoveAllKeyed<T>(IServiceCollection, Object)

移除所有類型 T 為 IServiceCollection的服務。

Replace(IServiceCollection, ServiceDescriptor)

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

TryAdd(IServiceCollection, IEnumerable<ServiceDescriptor>)

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

TryAdd(IServiceCollection, ServiceDescriptor)

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

TryAddEnumerable(IServiceCollection, IEnumerable<ServiceDescriptor>)

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

TryAddEnumerable(IServiceCollection, ServiceDescriptor)

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

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

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

TryAddKeyedScoped(IServiceCollection, Type, Object, Type)

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

TryAddKeyedScoped(IServiceCollection, Type, Object)

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

TryAddKeyedScoped<TService,TImplementation>(IServiceCollection, Object)

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

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

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

TryAddKeyedScoped<TService>(IServiceCollection, Object)

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

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

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

TryAddKeyedSingleton(IServiceCollection, Type, Object, Type)

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

TryAddKeyedSingleton(IServiceCollection, Type, Object)

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

TryAddKeyedSingleton<TService,TImplementation>(IServiceCollection, Object)

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

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

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

TryAddKeyedSingleton<TService>(IServiceCollection, Object, TService)

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

TryAddKeyedSingleton<TService>(IServiceCollection, Object)

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

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

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

TryAddKeyedTransient(IServiceCollection, Type, Object, Type)

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

TryAddKeyedTransient(IServiceCollection, Type, Object)

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

TryAddKeyedTransient<TService,TImplementation>(IServiceCollection, Object)

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

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

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

TryAddKeyedTransient<TService>(IServiceCollection, Object)

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

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

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

TryAddScoped(IServiceCollection, Type, Type)

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

TryAddScoped(IServiceCollection, Type)

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

TryAddScoped<TService,TImplementation>(IServiceCollection)

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

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

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

TryAddScoped<TService>(IServiceCollection)

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

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

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

TryAddSingleton(IServiceCollection, Type, Type)

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

TryAddSingleton(IServiceCollection, Type)

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

TryAddSingleton<TService,TImplementation>(IServiceCollection)

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

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

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

TryAddSingleton<TService>(IServiceCollection, TService)

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

TryAddSingleton<TService>(IServiceCollection)

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

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

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

TryAddTransient(IServiceCollection, Type, Type)

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

TryAddTransient(IServiceCollection, Type)

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

TryAddTransient<TService,TImplementation>(IServiceCollection)

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

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

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

TryAddTransient<TService>(IServiceCollection)

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

適用於