You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, in a header I have to display the name + data type of the properties from a list of C# objects (from file or stream etc).
Can you help me, is there a function in CHO that can take any POCO class / record object, and give me the nested nullable & non-nullable properties type along with the names of the properties. I wrote some code, but run into issues when its nullable.
Most of the time the objects are flat, so if I can get that it would solve 95% of my issues, would be helpful if I knew how to connect this up natively with CHOetl
For a nested C# object with more levels, I converted to expando... I did this with SO help.
private static Dictionary<string, object> FlattenDimensions(dynamic[] dimensions)
{
var flattened = new Dictionary<string, object>();
foreach (var dimension in dimensions)
{
var dict = (IDictionary<string, object>)dimension;
foreach (var item in dict)
{
flattened.Add(item.Key, item.Value);
}
}
return flattened;
}
The text was updated successfully, but these errors were encountered:
Hello, in a header I have to display the
name + data type
of the properties from a list of C# objects (from file or stream etc).Can you help me, is there a function in CHO that can take any POCO class / record object, and give me the nested
nullable & non-nullable properties type
along with the names of the properties. I wrote some code, but run into issues when its nullable.Most of the time the objects are flat, so if I can get that it would solve 95% of my issues, would be helpful if I knew how to connect this up natively with CHOetl
For a nested C# object with more levels, I converted to expando... I did this with SO help.
The text was updated successfully, but these errors were encountered: