This update had some visual updates and now supports a Singleton pattern for the Device client too.
But it also included support for bothDevice twinsand Direct Methods. The latter feature looks a lot like the Commands method but there are some fundamental changes.
Yes, both solutions (Command and Direct Method) can execute code on a remote IoT Hub client. But the remote method just passes a message to the client. The Direct method can pass a message in a certain context. It calls a specific method (a client can have multiple methods registered) and passes the JSON parameter.
If you execute a Command, it feels like fire-and-forget. There is no descriptive response. But the caller of a Direct Method can wait until a response is accepted and a JSON value is returned.
Let’s check out Direct Methods.
It all starts with that Connected Service extension in Visual Studio 2017.