Beamable SDK
Public Member Functions | Properties | List of all members
Beamable.Common.Dependencies.DependencyBuilder Class Reference

The default implementation of IDependencyBuilder. It is not recommended that you ever use this class directly. You should only ever reference the interface. More...

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

Public Member Functions

IDependencyBuilder AddTransient< TInterface, TImpl > (Func< IDependencyProvider, TInterface > factory)
 Add a transient service to the IDependencyBuilder. A transient service will be re-instantiated everytime it is requested from IDependencyProvider.GetService. More...
 
IDependencyBuilder AddTransient< TInterface, TImpl > (Func< TInterface > factory)
 Add a transient service to the IDependencyBuilder. A transient service will be re-instantiated everytime it is requested from IDependencyProvider.GetService. More...
 
IDependencyBuilder AddTransient< TInterface, TImpl > ()
 Add a transient service to the IDependencyBuilder. A transient service will be re-instantiated everytime it is requested from IDependencyProvider.GetService. More...
 
IDependencyBuilder AddTransient< T > (Func< IDependencyProvider, T > factory)
 Add a transient service to the IDependencyBuilder. A transient service will be re-instantiated everytime it is requested from IDependencyProvider.GetService. More...
 
IDependencyBuilder AddTransient< T > (Func< T > factory)
 Add a transient service to the IDependencyBuilder. A transient service will be re-instantiated everytime it is requested from IDependencyProvider.GetService. More...
 
IDependencyBuilder AddTransient< T > ()
 Add a transient service to the IDependencyBuilder. A transient service will be re-instantiated everytime it is requested from IDependencyProvider.GetService. More...
 
IDependencyBuilder AddScoped< TInterface, TImpl > (Func< IDependencyProvider, TInterface > factory)
 Add a scoped service to the IDependencyBuilder. More...
 
IDependencyBuilder AddScoped< TInterface, TImpl > (Func< TInterface > factory)
 Add a transient service to the IDependencyBuilder. More...
 
IDependencyBuilder AddScoped< TInterface, TImpl > (TInterface service)
 Add a transient service to the IDependencyBuilder. More...
 
IDependencyBuilder AddScoped< TInterface, TImpl > ()
 Add a transient service to the IDependencyBuilder. More...
 
IDependencyBuilder AddScoped< T > (Func< IDependencyProvider, T > factory)
 Add a transient service to the IDependencyBuilder. More...
 
IDependencyBuilder AddScoped< T > (Func< T > factory)
 Add a transient service to the IDependencyBuilder. More...
 
IDependencyBuilder AddScoped< T > (T service)
 Add a transient service to the IDependencyBuilder. More...
 
IDependencyBuilder AddScoped< T > ()
 Add a transient service to the IDependencyBuilder. More...
 
IDependencyBuilder AddSingleton< TInterface, TImpl > (Func< IDependencyProvider, TInterface > factory)
 Add a singleton service to the IDependencyBuilder. More...
 
IDependencyBuilder AddSingleton (Type type)
 Add a singleton service to the IDependencyBuilder. More...
 
IDependencyBuilder AddSingleton< T > (Type registeringType, Func< T > factory)
 Add a singleton service to the IDependencyBuilder. This overload allows for you to add batches of concrete service implementations that are tied to their concrete implementation dynamically (without knowing them at compilation-time). More...
 
IDependencyBuilder AddSingleton< TInterface, TImpl > (Func< TInterface > factory)
 Add a singleton service to the IDependencyBuilder. More...
 
IDependencyBuilder AddSingleton< TInterface, TImpl > (TInterface service)
 Add a singleton service to the IDependencyBuilder. More...
 
IDependencyBuilder AddSingleton< TInterface, TImpl > ()
 Add a singleton service to the IDependencyBuilder. More...
 
IDependencyBuilder AddSingleton< T > (Func< IDependencyProvider, T > factory)
 Add a singleton service to the IDependencyBuilder. More...
 
IDependencyBuilder AddSingleton< T > (Func< T > factory)
 Add a singleton service to the IDependencyBuilder. More...
 
