private void MappNested(object from, JsGenericObject gres)
{
if (from == null)
return;
var propertyInfos = from.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(p => p.CanRead);
foreach (var propertyInfo in propertyInfos)
{
var propertyName = propertyInfo.Name;
object childvalue;
try
{
childvalue = propertyInfo.GetValue(from, null);
}
catch(Exception e)
{
_Logger.Info(()=> $"Unable to convert property {propertyName} from {@from} exception {e}");
continue;
}
var childres = InternalMap(childvalue);
gres.UpdateCSharpProperty(propertyName, childres);
}
}