You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- [With no more registration allowed](#with-no-more-registration-allowed)
15
+
- [Scenarios from the actual Users](#scenarios-from-the-actual-users)
16
+
- [The child container for each test disposed at end of the test without disposing the parent](#the-child-container-for-each-test-disposed-at-end-of-the-test-without-disposing-the-parent)
15
17
16
18
17
19
## No child containers
@@ -68,8 +70,7 @@ public Client(IService service)
68
70
}
69
71
}
70
72
71
-
[Test]
72
-
publicvoidFacade_for_tests()
73
+
[Test]publicvoidFacade_for_tests()
73
74
{
74
75
varcontainer=newContainer();
75
76
@@ -177,8 +178,7 @@ public void Example()
177
178
classWithout_singletons
178
179
{
179
180
publicclassS{}
180
-
[Test]
181
-
publicvoidExample()
181
+
[Test]publicvoidExample()
182
182
{
183
183
IContainercontainer=newContainer();
184
184
container.Register<S>(Reuse.Singleton);
@@ -200,15 +200,13 @@ The method will clone the container registrations but will drop the cache.
200
200
`WithRegistrationsCopy` will create a container clone (child) where the new registration will be isolated from the parent
-[With no more registration allowed](#with-no-more-registration-allowed)
14
+
-[Scenarios from the actual Users](#scenarios-from-the-actual-users)
15
+
-[The child container for each test disposed at end of the test without disposing the parent](#the-child-container-for-each-test-disposed-at-end-of-the-test-without-disposing-the-parent)
14
16
15
17
16
18
## No child containers
@@ -67,8 +69,7 @@ class FacadeExample
67
69
}
68
70
}
69
71
70
-
[Test]
71
-
publicvoidFacade_for_tests()
72
+
[Test]publicvoidFacade_for_tests()
72
73
{
73
74
varcontainer=newContainer();
74
75
@@ -175,8 +176,7 @@ To remove resolved singleton instances from the container:
175
176
classWithout_singletons
176
177
{
177
178
publicclassS { }
178
-
[Test]
179
-
publicvoidExample()
179
+
[Test]publicvoidExample()
180
180
{
181
181
IContainercontainer=newContainer();
182
182
container.Register<S>(Reuse.Singleton);
@@ -198,14 +198,13 @@ The method will clone the container registrations but will drop the cache.
198
198
`WithRegistrationsCopy` will create a container clone (child) where the new registration will be isolated from the parent
199
199
and the vice versa.
200
200
201
-
201
+
```cs
202
202
classWith_registrations_copy
203
203
{
204
204
classA { }
205
205
classB { publicB(Aa) {} }
206
206
207
-
[Test]
208
-
public void Example()
207
+
[Test]publicvoidExample()
209
208
{
210
209
varparent=newContainer();
211
210
parent.Register<A>();
@@ -236,3 +235,54 @@ so the cache from the parent will proceed to be valid and useful.
236
235
237
236
[Explained in detail here](FaqAutofacMigration#separate-build-stage)
238
237
238
+
239
+
## Scenarios from the actual Users
240
+
241
+
### The child container for each test disposed at end of the test without disposing the parent
242
+
243
+
[The related case](https://github.com/dadhi/DryIoc/issues/269)
0 commit comments