ServiceCollectionDescriptorExtensions.Replace(IServiceCollection, ServiceDescriptor) 메서드

정의

IServiceCollection와 동일한 서비스 유형을 가진 descriptor의 첫 번째 서비스를 제거하고 descriptor를 컬렉션에 추가합니다.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

매개 변수

descriptor
ServiceDescriptor

바꿀 ServiceDescriptor입니다.The ServiceDescriptor to replace with.

반환

연결할 IServiceCollection입니다.The IServiceCollection for chaining.

적용 대상