ServiceProvider Class

Definition

The default IServiceProvider.

public ref class ServiceProvider sealed : IAsyncDisposable, IDisposable, IServiceProvider
public sealed class ServiceProvider : IAsyncDisposable, IDisposable, IServiceProvider
type ServiceProvider = class
    interface IServiceProvider
    interface IDisposable
    interface IAsyncDisposable
Public NotInheritable Class ServiceProvider
Implements IAsyncDisposable, IDisposable, IServiceProvider
Inheritance
ServiceProvider
Implements

Methods

Dispose()
DisposeAsync()
Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetService(Type)

Gets the service object of the specified type.

GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString()

Returns a string that represents the current object.

(Inherited from Object)

Extension Methods

CreateScope(IServiceProvider)

Creates a new IServiceScope that can be used to resolve scoped services.

GetRequiredService(IServiceProvider, Type)

Get service of type serviceType from the IServiceProvider.

GetRequiredService<T>(IServiceProvider)

Get service of type T from the IServiceProvider.

GetService<T>(IServiceProvider)

Get service of type T from the IServiceProvider.

GetServices(IServiceProvider, Type)

Get an enumeration of services of type serviceType from the IServiceProvider.

GetServices<T>(IServiceProvider)

Get an enumeration of services of type T from the IServiceProvider.

Applies to