IDependencyBuilder AddSingleton< T > (T service)
 Add a singleton service to the IDependencyBuilder. More...
 
IDependencyBuilder AddSingleton< T > ()
 Add a singleton service to the IDependencyBuilder. More...
 
IDependencyProviderScope Build ()
 After you have registered all your services, use this method to finalize the builder and produce a IDependencyProvider that can be used to get services. The actual return value will be a IDependencyProviderScope which has lifecycle controls for the IDependencyProvider More...
 
IDependencyBuilder RemoveIfExists< T > ()
 Removes a service of some type that was added with any of the AddTransient, AddScoped, or AddSingleton calls. It doesn't matter how the type was registered. If no service was added, then this method is a no-op. More...
 
IDependencyBuilder Remove< T > ()
 Removes a service of some type that was added with any of the AddTransient, AddScoped, or AddSingleton calls. It doesn't matter how the type was registered. If no service was added, then this method will throw an exception. Use RemoveIfExists<T> to avoid the exception. More...
 
bool Has< T > ()
 Returns true is the given service has been registered. More...
 
bool TryGetTransient (Type type, out ServiceDescriptor descriptor)
 
bool TryGetScoped (Type type, out ServiceDescriptor descriptor)
 
bool TryGetSingleton (Type type, out ServiceDescriptor descriptor)
 
IDependencyBuilder Clone ()
 Clones the IDependencyBuilder. The resulting builder will have of the same registrations that the current instance has. However, if you add any services to the original instance, or the returned instance, the addition won't affect the service registration state of the builder. More...
 

Properties

List< ServiceDescriptorTransientServices = new List<ServiceDescriptor>() [getprotected set]
 
List< ServiceDescriptorScopedServices = new List<ServiceDescriptor>() [getprotected set]
 
List< ServiceDescriptorSingletonServices = new List<ServiceDescriptor>() [getprotected set]
 

Detailed Description

The default implementation of IDependencyBuilder. It is not recommended that you ever use this class directly. You should only ever reference the interface.

Member Function Documentation

◆ AddScoped< T >() [1/4]

IDependencyBuilder Beamable.Common.Dependencies.DependencyBuilder.AddScoped< T > ( )

Add a transient service to the IDependencyBuilder.

A scoped service will be instantiated once, and the same instance will be requested from IDependencyProvider.GetService. However, if you use Clone, then all calls to IDependencyProvider.GetService on the resultant IDependencyProvider will generate a new scope instance.

The instance will automatically be created by using the first available constructor of the TImpl type, and providing parameters for the constructor from the IDependencyProvider itself

Template Parameters
TThe type that is actually registered in the IDependencyBuilder. There can only be one registration for this type per IDependencyBuilder
Returns
The same instance of IDependencyBuilder so that you can chain methods together.

Implements Beamable.Common.Dependencies.IDependencyBuilder.

◆ AddScoped< T >() [2/4]

IDependencyBuilder Beamable.Common.Dependencies.DependencyBuilder.AddScoped< T > ( Func< IDependencyProvider, T >  factory)

Add a transient service to the IDependencyBuilder.

A scoped service will be instantiated once, and the same instance will be requested from IDependencyProvider.GetService. However, if you use Clone, then all calls to IDependencyProvider.GetService on the resultant IDependencyProvider will generate a new scope instance.

Parameters
factoryA function that takes a IDependencyProvider and produces an instance of TInterface
Template Parameters
TThe type that is actually registered in the IDependencyBuilder. There can only be one registration for this type per IDependencyBuilder
Returns
The same instance of IDependencyBuilder so that you can chain methods together.

Implements Beamable.Common.Dependencies.IDependencyBuilder.

◆ AddScoped< T >() [3/4]

IDependencyBuilder Beamable.Common.Dependencies.DependencyBuilder.AddScoped< T > ( Func< T >  factory)

Add a transient service to the IDependencyBuilder.

A scoped service will be instantiated once, and the same instance will be requested from IDependencyProvider.GetService. However, if you use Clone, then all calls to IDependencyProvider.GetService on the resultant IDependencyProvider will generate a new scope instance.

