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
IsReadOnly
Gets a value indicating whether the collection is read-only.
bool IsReadOnly { get; }
Property Value
this[int]
Gets or sets the ServiceDescriptor at the specified index.
ServiceDescriptor this[int index] { get; set; }
Parameters
indexintThe zero-based index of the item to add.
Property Value
Methods
Add(ServiceDescriptor)
Adds an item to the collection.
int Add(ServiceDescriptor item)
Parameters
itemServiceDescriptorThe ServiceDescriptor to add.
Returns
Clear()
Removes all ServiceDescriptor from the collection.
void Clear()
Contains(ServiceDescriptor)
Determines whether the collection contains a specific value.
bool Contains(ServiceDescriptor item)
Parameters
itemServiceDescriptorThe 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.
void CopyTo(ServiceDescriptor[] array, int arrayIndex)
Parameters
arrayServiceDescriptor[]The one-dimensional Array that is the destination of the elements copied from. The Array must have zero-based indexing.
arrayIndexintThe zero-based index in array at which copying begins.
GetEnumerator()
Returns an enumerator that iterates through a collection.
IEnumerator GetEnumerator()
Returns
IndexOf(ServiceDescriptor)
Determines the index of a specific item in the collection.
int IndexOf(ServiceDescriptor item)
Parameters
itemServiceDescriptorThe ServiceDescriptor to get the index of.
Returns
Insert(int, ServiceDescriptor)
Inserts an item to the collection at the specified index.
void Insert(int index, ServiceDescriptor item)
Parameters
indexintThe zero-based index at which ServiceDescriptor should be inserted.
itemServiceDescriptorThe ServiceDescriptor to insert.
Remove(ServiceDescriptor)
Removes the first occurrence of a specific object from the collection.
void Remove(ServiceDescriptor item)
Parameters
itemServiceDescriptorThe ServiceDescriptor to remove.
RemoveAt(int)
Removes the ServiceDescriptor item at the specified index.
void RemoveAt(int index)
Parameters
indexintThe zero-based index of the item to remove.