TypeEdge
TypeEdge copied to clipboard
Better support for complex objects in Module Twins
This line of code in the TypeTwin class and also the JsonFlatteningConverter seem to work in a way that complex objects in Module twins are not really supported. Instead, they are flattened into a string - which not only affects the code on the module / device side (the complex object needs to implement IConvertible), but it also affects the actual structure of the Module Twin properties in the IoT Hub module twin, so this also affects the backend side of things.
Can you elaborate on why you are doing this Convert.ChangeType(prop.GetValue(this), typeof(string)), instead of serializing complex objects into the TwinCollection respecting their nested data structure?