ServiceProviderExtensions extension

on

Methods

createScope() ServiceScope

Available on ServiceProvider, provided by the ServiceProviderExtensions extension

Creates a new ServiceScope.
get<TService>() → TService?

Available on ServiceProvider, provided by the ServiceProviderExtensions extension

Gets a service of the specified type Returns null if no service of the specified type is registered.
getIterable<TService>([bool sameLifetime = false]) Iterable<TService>

Available on ServiceProvider, provided by the ServiceProviderExtensions extension

Returns an iterable of all services of specified type.
getMany<TService>() List<TService>

Available on ServiceProvider, provided by the ServiceProviderExtensions extension

Returns a permanent list of services of specified type.
getRequired<TService>() → TService

Available on ServiceProvider, provided by the ServiceProviderExtensions extension

Gets a service of the specified type. Throws an exception if no service of the specified type is registered.
getRequiredService(Type serviceType) Object

Available on ServiceProvider, provided by the ServiceProviderExtensions extension

Gets a service of the specified type. Throws an exception if no service of the specified type is registered.
getService(Type serviceType) Object?

Available on ServiceProvider, provided by the ServiceProviderExtensions extension

Gets a service of the specified type. Returns null if no service of the specified type is registered.
getServices(Type serviceType) List<Object>

Available on ServiceProvider, provided by the ServiceProviderExtensions extension

Returns a permanent list of services of specified type.