Parameters
factoryA function that produces an instance of TInterface
Template Parameters
TThe type that is actually registered in the IDependencyBuilder. There can only be one registration for this type per IDependencyBuilder
Returns
The same instance of IDependencyBuilder so that you can chain methods together.

Implements Beamable.Common.Dependencies.IDependencyBuilder.

◆ AddScoped< T >() [4/4]

IDependencyBuilder Beamable.Common.Dependencies.DependencyBuilder.AddScoped< T > ( service)

Add a transient service to the IDependencyBuilder.

A scoped service will be instantiated once, and the same instance will be requested from IDependencyProvider.GetService. However, if you use Clone, then all calls to IDependencyProvider.GetService on the resultant IDependencyProvider will generate a new scope instance.

Parameters
servicea value of T that will be used as the scoped instance
Template Parameters
TThe type that is actually registered in the IDependencyBuilder. There can only be one registration for this type per IDependencyBuilder
Returns
The same instance of IDependencyBuilder so that you can chain methods together.

Implements Beamable.Common.Dependencies.IDependencyBuilder.

◆ AddScoped< TInterface, TImpl >() [1/4]

IDependencyBuilder Beamable.Common.Dependencies.DependencyBuilder.AddScoped< TInterface, TImpl > ( )

Add a transient service to the IDependencyBuilder.

A scoped service will be instantiated once, and the same instance will be requested from IDependencyProvider.GetService. However, if you use Clone, then all calls to IDependencyProvider.GetService on the resultant IDependencyProvider will generate a new scope instance.

The instance will automatically be created by using the first available constructor of the TImpl type, and providing parameters for the constructor from the IDependencyProvider itself

Template Parameters
TInterfaceThe type that is actually registered in the IDependencyBuilder. There can only be one registration for this type per IDependencyBuilder
TImplThe concrete type of the instance that will be returned from IDependencyProvider.GetService
Returns
The same instance of IDependencyBuilder so that you can chain methods together.

Implements Beamable.Common.Dependencies.IDependencyBuilder.

Type Constraints
TImpl :TInterface 
TImpl :AddScoped 
TImpl :TInterface 
TImpl :TImpl 
TImpl :factory 
TImpl :Instantiate<TImpl> 
TImpl :factory 

◆ AddScoped< TInterface, TImpl >() [2/4]

IDependencyBuilder Beamable.Common.Dependencies.DependencyBuilder.AddScoped< TInterface, TImpl > ( Func< IDependencyProvider, TInterface >  factory)
inline

Add a scoped service to the IDependencyBuilder.

A scoped service will be instantiated once, and the same instance will be requested from IDependencyProvider.GetService. However, if you use Clone, then all calls to IDependencyProvider.GetService on the resultant IDependencyProvider will generate a new scope instance.

Parameters
factoryA function that takes a IDependencyProvider and produces an instance of TInterface
Template Parameters
TInterfaceThe type that is actually registered in the IDependencyBuilder. There can only be one registration for this type per IDependencyBuilder
TImplThe concrete type of the instance that will be returned from IDependencyProvider.GetService
Returns
The same instance of IDependencyBuilder so that you can chain methods together.

Implements Beamable.Common.Dependencies.IDependencyBuilder.

Type Constraints
TImpl :TInterface 

◆ AddScoped< TInterface, TImpl >() [3/4]

IDependencyBuilder Beamable.Common.Dependencies.DependencyBuilder.AddScoped< TInterface, TImpl > ( Func< TInterface >  factory)

Add a transient service to the IDependencyBuilder.

A scoped service will be instantiated once, and the same instance will be requested from IDependencyProvider.GetService. However, if you use Clone, then all calls to IDependencyProvider.GetService on the resultant IDependencyProvider will generate a new scope instance.

Parameters
factoryA function that produces an instance of TInterface
Template Parameters
TInterfaceThe type that is actually registered in the IDependencyBuilder. There can only be one registration for this type per IDependencyBuilder
TImplThe concrete type of the instance that will be returned from IDependencyProvider.GetService
Returns
The same instance of IDependencyBuilder so that you can chain methods together.

