Beamable SDK
Public Member Functions | List of all members
Beamable.Common.Dependencies.IDependencyProvider Interface Reference

The IDependencyProvider is a collection of services, built from a IDependencyBuilder. Use the GetService<T> method to get services. More...

Inheritance diagram for Beamable.Common.Dependencies.IDependencyProvider:
Inheritance graph
[legend]

Public Member Functions

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...
 
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...
 
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...
 

Detailed Description

The IDependencyProvider is a collection of services, built from a IDependencyBuilder. Use the GetService<T> method to get services.

Member Function Documentation

◆ CanBuildService()

bool Beamable.Common.Dependencies.IDependencyProvider.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.

Parameters
tthe type of service to check for
Returns
True if the service can be got, False otherwise.

Implemented in Beamable.Common.Dependencies.DependencyProvider.

◆ 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
TThe type of service to get
Returns
True if the service can be got, False otherwise.

Implemented in Beamable.Common.Dependencies.DependencyProvider.

◆ Fork()

IDependencyProviderScope Beamable.Common.Dependencies.IDependencyProvider.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.

Parameters
configureOptionally, you can pass a configuration function that registers new services specific to the child provider.
Returns
A new IDependencyProviderScope

Implemented in Beamable.Common.Dependencies.DependencyProvider.

◆ GetService()

object Beamable.Common.Dependencies.IDependencyProvider.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.

If the service wasn't registered, you'll get an exception. Use CanBuildService<T> to check if the service can be got.

Parameters
tthe type of service to get
Returns
An instance of the type requested

Implemented in Beamable.Common.Dependencies.DependencyProvider.

◆ 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
TThe type of service to get
Returns
An instance of T

Implemented in Beamable.Common.Dependencies.DependencyProvider.


The documentation for this interface was generated from the following file: