I have an object that is expensive to create, which uses some unmanaged resources that must be explicitly freed when done with and so implement IDisposable(). I would like a ca
An object should be disposed by the class that creates it. Since your callers have not created the items in the cache, they have no business disposing of them, either.
I'd want to make sure that your factory method is named something like "GetClass" rather than "CreateClass" in order to emphasize that the caller is not responsible for creation, and therefore not for disposal.