ServiceCollectionDescriptorExtensions.Replace(IServiceCollection, ServiceDescriptor) Methode

Definition

Entfernt den ersten Dienst in IServiceCollection mit demselben Diensttyp wie descriptor, und fügt descriptor zur Sammlung hinzu.Removes the first service in IServiceCollection with the same service type as descriptor and adds descriptor to the collection.

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

Parameter

descriptor
ServiceDescriptor

Der ServiceDescriptor, der zum Ersetzen verwendet werden soll.The ServiceDescriptor to replace with.

Gibt zurück

Die IServiceCollection-Schnittstelle für die Verkettung.The IServiceCollection for chaining.

Gilt für: