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
IsReadOnly
Gets a value indicating whether the collection is read-only.
public bool IsReadOnly { get; }
Property Value
this[int]
Gets or sets the ServiceDescriptor at the specified index.
public ServiceDescriptor this[int index] { get; set; }
Parameters
index
intThe zero-based index of the item to add.
Property Value
Methods
Add(ServiceDescriptor)
Adds an item to the collection.
public int Add(ServiceDescriptor item)
Parameters
item
ServiceDescriptorThe ServiceDescriptor to add.
Returns
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
ServiceDescriptorThe ServiceDescriptor to locate in the collection.
Returns
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
intThe zero-based index in array at which copying begins.
GetEnumerator()
Returns an enumerator that iterates through a collection.
public IEnumerator GetEnumerator()
Returns
IndexOf(ServiceDescriptor)
Determines the index of a specific item in the collection.
public int IndexOf(ServiceDescriptor item)
Parameters
item
ServiceDescriptorThe ServiceDescriptor to get the index of.
Returns
Insert(int, ServiceDescriptor)
Inserts an item to the collection at the specified index.
public void Insert(int index, ServiceDescriptor item)
Parameters
index
intThe zero-based index at which ServiceDescriptor should be inserted.
item
ServiceDescriptorThe ServiceDescriptor to insert.
Remove(ServiceDescriptor)
Removes the first occurrence of a specific object from the collection.
public void Remove(ServiceDescriptor item)
Parameters
item
ServiceDescriptorThe ServiceDescriptor to remove.
RemoveAt(int)
Removes the ServiceDescriptor item at the specified index.
public void RemoveAt(int index)
Parameters
index
intThe zero-based index of the item to remove.