Beamable SDK
|
The default implementation of IDependencyBuilder. It is not recommended that you ever use this class directly. You should only ever reference the interface. More...
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< ServiceDescriptor > | TransientServices = new List<ServiceDescriptor>() [getprotected set] |
List< ServiceDescriptor > | ScopedServices = new List<ServiceDescriptor>() [getprotected set] |
List< ServiceDescriptor > | SingletonServices = new List<ServiceDescriptor>() [getprotected set] |
The default implementation of IDependencyBuilder. It is not recommended that you ever use this class directly. You should only ever reference the interface.
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
T | The type that is actually registered in the IDependencyBuilder. There can only be one registration for this type per IDependencyBuilder |
Implements Beamable.Common.Dependencies.IDependencyBuilder.
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.
factory | A function that takes a IDependencyProvider and produces an instance of TInterface |
T | The type that is actually registered in the IDependencyBuilder. There can only be one registration for this type per IDependencyBuilder |
Implements Beamable.Common.Dependencies.IDependencyBuilder.
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.
factory | A function that produces an instance of TInterface |
T | The type that is actually registered in the IDependencyBuilder. There can only be one registration for this type per IDependencyBuilder |
Implements Beamable.Common.Dependencies.IDependencyBuilder.
IDependencyBuilder Beamable.Common.Dependencies.DependencyBuilder.AddScoped< T > | ( | 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.
service | a value of T that will be used as the scoped instance |
T | The type that is actually registered in the IDependencyBuilder. There can only be one registration for this type per IDependencyBuilder |
Implements Beamable.Common.Dependencies.IDependencyBuilder.
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
TInterface | The type that is actually registered in the IDependencyBuilder. There can only be one registration for this type per IDependencyBuilder |
TImpl | The concrete type of the instance that will be returned from IDependencyProvider.GetService |
Implements Beamable.Common.Dependencies.IDependencyBuilder.
TImpl | : | TInterface | |
TImpl | : | AddScoped | |
TImpl | : | TInterface | |
TImpl | : | TImpl | |
TImpl | : | factory | |
TImpl | : | Instantiate<TImpl> | |
TImpl | : | 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.
factory | A function that takes a IDependencyProvider and produces an instance of TInterface |
TInterface | The type that is actually registered in the IDependencyBuilder. There can only be one registration for this type per IDependencyBuilder |
TImpl | The concrete type of the instance that will be returned from IDependencyProvider.GetService |
Implements Beamable.Common.Dependencies.IDependencyBuilder.
TImpl | : | TInterface |
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.
factory | A function that produces an instance of TInterface |
TInterface | The type that is actually registered in the IDependencyBuilder. There can only be one registration for this type per IDependencyBuilder |
TImpl | The concrete type of the instance that will be returned from IDependencyProvider.GetService |
Implements Beamable.Common.Dependencies.IDependencyBuilder.
TImpl | : | TInterface | |
TImpl | : | AddScoped | |
TImpl | : | TInterface | |
TImpl | : | TImpl | |
TImpl | : | _ | |
TImpl | : | factory() |
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.
service | a value of TInterface that will be used as the scoped instance |
TInterface | The type that is actually registered in the IDependencyBuilder. There can only be one registration for this type per IDependencyBuilder |
TImpl | The concrete type of the instance that will be returned from IDependencyProvider.GetService |
Implements Beamable.Common.Dependencies.IDependencyBuilder.
TImpl | : | TInterface | |
TImpl | : | AddScoped | |
TImpl | : | TInterface | |
TImpl | : | TImpl | |
TImpl | : | _ | |
TImpl | : | service |
|
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
t | The type of the service that is registered |
Implements Beamable.Common.Dependencies.IDependencyBuilder.
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
T | The type that is actually registered in the IDependencyBuilder. There can only be one registration for this type per IDependencyBuilder |
Implements Beamable.Common.Dependencies.IDependencyBuilder.
IDependencyBuilder Beamable.Common.Dependencies.DependencyBuilder.AddSingleton< T > | ( | Func< IDependencyProvider, T > | 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.
factory | A function that takes a IDependencyProvider and produces an instance of T |
T | The type that is actually registered in the IDependencyBuilder. There can only be one registration for this type per IDependencyBuilder |
Implements Beamable.Common.Dependencies.IDependencyBuilder.
IDependencyBuilder Beamable.Common.Dependencies.DependencyBuilder.AddSingleton< T > | ( | Func< T > | 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.
factory | A function that produces an instance of T |
T | The type that is actually registered in the IDependencyBuilder. There can only be one registration for this type per IDependencyBuilder |
Implements Beamable.Common.Dependencies.IDependencyBuilder.
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.
service | A value instance of TInterface |
T | The type that is actually registered in the IDependencyBuilder. There can only be one registration for this type per IDependencyBuilder |
Implements Beamable.Common.Dependencies.IDependencyBuilder.
|
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).
registeredType | The service is added tied to this type. Once the services are built, use this type to retrieve it. |
factory | A function that produces an instance of registeredType . This type must inherit from T . |
T | A parent type of registeredType . |
Implements Beamable.Common.Dependencies.IDependencyBuilder.
IDependencyBuilder Beamable.Common.Dependencies.DependencyBuilder.AddSingleton< TInterface, TImpl > | ( | ) |
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
TInterface | The type that is actually registered in the IDependencyBuilder. There can only be one registration for this type per IDependencyBuilder |
TImpl | The concrete type of the instance that will be returned from IDependencyProvider.GetService |
Implements Beamable.Common.Dependencies.IDependencyBuilder.
TImpl | : | TInterface | |
TImpl | : | AddSingleton | |
TImpl | : | TInterface | |
TImpl | : | TImpl | |
TImpl | : | factory | |
TImpl | : | Instantiate<TImpl> | |
TImpl | : | 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.
factory | A function that takes a IDependencyProvider and produces an instance of TInterface |
TInterface | The type that is actually registered in the IDependencyBuilder. There can only be one registration for this type per IDependencyBuilder |
TImpl | The concrete type of the instance that will be returned from IDependencyProvider.GetService |
Implements Beamable.Common.Dependencies.IDependencyBuilder.
TImpl | : | TInterface |
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.
factory | A function that produces an instance of TInterface |
TInterface | The type that is actually registered in the IDependencyBuilder. There can only be one registration for this type per IDependencyBuilder |
TImpl | The concrete type of the instance that will be returned from IDependencyProvider.GetService |
Implements Beamable.Common.Dependencies.IDependencyBuilder.
TImpl | : | TInterface | |
TImpl | : | AddSingleton | |
TImpl | : | TInterface | |
TImpl | : | TImpl | |
TImpl | : | _ | |
TImpl | : | factory() |
IDependencyBuilder Beamable.Common.Dependencies.DependencyBuilder.AddSingleton< TInterface, TImpl > | ( | TInterface | service | ) |
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.
service | A value instance of TInterface |
TInterface | The type that is actually registered in the IDependencyBuilder. There can only be one registration for this type per IDependencyBuilder |
TImpl | The concrete type of the instance that will be returned from IDependencyProvider.GetService |
Implements Beamable.Common.Dependencies.IDependencyBuilder.
TImpl | : | TInterface | |
TImpl | : | AddSingleton | |
TImpl | : | TInterface | |
TImpl | : | TImpl | |
TImpl | : | _ | |
TImpl | : | service |
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
T | The type that is actually registered in the IDependencyBuilder. There can only be one registration for this type per IDependencyBuilder |
Implements Beamable.Common.Dependencies.IDependencyBuilder.
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.
factory | A function that takes a IDependencyProvider and produces an instance of TInterface |
T | The type that is actually registered in the IDependencyBuilder. There can only be one registration for this type per IDependencyBuilder |
Implements Beamable.Common.Dependencies.IDependencyBuilder.
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.
factory | A function that produces an instance of TInterface |
T | The type that is actually registered in the IDependencyBuilder. There can only be one registration for this type per IDependencyBuilder |
Implements Beamable.Common.Dependencies.IDependencyBuilder.
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
TInterface | The type that is actually registered in the IDependencyBuilder. There can only be one registration for this type per IDependencyBuilder |
TImpl | The concrete type of the instance that will be returned from IDependencyProvider.GetService |
Implements Beamable.Common.Dependencies.IDependencyBuilder.
TImpl | : | TInterface | |
TImpl | : | AddTransient | |
TImpl | : | TInterface | |
TImpl | : | TImpl | |
TImpl | : | factory | |
TImpl | : | Instantiate<TImpl> | |
TImpl | : | factory |
|
inline |
Add a transient service to the IDependencyBuilder. A transient service will be re-instantiated everytime it is requested from IDependencyProvider.GetService.
factory | A function that takes a IDependencyProvider and produces an instance of TInterface |
TInterface | The type that is actually registered in the IDependencyBuilder. There can only be one registration for this type per IDependencyBuilder |
TImpl | The concrete type of the instance that will be returned from IDependencyProvider.GetService |
Implements Beamable.Common.Dependencies.IDependencyBuilder.
TImpl | : | TInterface |
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.
factory | A function that produces an instance of TInterface |
TInterface | The type that is actually registered in the IDependencyBuilder. There can only be one registration for this type per IDependencyBuilder |
TImpl | The concrete type of the instance that will be returned from IDependencyProvider.GetService |
Implements Beamable.Common.Dependencies.IDependencyBuilder.
TImpl | : | TInterface | |
TImpl | : | AddTransient | |
TImpl | : | TInterface | |
TImpl | : | TImpl | |
TImpl | : | _ | |
TImpl | : | factory() |
|
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
Implements Beamable.Common.Dependencies.IDependencyBuilder.
|
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.
Implements Beamable.Common.Dependencies.IDependencyBuilder.
|
inline |
Returns true is the given service has been registered.
T | The type of service to check for |
Implements Beamable.Common.Dependencies.IDependencyBuilder.
|
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.
T | The type of service to remove |
Implements Beamable.Common.Dependencies.IDependencyBuilder.
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.
T | The type of service to remove |
Implements Beamable.Common.Dependencies.IDependencyBuilder.