Table of Contents

Class ServiceCollection

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

Default implementation of IServiceCollection.

public class ServiceCollection : IServiceCollection
Inheritance
ServiceCollection
Implements
Inherited Members
Extension Methods

Constructors

ServiceCollection()

public ServiceCollection()

Properties

Count

Gets the number of elements contained in the collection.

public int Count { get; }

Property Value

int

IsReadOnly

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

public bool IsReadOnly { get; }

Property Value

bool

this[int]

Gets or sets the ServiceDescriptor at the specified index.

public 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.

public int Add(ServiceDescriptor item)

Parameters

item ServiceDescriptor

The ServiceDescriptor to add.

Returns

int

Clear()

Removes all ServiceDescriptor from the collection.

public void Clear()

Contains(ServiceDescriptor)

Determines whether the collection contains a specific value.

public 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.

public 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.

public IEnumerator GetEnumerator()

Returns

IEnumerator

IndexOf(ServiceDescriptor)

Determines the index of a specific item in the collection.

public 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.

public 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.

public void Remove(ServiceDescriptor item)

Parameters

item ServiceDescriptor

The ServiceDescriptor to remove.

RemoveAt(int)

Removes the ServiceDescriptor item at the specified index.

public void RemoveAt(int index)

Parameters

index int

The zero-based index of the item to remove.