Replies: 5 comments
-
Hi, I did not look at WebAPI for a long time and I don't remember who is responsible for disposing the scope. From the code alone, I see that the framework should supposedly call the And at end of request the scope should be disposed via So, in principle, those methods should be hooked and called somewhere. I don't know where. |
Beta Was this translation helpful? Give feedback.
-
Yup. My debugging led me to the same conclusion: there is a resolver adapter ( |
Beta Was this translation helpful? Give feedback.
-
Maybe try to search for DryIoc WebApi examples. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
@Madajevas
It is just an implementation detail which stores the disposables. |
Beta Was this translation helpful? Give feedback.
-
Hey. I have the following in .NET 4.8 WEB API project:
New instance of
TheDependency
gets created and injected intoValuesController
each time controller is necessary, however, once request is finishedDispose
is never called onTheDependency
. If scope is created and disposed manually (as inGet
action with parameter) andTheDependency
get resolved using that scope,Dispose
is invoked.Shouldn't disposable dependencies be disposed when web request scope is being disposed? What am I missing? DryIoc.WebApi.dll v5.0.0 is used.
Beta Was this translation helpful? Give feedback.
All reactions