Class ServiceCollection
Implements
Inherited Members
Namespace: Microsoft.Extensions.DependencyInjection
Assembly: Microsoft.Extensions.DependencyInjection.Abstractions.dll
Syntax
public class ServiceCollection : IServiceCollection, IList<ServiceDescriptor>, ICollection<ServiceDescriptor>, IEnumerable<ServiceDescriptor>, IEnumerable
Constructors
ServiceCollection()
Declaration
public ServiceCollection()
Properties
Count
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
int |
IsReadOnly
Declaration
public bool IsReadOnly { get; }
Property Value
Type | Description |
---|---|
bool |
this[int]
Declaration
public ServiceDescriptor this[int index] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
int | index |
Property Value
Type | Description |
---|---|
ServiceDescriptor |
Methods
Clear()
Declaration
public void Clear()
Contains(ServiceDescriptor)
Declaration
public bool Contains(ServiceDescriptor item)
Parameters
Type | Name | Description |
---|---|---|
ServiceDescriptor | item |
Returns
Type | Description |
---|---|
bool |
CopyTo(ServiceDescriptor[], int)
Declaration
public void CopyTo(ServiceDescriptor[] array, int arrayIndex)
Parameters
Type | Name | Description |
---|---|---|
ServiceDescriptor[] | array | |
int | arrayIndex |
GetEnumerator()
Declaration
public IEnumerator<ServiceDescriptor> GetEnumerator()
Returns
Type | Description |
---|---|
IEnumerator<ServiceDescriptor> |
IndexOf(ServiceDescriptor)
Declaration
public int IndexOf(ServiceDescriptor item)
Parameters
Type | Name | Description |
---|---|---|
ServiceDescriptor | item |
Returns
Type | Description |
---|---|
int |
Insert(int, ServiceDescriptor)
Declaration
public void Insert(int index, ServiceDescriptor item)
Parameters
Type | Name | Description |
---|---|---|
int | index | |
ServiceDescriptor | item |
MakeReadOnly()
Declaration
public void MakeReadOnly()
Remove(ServiceDescriptor)
Declaration
public bool Remove(ServiceDescriptor item)
Parameters
Type | Name | Description |
---|---|---|
ServiceDescriptor | item |
Returns
Type | Description |
---|---|
bool |
RemoveAt(int)
Declaration
public void RemoveAt(int index)
Parameters
Type | Name | Description |
---|---|---|
int | index |
Implements
Extension Methods
ServiceCollectionDescriptorExtensions.TryAddSingleton<TService, TImplementation>(IServiceCollection)