How can you tell if an object supports using?
I’m following some azure docs and it uses the code using(var cache = ConnectionMultiplexer.Connect()) I understand that it frees all the caches resources and closes the connection when it’s finished but I’m wondering if given a random class how do you know if it supports that type of syntax? Is it in the function signature or would you have to read the code to see if it defines a dispose function?
2 Replies