ServiceCollectionDescriptorExtensions.Add 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
Add(IServiceCollection, ServiceDescriptor) |
将指定的 |
Add(IServiceCollection, IEnumerable<ServiceDescriptor>) |
将 ServiceDescriptor 序列添加到 |
Add(IServiceCollection, ServiceDescriptor)
将指定的 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
参数
- collection
- IServiceCollection
- descriptor
- ServiceDescriptor
要添加的 ServiceDescriptor。
返回
对当前 IServiceCollection 实例的引用。
适用于
Add(IServiceCollection, IEnumerable<ServiceDescriptor>)
将 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
参数
- collection
- IServiceCollection
- descriptors
- IEnumerable<ServiceDescriptor>
要添加的 ServiceDescriptor。
返回
对当前 IServiceCollection 实例的引用。