|
| DependencyProvider (DependencyBuilder builder) |
|
T | GetService< T > () |
| Finds an instance of a service given the type parameter. All services are lazily initialized, so its possible that if is the first time the type of service has been requested, this call could allocate a new instance of the service. More...
|
|
bool | CanBuildService< T > () |
| Returns true if the given service is registered in the provider. If you make a call to GetService<T> for a service that doesn't exist, you'll get an exception. More...
|
|
bool | CanBuildService (Type t) |
| Returns true if the given service is registered in the provider. If you make a call to GetService<T> for a service that doesn't exist, you'll get an exception. More...
|
|
object | GetService (Type t) |
| Finds an instance of a service given the type parameter. All services are lazily initialized, so its possible that if is the first time the type of service has been requested, this call could allocate a new instance of the service. More...
|
|
async Promise | Dispose () |
| Disposing a IDependencyProviderScope will call IBeamableDisposable.OnDispose on all inner services that implement IBeamableDisposable. Also, after the dispose method has been called, any call to IDependencyProvider.GetService will fail. After this method, the IsDisposed will be true. However, if you re-hydrate a scope using the Hydrate method, then the scope is no longer in a disposed state. More...
|
|
void | Hydrate (IDependencyProviderScope other) |
| It is possible to "un-dispose" a scope. Hydrating a scope from another scope copies all of the services from the other scope, and uses the other scope's service descriptors to create new services. Any children will be re-hydrated and their original configuration methods will be re-fire. After this method, the IsDisposed will be false. More...
|
|
IDependencyProviderScope | Fork (Action< IDependencyBuilder > configure=null) |
| Create a new IDependencyProviderScope, using the current instance as a parent. Any service that was registered as a Scoped service will be re-created in the new provider. Any service that was registered as a Singleton will use the instance from the parent provider. If the parent provider has IDependencyProviderScope.Dispose called, then the child provider will also be disposed. More...
|
|
◆ CanBuildService()
bool Beamable.Common.Dependencies.DependencyProvider.CanBuildService |
( |
Type |
t | ) |
|
|
inline |
Returns true if the given service is registered in the provider. If you make a call to GetService<T> for a service that doesn't exist, you'll get an exception.
- Parameters
-
t | the type of service to check for |
- Returns
- True if the service can be got, False otherwise.
Implements Beamable.Common.Dependencies.IDependencyProvider.
◆ CanBuildService< T >()
Returns true if the given service is registered in the provider. If you make a call to GetService<T> for a service that doesn't exist, you'll get an exception.
- Template Parameters
-
T | The type of service to get |
- Returns
- True if the service can be got, False otherwise.
Implements Beamable.Common.Dependencies.IDependencyProvider.
◆ Dispose()
async Promise Beamable.Common.Dependencies.DependencyProvider.Dispose |
( |
| ) |
|
|
inline |
◆ Fork()
◆ GetService()
object Beamable.Common.Dependencies.DependencyProvider.GetService |
( |
Type |
t | ) |
|
|
inline |
Finds an instance of a service given the type parameter. All services are lazily initialized, so its possible that if is the first time the type of service has been requested, this call could allocate a new instance of the service.
If the service wasn't registered, you'll get an exception. Use CanBuildService<T> to check if the service can be got.
- Parameters
-
t | the type of service to get |
- Returns
- An instance of the type requested
Implements Beamable.Common.Dependencies.IDependencyProvider.
◆ GetService< T >()
Finds an instance of a service given the type parameter. All services are lazily initialized, so its possible that if is the first time the type of service has been requested, this call could allocate a new instance of the service.
If the service wasn't registered, you'll get an exception. Use CanBuildService<T> to check if the service can be got.
- Template Parameters
-
T | The type of service to get |
- Returns
- An instance of T
Implements Beamable.Common.Dependencies.IDependencyProvider.
◆ Hydrate()
It is possible to "un-dispose" a scope. Hydrating a scope from another scope copies all of the services from the other scope, and uses the other scope's service descriptors to create new services. Any children will be re-hydrated and their original configuration methods will be re-fire. After this method, the IsDisposed will be false.
This method can be useful to re-use an instance of a IDependencyProviderScope that had been disposed.
- Parameters
-
serviceScope | The scope to get life from. |
Implements Beamable.Common.Dependencies.IDependencyProviderScope.
The documentation for this class was generated from the following file:
- com.beamable/Common/Runtime/Dependencies/DependencyProvider.cs