Problem: I have a provider class MyProvider that delivers DataContext instances to other handler. MyProvider keeps DataContext instances open for reuse. As this behaviour consumes a lot of memory I wanted MyProvider the create an instance of the DataContext on every request and to dispose it afterwards. As there are many handler requesting one DataContext at the same time via a Getter, I cannot be sure when to dispose the DataContext instance.
I guess there is no magic trick, that tells MyProvider.Getter, when the returned instance is not used anymore?
Thanks