Implements Beamable.Common.Dependencies.IDependencyBuilder.

Type Constraints
TImpl :TInterface 
TImpl :AddScoped 
TImpl :TInterface 
TImpl :TImpl 
TImpl :_ 
TImpl :factory() 

◆ AddScoped< TInterface, TImpl >() [4/4]

IDependencyBuilder Beamable.Common.Dependencies.DependencyBuilder.AddScoped< TInterface, TImpl > ( TInterface  service)

Add a transient service to the IDependencyBuilder.

A scoped service will be instantiated once, and the same instance will be requested from IDependencyProvider.GetService. However, if you use Clone, then all calls to IDependencyProvider.GetService on the resultant IDependencyProvider will generate a new scope instance.

Parameters
servicea value of TInterface that will be used as the scoped instance
Template Parameters
TInterfaceThe type that is actually registered in the IDependencyBuilder. There can only be one registration for this type per IDependencyBuilder
TImplThe concrete type of the instance that will be returned from IDependencyProvider.GetService
Returns
The same instance of IDependencyBuilder so that you can chain methods together.

Implements Beamable.Common.Dependencies.IDependencyBuilder.

Type Constraints
TImpl :TInterface 
TImpl :AddScoped 
TImpl :TInterface 
TImpl :TImpl 
TImpl :_ 
TImpl :service 

◆ AddSingleton()

IDependencyBuilder Beamable.Common.Dependencies.DependencyBuilder.AddSingleton ( Type  t)
inline

Add a singleton service to the IDependencyBuilder.

A singleton service will be instantiated once, and the same instance will be requested from IDependencyProvider.GetService. Even if you use Clone, the one instance will be returned for all children providers.

The instance will automatically be created by using the first available constructor of the TImpl type, and providing parameters for the constructor from the IDependencyProvider itself

Parameters
tThe type of the service that is registered
Returns
The same instance of IDependencyBuilder so that you can chain methods together.

Implements Beamable.Common.Dependencies.IDependencyBuilder.

◆ AddSingleton< T >() [1/5]

Add a singleton service to the IDependencyBuilder.

A singleton service will be instantiated once, and the same instance will be requested from IDependencyProvider.GetService. Even if you use Clone, the one instance will be returned for all children providers.

The instance will automatically be created by using the first available constructor of the TImpl type, and providing parameters for the constructor from the IDependencyProvider itself

Template Parameters
TThe type that is actually registered in the IDependencyBuilder. There can only be one registration for this type per IDependencyBuilder
Returns
The same instance of IDependencyBuilder so that you can chain methods together.

Implements Beamable.Common.Dependencies.IDependencyBuilder.

◆ AddSingleton< T >() [2/5]

Add a singleton service to the IDependencyBuilder.

A singleton service will be instantiated once, and the same instance will be requested from IDependencyProvider.GetService. Even if you use Clone, the one instance will be returned for all children providers.

Parameters
factoryA function that takes a IDependencyProvider and produces an instance of T
Template Parameters
TThe type that is actually registered in the IDependencyBuilder. There can only be one registration for this type per IDependencyBuilder
Returns
The same instance of IDependencyBuilder so that you can chain methods together.

Implements Beamable.Common.Dependencies.IDependencyBuilder.

◆ AddSingleton< T >() [3/5]

Add a singleton service to the IDependencyBuilder.

A singleton service will be instantiated once, and the same instance will be requested from IDependencyProvider.GetService. Even if you use Clone, the one instance will be returned for all children providers.

Parameters
factoryA function that produces an instance of T
Template Parameters
TThe type that is actually registered in the IDependencyBuilder. There can only be one registration for this type per IDependencyBuilder
Returns
The same instance of IDependencyBuilder so that you can chain methods together.

Implements Beamable.Common.Dependencies.IDependencyBuilder.

◆ AddSingleton< T >() [4/5]

Add a singleton service to the IDependencyBuilder.

