Since the coming of the K2 SmartObject Service in KB1230 , people might have noticed the smartobjectVersion parameter in the managedEndpoints definition. Since SmartObjects have been around, they always had a version. The version number starts at 0 (zero) and increases by 1 (one) when the SmartObject is deployed.
Recently in one of our projects, we had to do some performance optimizations that required us to look a bit closer at the resources our application used. In general, you should always dispose an object that’s implementing the IDisposable interface.
K2’s client API’s use a connection to the K2 server which needs to be closed and disposed after you’re done using them. In C# you can use the using-statement to dispose your objects when you’re done with it. The using-statement only works on objects that inherits from IDisposable.
Here are some examples of how to correctly use the using-statement when using K2 API’s.