다음을 통해 공유


ServiceCollectionDescriptorExtensions.TryAdd 메서드

정의

오버로드

TryAdd(IServiceCollection, ServiceDescriptor)

서비스 유형이 아직 등록되지 않은 경우 지정된 descriptorcollection에 추가합니다.

TryAdd(IServiceCollection, IEnumerable<ServiceDescriptor>)

서비스 유형이 아직 등록되지 않은 경우 지정된 descriptorscollection에 추가합니다.

TryAdd(IServiceCollection, ServiceDescriptor)

Source:
ServiceCollectionDescriptorExtensions.cs
Source:
ServiceCollectionDescriptorExtensions.cs
Source:
ServiceCollectionDescriptorExtensions.cs

서비스 유형이 아직 등록되지 않은 경우 지정된 descriptorcollection에 추가합니다.

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

매개 변수

descriptor
ServiceDescriptor

추가할 ServiceDescriptor입니다.

적용 대상

TryAdd(IServiceCollection, IEnumerable<ServiceDescriptor>)

Source:
ServiceCollectionDescriptorExtensions.cs
Source:
ServiceCollectionDescriptorExtensions.cs
Source:
ServiceCollectionDescriptorExtensions.cs

서비스 유형이 아직 등록되지 않은 경우 지정된 descriptorscollection에 추가합니다.

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

매개 변수

descriptors
IEnumerable<ServiceDescriptor>

추가할 ServiceDescriptor입니다.

적용 대상