Provides a dependency injection service.
More...
|
bool | RegisterDependency< TIDep, TDep > (DependencyLifetime lifetime, bool replace=false) |
| Registers a dependency. More...
|
|
bool | RegisterDependency< TIDep, TDep > (DependencyLifetime lifetime, object[] args, bool replace=false) |
| Registers a dependency. More...
|
|
bool | RegisterDependency< TIDep > (DependencyLifetime lifetime, Func< DependapultService, TIDep > creatorFunction, bool replace=false) |
| Registers a dependency. More...
|
|
bool | RegisterSingleton< TIDep, TDep > () |
| Registers a singleton dependency. More...
|
|
bool | RegisterSingleton< TIDep, TDep > (object[] args) |
| Registers a singleton dependency. More...
|
|
bool | RegisterSingleton< TIDep > (Func< DependapultService, TIDep > creatorFunction) |
| Registers a singleton dependency. More...
|
|
bool | RegisterTransient< TIDep, TDep > (bool replace=false) |
| Registers a transient dependency. More...
|
|
bool | RegisterTransient< TIDep, TDep > (object[] args, bool replace=false) |
| Registers a transient dependency. More...
|
|
bool | RegisterTransient< TIDep > (Func< DependapultService, TIDep > creatorFunction, bool replace=false) |
| Registers a transient dependency. More...
|
|
TIDep | GetDependency< TIDep > () |
| Gets a dependency object. More...
|
|
object | GetDependency (Type type) |
| Gets a dependency object. No casting is applied. More...
|
|
Provides a dependency injection service.
◆ GetDependency()
object Dependapult.DependapultService.GetDependency |
( |
Type |
type | ) |
|
Gets a dependency object. No casting is applied.
- Parameters
-
type | Interface of base type of a dependency. |
- Returns
- Object.
- Exceptions
-
CouldNotCreateObjectOfTypeException | |
TypeNotRegisteredException | |
◆ GetDependency< TIDep >()
Gets a dependency object.
- Template Parameters
-
TIDep | Interface or base type of a dependency. |
- Returns
- Object of TIDep type.
- Exceptions
-
CouldNotCreateObjectOfTypeException | |
TypeNotRegisteredException | |
◆ RegisterDependency< TIDep >()
Registers a dependency.
- Template Parameters
-
TIDep | Interface of base type of a dependency. |
- Parameters
-
lifetime | Lifetime of the object that will be created. |
creatorFunction | Function which returns an object of TIDep type. |
replace | Should an already registered dependency of type TIDep be replaced. Only valid for transient lifetime. |
- Returns
- True, if a dependecy was registered.
- Exceptions
-
ArgumentException | |
IllegalTypeRegistrationException | |
CouldNotCreateObjectOfTypeException | |
◆ RegisterDependency< TIDep, TDep >() [1/2]
bool Dependapult.DependapultService.RegisterDependency< TIDep, TDep > |
( |
DependencyLifetime |
lifetime, |
|
|
bool |
replace = false |
|
) |
| |
Registers a dependency.
- Template Parameters
-
TIDep | Interface or base type of a dependency. |
TDep | Specific implementation tyoe of a dependency. |
- Parameters
-
lifetime | Lifetime of the object that will be created. |
replace | Should an already registered dependency of type TIDep be replaced. Only valid for transient lifetime. |
- Returns
- True, if a dependency was registered.
- Exceptions
-
ArgumentException | |
IllegalTypeRegistrationException | |
CouldNotCreateObjectOfTypeException | |
◆ RegisterDependency< TIDep, TDep >() [2/2]
bool Dependapult.DependapultService.RegisterDependency< TIDep, TDep > |
( |
DependencyLifetime |
lifetime, |
|
|
object[] |
args, |
|
|
bool |
replace = false |
|
) |
| |
Registers a dependency.
- Template Parameters
-
TIDep | Interface or base type of a dependency. |
TDep | Specific implementation tyoe of a dependency. |
- Parameters
-
lifetime | Lifetime of the object that will be created. |
args | Arguments to pass when creating an object of type TDep. |
replace | Should an already registered dependency of type TIDep be replaced. Only valid for transient lifetime. |
- Returns
- True, if a dependency was registered.
- Exceptions
-
ArgumentException | |
IllegalTypeRegistrationException | |
CouldNotCreateObjectOfTypeException | |
◆ RegisterSingleton< TIDep >()
bool Dependapult.DependapultService.RegisterSingleton< TIDep > |
( |
Func< DependapultService, TIDep > |
creatorFunction | ) |
|
Registers a singleton dependency.
- Template Parameters
-
TIDep | Interface or base type of a dependency. |
- Parameters
-
creatorFunction | Function which returns an object of TIDep type. |
- Returns
- True, if a dependecy was registered.
◆ RegisterSingleton< TIDep, TDep >() [1/2]
bool Dependapult.DependapultService.RegisterSingleton< TIDep, TDep > |
( |
| ) |
|
Registers a singleton dependency.
- Template Parameters
-
TIDep | Interface or base type of a dependency. |
TDep | Specific implementation tyoe of a dependency. |
- Returns
- True, if a dependecy was registered.
- Exceptions
-
CouldNotCreateObjectOfTypeException | |
◆ RegisterSingleton< TIDep, TDep >() [2/2]
bool Dependapult.DependapultService.RegisterSingleton< TIDep, TDep > |
( |
object[] |
args | ) |
|
Registers a singleton dependency.
- Template Parameters
-
TIDep | Interface or base type of a dependency. |
TDep | Specific implementation tyoe of a dependency. |
- Parameters
-
args | Arguments to pass when creating an object of type TDep. |
- Returns
- True, if a dependecy was registered.
- Exceptions
-
CouldNotCreateObjectOfTypeException | |
◆ RegisterTransient< TIDep >()
bool Dependapult.DependapultService.RegisterTransient< TIDep > |
( |
Func< DependapultService, TIDep > |
creatorFunction, |
|
|
bool |
replace = false |
|
) |
| |
Registers a transient dependency.
- Template Parameters
-
TIDep | Interface or base type of a dependency. |
- Parameters
-
creatorFunction | Function which returns an object of TIDep type. |
replace | Should an already registered dependency of type TIDep be replaced. Only valid for transient lifetime. |
- Returns
- True, if a dependecy was registered
- Exceptions
-
CouldNotCreateObjectOfTypeException | |
◆ RegisterTransient< TIDep, TDep >() [1/2]
bool Dependapult.DependapultService.RegisterTransient< TIDep, TDep > |
( |
bool |
replace = false | ) |
|
Registers a transient dependency.
- Template Parameters
-
TIDep | Interface or base type of a dependency. |
TDep | Specific implementation tyoe of a dependency. |
- Parameters
-
replace | Should an already registered dependency of type TIDep be replaced. Only valid for transient lifetime. |
- Returns
- True, if a dependecy was registered.
- Exceptions
-
CouldNotCreateObjectOfTypeException | |
◆ RegisterTransient< TIDep, TDep >() [2/2]
bool Dependapult.DependapultService.RegisterTransient< TIDep, TDep > |
( |
object[] |
args, |
|
|
bool |
replace = false |
|
) |
| |
Registers a transient dependency.
- Template Parameters
-
TIDep | Interface or base type of a dependency. |
TDep | Specific implementation tyoe of a dependency. |
- Parameters
-
args | Arguments to pass when creating an object of type TDep. |
replace | Should an already registered dependency of type TIDep be replaced. Only valid for transient lifetime. |
- Returns
- True, if a dependecy was registered.
- Exceptions
-
CouldNotCreateObjectOfTypeException | |
The documentation for this class was generated from the following file:
- Dependapult/DependapultService.cs