A singleton service will be instantiated once, and the same instance will be requested from IDependencyProvider.GetService. Even if you use Clone, the one instance will be returned for all children providers.

Parameters
serviceA value instance of TInterface
Template Parameters
TThe type that is actually registered in the IDependencyBuilder. There can only be one registration for this type per IDependencyBuilder
Returns
The same instance of IDependencyBuilder so that you can chain methods together.

Implements Beamable.Common.Dependencies.IDependencyBuilder.

◆ AddSingleton< T >() [5/5]

IDependencyBuilder Beamable.Common.Dependencies.DependencyBuilder.AddSingleton< T > ( Type  registeredType,
Func< T >  factory 
)
inline

Add a singleton service to the IDependencyBuilder. This overload allows for you to add batches of concrete service implementations that are tied to their concrete implementation dynamically (without knowing them at compilation-time).

Parameters
registeredTypeThe service is added tied to this type. Once the services are built, use this type to retrieve it.
factoryA function that produces an instance of registeredType . This type must inherit from T .
Template Parameters
TA parent type of registeredType .
Returns
The same instance of IDependencyBuilder so that you can chain methods together.

Implements Beamable.Common.Dependencies.IDependencyBuilder.

◆ AddSingleton< TInterface, TImpl >() [1/4]

Add a singleton service to the IDependencyBuilder.

A singleton service will be instantiated once, and the same instance will be requested from IDependencyProvider.GetService. Even if you use Clone, the one instance will be returned for all children providers.

The instance will automatically be created by using the first available constructor of the TImpl type, and providing parameters for the constructor from the IDependencyProvider itself

Template Parameters
TInterfaceThe type that is actually registered in the IDependencyBuilder. There can only be one registration for this type per IDependencyBuilder
TImplThe concrete type of the instance that will be returned from IDependencyProvider.GetService
Returns
The same instance of IDependencyBuilder so that you can chain methods together.

Implements Beamable.Common.Dependencies.IDependencyBuilder.

Type Constraints
TImpl :TInterface 
TImpl :AddSingleton 
TImpl :TInterface 
TImpl :TImpl 
TImpl :factory 
TImpl :Instantiate<TImpl> 
TImpl :factory 

◆ AddSingleton< TInterface, TImpl >() [2/4]

IDependencyBuilder Beamable.Common.Dependencies.DependencyBuilder.AddSingleton< TInterface, TImpl > ( Func< IDependencyProvider, TInterface >  factory)
inline

Add a singleton service to the IDependencyBuilder.

A singleton service will be instantiated once, and the same instance will be requested from IDependencyProvider.GetService. Even if you use Clone, the one instance will be returned for all children providers.

Parameters
factoryA function that takes a IDependencyProvider and produces an instance of TInterface
Template Parameters
TInterfaceThe type that is actually registered in the IDependencyBuilder. There can only be one registration for this type per IDependencyBuilder
TImplThe concrete type of the instance that will be returned from IDependencyProvider.GetService
Returns
The same instance of IDependencyBuilder so that you can chain methods together.

Implements Beamable.Common.Dependencies.IDependencyBuilder.

Type Constraints
TImpl :TInterface 

◆ AddSingleton< TInterface, TImpl >() [3/4]

IDependencyBuilder Beamable.Common.Dependencies.DependencyBuilder.AddSingleton< TInterface, TImpl > ( Func< TInterface >  factory)

Add a singleton service to the IDependencyBuilder.

A singleton service will be instantiated once, and the same instance will be requested from IDependencyProvider.GetService. Even if you use Clone, the one instance will be returned for all children providers.

Parameters
factoryA function that produces an instance of TInterface
Template Parameters
TInterfaceThe type that is actually registered in the IDependencyBuilder. There can only be one registration for this type per IDependencyBuilder
TImplThe concrete type of the instance that will be returned from IDependencyProvider.GetService
Returns
The same instance of IDependencyBuilder so that you can chain methods together.

Implements Beamable.Common.Dependencies.IDependencyBuilder.

