Table of Contents

Interface IServiceCollection

Namespace
Microsoft.Extensions.DependencyInjection
Assembly
nanoFramework.DependencyInjection.dll

Default implementation of IServiceCollection.

public interface IServiceCollection
Extension Methods

Properties

Count

Gets the number of elements contained in the collection.

int Count { get; }

Property Value

int

IsReadOnly

Gets a value indicating whether the collection is read-only.

bool IsReadOnly { get; }

Property Value

bool

this[int]

Gets or sets the ServiceDescriptor at the specified index.

ServiceDescriptor this[int index] { get; set; }

Parameters

index int

The zero-based index of the item to add.

Property Value

ServiceDescriptor

Methods

Add(ServiceDescriptor)

Adds an item to the collection.

int Add(ServiceDescriptor item)

Parameters

item ServiceDescriptor

The ServiceDescriptor to add.

Returns

int

Clear()

Removes all ServiceDescriptor from the collection.

void Clear()

Contains(ServiceDescriptor)

Determines whether the collection contains a specific value.

bool Contains(ServiceDescriptor item)

Parameters

item ServiceDescriptor

The ServiceDescriptor to locate in the collection.

Returns

bool

CopyTo(ServiceDescriptor[], int)

Copies the elements of the collection to an Array starting at a particular Array index.

void CopyTo(ServiceDescriptor[] array, int arrayIndex)

Parameters

array ServiceDescriptor[]

The one-dimensional Array that is the destination of the elements copied from. The Array must have zero-based indexing.

arrayIndex int

The zero-based index in array at which copying begins.

GetEnumerator()

Returns an enumerator that iterates through a collection.

IEnumerator GetEnumerator()

Returns

IEnumerator

IndexOf(ServiceDescriptor)

Determines the index of a specific item in the collection.

int IndexOf(ServiceDescriptor item)

Parameters

item ServiceDescriptor

The ServiceDescriptor to get the index of.

Returns

int

Insert(int, ServiceDescriptor)

Inserts an item to the collection at the specified index.

void Insert(int index, ServiceDescriptor item)

Parameters

index int

The zero-based index at which ServiceDescriptor should be inserted.

item ServiceDescriptor

The ServiceDescriptor to insert.

Remove(ServiceDescriptor)

Removes the first occurrence of a specific object from the collection.

void Remove(ServiceDescriptor item)

Parameters

item ServiceDescriptor

The ServiceDescriptor to remove.

RemoveAt(int)

Removes the ServiceDescriptor item at the specified index.

void RemoveAt(int index)

Parameters

index int

The zero-based index of the item to remove.