Update : reason for needing this is I need to create complex objects, deeply nested like document object models. I can not tell if all the properties have been initialised, really looking to see if I missed a property, specially when deeply nested.
In Other words , I need to see if the complete Object tree has been in initialised or I missed a property somewhere.
Can we use Roslyn to generate the object InitializerExpressionSyntax only from code? Not trying to decompile the object as in this post : Can Roslyn generate source code from an object instance?
Would it work with complex/nested objects?