Type Constraints
TImpl :TInterface 
TImpl :AddSingleton 
TImpl :TInterface 
TImpl :TImpl 
TImpl :_ 
TImpl :factory() 

◆ AddSingleton< TInterface, TImpl >() [4/4]

Add a singleton service to the IDependencyBuilder.

A singleton service will be instantiated once, and the same instance will be requested from IDependencyProvider.GetService. Even if you use Clone, the one instance will be returned for all children providers.

Parameters
serviceA value instance of TInterface
Template Parameters
TInterfaceThe type that is actually registered in the IDependencyBuilder. There can only be one registration for this type per IDependencyBuilder
TImplThe concrete type of the instance that will be returned from IDependencyProvider.GetService
Returns
The same instance of IDependencyBuilder so that you can chain methods together.

Implements Beamable.Common.Dependencies.IDependencyBuilder.

Type Constraints
TImpl :TInterface 
TImpl :AddSingleton 
TImpl :TInterface 
TImpl :TImpl 
TImpl :_ 
TImpl :service 

◆ AddTransient< T >() [1/3]

IDependencyBuilder Beamable.Common.Dependencies.DependencyBuilder.AddTransient< T > ( )

Add a transient service to the IDependencyBuilder. A transient service will be re-instantiated everytime it is requested from IDependencyProvider.GetService.

The instance will automatically be created by using the first available constructor of the TImpl type, and providing parameters for the constructor from the IDependencyProvider itself

Template Parameters
TThe type that is actually registered in the IDependencyBuilder. There can only be one registration for this type per IDependencyBuilder
Returns
The same instance of IDependencyBuilder so that you can chain methods together.

Implements Beamable.Common.Dependencies.IDependencyBuilder.

◆ AddTransient< T >() [2/3]

IDependencyBuilder Beamable.Common.Dependencies.DependencyBuilder.AddTransient< T > ( Func< IDependencyProvider, T >  factory)

Add a transient service to the IDependencyBuilder. A transient service will be re-instantiated everytime it is requested from IDependencyProvider.GetService.

Parameters
factoryA function that takes a IDependencyProvider and produces an instance of TInterface
Template Parameters
TThe type that is actually registered in the IDependencyBuilder. There can only be one registration for this type per IDependencyBuilder
Returns
The same instance of IDependencyBuilder so that you can chain methods together.

Implements Beamable.Common.Dependencies.IDependencyBuilder.

◆ AddTransient< T >() [3/3]

IDependencyBuilder Beamable.Common.Dependencies.DependencyBuilder.AddTransient< T > ( Func< T >  factory)

Add a transient service to the IDependencyBuilder. A transient service will be re-instantiated everytime it is requested from IDependencyProvider.GetService.

Parameters
factoryA function that produces an instance of TInterface
Template Parameters
TThe type that is actually registered in the IDependencyBuilder. There can only be one registration for this type per IDependencyBuilder
Returns
The same instance of IDependencyBuilder so that you can chain methods together.

Implements Beamable.Common.Dependencies.IDependencyBuilder.

◆ AddTransient< TInterface, TImpl >() [1/3]

IDependencyBuilder Beamable.Common.Dependencies.DependencyBuilder.AddTransient< TInterface, TImpl > ( )

Add a transient service to the IDependencyBuilder. A transient service will be re-instantiated everytime it is requested from IDependencyProvider.GetService.

The instance will automatically be created by using the first available constructor of the TImpl type, and providing parameters for the constructor from the IDependencyProvider itself

Template Parameters
TInterfaceThe type that is actually registered in the IDependencyBuilder. There can only be one registration for this type per IDependencyBuilder
TImplThe concrete type of the instance that will be returned from IDependencyProvider.GetService
Returns
The same instance of IDependencyBuilder so that you can chain methods together.

Implements Beamable.Common.Dependencies.IDependencyBuilder.

Type Constraints
TImpl :TInterface 
TImpl :AddTransient 
TImpl :TInterface 
TImpl :TImpl 
TImpl :factory 
TImpl :Instantiate<TImpl> 
TImpl :factory 

◆ AddTransient< TInterface, TImpl >() [2/3]

