ServiceCollection.IndexOf(ServiceDescriptor) Method

Definition

Determines the index of a specific item in the IList<T>.

C#
public int IndexOf(Microsoft.Extensions.DependencyInjection.ServiceDescriptor item);

Parameters

item
ServiceDescriptor

The object to locate in the IList<T>.

Returns

The index of item if found in the list; otherwise, -1.

Implements

Applies to

Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Standard 2.0 (package-provided), 2.1 (package-provided)