Closed sandervandevelde closed 5 years ago
As discussed in https://github.com/microsoft/vscode-azure-iot-edge/issues/503
In the C# module template and the C# function template, a message is constructed:
var pipeMessage = new Message(messageBytes);
The Message class implements the Dispose method. The Message class must follow the Dispose pattern to ensure it's disposed in all paths.
With 'using()' we can enforce the Dispose pattern.
This is also in sync with eg. the https://docs.microsoft.com/en-us/azure/iot-edge/tutorial-csharp-module documentation.
Thanks for the contribution, looks good to me. We will merge this PR after test.
As discussed in https://github.com/microsoft/vscode-azure-iot-edge/issues/503
In the C# module template and the C# function template, a message is constructed:
var pipeMessage = new Message(messageBytes);
The Message class implements the Dispose method. The Message class must follow the Dispose pattern to ensure it's disposed in all paths.
With 'using()' we can enforce the Dispose pattern.
This is also in sync with eg. the https://docs.microsoft.com/en-us/azure/iot-edge/tutorial-csharp-module documentation.