IDependencyBuilder Beamable.Common.Dependencies.DependencyBuilder.AddTransient< TInterface, TImpl > ( Func< IDependencyProvider, TInterface >  factory)
inline

Add a transient service to the IDependencyBuilder. A transient service will be re-instantiated everytime it is requested from IDependencyProvider.GetService.

Parameters
factoryA function that takes a IDependencyProvider and produces an instance of TInterface
Template Parameters
TInterfaceThe type that is actually registered in the IDependencyBuilder. There can only be one registration for this type per IDependencyBuilder
TImplThe concrete type of the instance that will be returned from IDependencyProvider.GetService
Returns
The same instance of IDependencyBuilder so that you can chain methods together.

Implements Beamable.Common.Dependencies.IDependencyBuilder.

Type Constraints
TImpl :TInterface 

◆ AddTransient< TInterface, TImpl >() [3/3]

IDependencyBuilder Beamable.Common.Dependencies.DependencyBuilder.AddTransient< TInterface, TImpl > ( Func< TInterface >  factory)

Add a transient service to the IDependencyBuilder. A transient service will be re-instantiated everytime it is requested from IDependencyProvider.GetService.

Parameters
factoryA function that produces an instance of TInterface
Template Parameters
TInterfaceThe type that is actually registered in the IDependencyBuilder. There can only be one registration for this type per IDependencyBuilder
TImplThe concrete type of the instance that will be returned from IDependencyProvider.GetService
Returns
The same instance of IDependencyBuilder so that you can chain methods together.

Implements Beamable.Common.Dependencies.IDependencyBuilder.

Type Constraints
TImpl :TInterface 
TImpl :AddTransient 
TImpl :TInterface 
TImpl :TImpl 
TImpl :_ 
TImpl :factory() 

◆ Build()

IDependencyProviderScope Beamable.Common.Dependencies.DependencyBuilder.Build ( )
inline

After you have registered all your services, use this method to finalize the builder and produce a IDependencyProvider that can be used to get services. The actual return value will be a IDependencyProviderScope which has lifecycle controls for the IDependencyProvider

Returns
A IDependencyProviderScope instance

Implements Beamable.Common.Dependencies.IDependencyBuilder.

◆ Clone()

IDependencyBuilder Beamable.Common.Dependencies.DependencyBuilder.Clone ( )
inline

Clones the IDependencyBuilder. The resulting builder will have of the same registrations that the current instance has. However, if you add any services to the original instance, or the returned instance, the addition won't affect the service registration state of the builder.

Returns
A new IDependencyBuilder

Implements Beamable.Common.Dependencies.IDependencyBuilder.

◆ Has< T >()

bool Beamable.Common.Dependencies.DependencyBuilder.Has< T > ( )
inline

Returns true is the given service has been registered.

Template Parameters
TThe type of service to check for
Returns
True if the service is registered in the builder, False otherwise

Implements Beamable.Common.Dependencies.IDependencyBuilder.

◆ Remove< T >()

IDependencyBuilder Beamable.Common.Dependencies.DependencyBuilder.Remove< T > ( )
inline

Removes a service of some type that was added with any of the AddTransient, AddScoped, or AddSingleton calls. It doesn't matter how the type was registered. If no service was added, then this method will throw an exception. Use RemoveIfExists<T> to avoid the exception.

Template Parameters
TThe type of service to remove
Returns
The same instance of IDependencyBuilder so that you can chain methods together.

Implements Beamable.Common.Dependencies.IDependencyBuilder.

◆ RemoveIfExists< T >()

IDependencyBuilder Beamable.Common.Dependencies.DependencyBuilder.RemoveIfExists< T > ( )

Removes a service of some type that was added with any of the AddTransient, AddScoped, or AddSingleton calls. It doesn't matter how the type was registered. If no service was added, then this method is a no-op.

Template Parameters
TThe type of service to remove
Returns
The same instance of IDependencyBuilder so that you can chain methods together.

Implements Beamable.Common.Dependencies.IDependencyBuilder.


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