mirror of
https://github.com/mbierlee/poodinis.git
synced 2024-11-15 04:04:01 +01:00
parent
f2ff12dc58
commit
b7eee5e51f
|
@ -23,7 +23,7 @@ In the above example, dependencies on the concrete class and interface will reso
|
|||
|
||||
If you want to prevent registrations from being both registered by interface and concrete type, use the "doNotAddConcreteTypeRegistration" option when registering:
|
||||
```d
|
||||
dependencies.register!(ExampleInterface, ExampleClass)([RegistrationOptions.doNotAddConcreteTypeRegistration]);
|
||||
dependencies.register!(ExampleInterface, ExampleClass)([RegistrationOption.doNotAddConcreteTypeRegistration]);
|
||||
```
|
||||
|
||||
Resolving dependencies
|
||||
|
@ -207,6 +207,6 @@ Persistent Registration Options
|
|||
-------------------------------
|
||||
If you want registration options to be persistent (applicable for every call to register()), you can use the container method setPersistentRegistrationOptions():
|
||||
```d
|
||||
dependencies.setPersistentRegistrationOptions(RegistrationOption.DO_NOT_ADD_CONCRETE_TYPE_REGISTRATION); // Sets the option
|
||||
dependencies.setPersistentRegistrationOptions(RegistrationOption.doNotAddConcreteTypeRegistration); // Sets the option
|
||||
dependencies.unsetPersistentRegistrationOptions(); // Clears the persistentent options
|
||||
```
|
|
@ -137,7 +137,7 @@ synchronized class DependencyContainer {
|
|||
* container.register!(Animal, Cat);
|
||||
* ---
|
||||
*
|
||||
* See_Also: singleInstance, newInstance, existingInstance, RegistrationOptions
|
||||
* See_Also: singleInstance, newInstance, existingInstance, RegistrationOption
|
||||
*/
|
||||
public Registration register(SuperType, ConcreteType : SuperType)(RegistrationOption[] options = []) {
|
||||
TypeInfo registeredType = typeid(SuperType);
|
||||
|
|
Loading…
Reference in a new issue