ServiceProviderExtensions extension
Methods
-
createScope()
→ ServiceScope
-
Creates a new ServiceScope.
-
get<TService>()
→ TService?
-
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>
-
Returns an iterable of all services of specified type.
-
getMany<TService>()
→ List<TService>
-
Returns a permanent list of services of specified type.
-
getRequired<TService>()
→ TService
-
Gets a service of the specified type.
Throws an exception if no service of the specified type is registered.
-
getRequiredService(Type serviceType)
→ Object
-
Gets a service of the specified type.
Throws an exception if no service of the specified type is registered.
-
getService(Type serviceType)
→ Object?
-
Gets a service of the specified type.
Returns null if no service of the specified type is registered.
-
getServices(Type serviceType)
→ List<Object>
-
Returns a permanent list of services of specified type.