mirror of
https://github.com/mbierlee/poodinis.git
synced 2024-11-15 04:04:01 +01:00
Don't use deprecated registration option and method in tutorial
This commit is contained in:
parent
9ebbb5d917
commit
d34e35d877
|
@ -34,9 +34,9 @@ auto exampleClassInstance = dependencies.resolve!ExampleInterface;
|
|||
auto exampleClassInstance2 = dependencies.resolve!ExampleClass;
|
||||
assert(exampleClassInstance is exampleClassInstance2);
|
||||
```
|
||||
If you want to prevent registrations from being both registered by interface and concrete type, use the DO_NOT_ADD_CONCRETE_TYPE_REGISTRATION option when registering:
|
||||
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.DO_NOT_ADD_CONCRETE_TYPE_REGISTRATION);
|
||||
dependencies.register!(ExampleInterface, ExampleClass)([RegistrationOptions.doNotAddConcreteTypeRegistration]);
|
||||
auto exampleClassInstance = dependencies.resolve!ExampleInterface;
|
||||
auto exampleClassInstance2 = dependencies.resolve!ExampleClass; // A ResolveException is thrown
|
||||
```
|
||||
|
|
Loading…
Reference in a new issue