共用方式為


ServiceCollectionDescriptorExtensions.Add 方法

定義

多載

Add(IServiceCollection, ServiceDescriptor)

將指定的 descriptor 加入至 collection

Add(IServiceCollection, IEnumerable<ServiceDescriptor>)

ServiceDescriptor 的序列新增至 collection

Add(IServiceCollection, ServiceDescriptor)

來源:
ServiceCollectionDescriptorExtensions.cs
來源:
ServiceCollectionDescriptorExtensions.cs
來源:
ServiceCollectionDescriptorExtensions.cs

將指定的 descriptor 加入至 collection

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IServiceCollection ^ Add(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ collection, Microsoft::Extensions::DependencyInjection::ServiceDescriptor ^ descriptor);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection Add (this Microsoft.Extensions.DependencyInjection.IServiceCollection collection, Microsoft.Extensions.DependencyInjection.ServiceDescriptor descriptor);
static member Add : Microsoft.Extensions.DependencyInjection.IServiceCollection * Microsoft.Extensions.DependencyInjection.ServiceDescriptor -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function Add (collection As IServiceCollection, descriptor As ServiceDescriptor) As IServiceCollection

參數

descriptor
ServiceDescriptor

要加入的 ServiceDescriptor

傳回

目前 IServiceCollection 執行個體的參考。

適用於

Add(IServiceCollection, IEnumerable<ServiceDescriptor>)

來源:
ServiceCollectionDescriptorExtensions.cs
來源:
ServiceCollectionDescriptorExtensions.cs
來源:
ServiceCollectionDescriptorExtensions.cs

ServiceDescriptor 的序列新增至 collection

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IServiceCollection ^ Add(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ collection, System::Collections::Generic::IEnumerable<Microsoft::Extensions::DependencyInjection::ServiceDescriptor ^> ^ descriptors);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection Add (this Microsoft.Extensions.DependencyInjection.IServiceCollection collection, System.Collections.Generic.IEnumerable<Microsoft.Extensions.DependencyInjection.ServiceDescriptor> descriptors);
static member Add : Microsoft.Extensions.DependencyInjection.IServiceCollection * seq<Microsoft.Extensions.DependencyInjection.ServiceDescriptor> -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function Add (collection As IServiceCollection, descriptors As IEnumerable(Of ServiceDescriptor)) As IServiceCollection

參數

descriptors
IEnumerable<ServiceDescriptor>

要新增的 ServiceDescriptor

傳回

目前 IServiceCollection 執行個體的參考。

適用於