Como converter seu fantástico objeto personalizado no Dicionário de String, String
(talvez útil para a criação de csv)
Public Class MyObject
'some code ...
Public Function toDictionary() As Dictionary(Of String, String)
Dim d As New Dictionary(Of String, String)
For Each p As System.Reflection.PropertyInfo In Me.GetType.GetProperties()
Try
d.Add(p.Name, p.GetValue(Me, Nothing).ToString)
Catch ex As Exception
'write error message
d.Add(p.Name, ex.Message)
End Try
Next
Return d
End Function
'other code ...
Fim da aula