Bagikan melalui


ServiceCollectionDescriptorExtensions.TryAdd Metode

Definisi

Overload

TryAdd(IServiceCollection, ServiceDescriptor)

Menambahkan yang ditentukan descriptor ke collection jika jenis layanan belum terdaftar.

TryAdd(IServiceCollection, IEnumerable<ServiceDescriptor>)

Menambahkan yang ditentukan descriptors ke collection jika jenis layanan belum terdaftar.

TryAdd(IServiceCollection, ServiceDescriptor)

Sumber:
ServiceCollectionDescriptorExtensions.cs
Sumber:
ServiceCollectionDescriptorExtensions.cs

Menambahkan yang ditentukan descriptor ke collection jika jenis layanan belum terdaftar.

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)

Parameter

descriptor
ServiceDescriptor

yang ServiceDescriptor akan ditambahkan.

Berlaku untuk

TryAdd(IServiceCollection, IEnumerable<ServiceDescriptor>)

Sumber:
ServiceCollectionDescriptorExtensions.cs
Sumber:
ServiceCollectionDescriptorExtensions.cs

Menambahkan yang ditentukan descriptors ke collection jika jenis layanan belum terdaftar.

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))

Parameter

descriptors
IEnumerable<ServiceDescriptor>

S ServiceDescriptoryang akan ditambahkan.

Berlaku untuk