I'm just looping and appending my properties to a big string:
output.Append(property.GetValue(this).ToString()));
When app braks in that moment property represent a ProductNumber
which is a string, value of this is Product object which has value of ProductNumber = null
, so I've tried something like this:
output.Append(property.GetValue(this)?.ToString()));
But anyway it breaks..
How could I improve this code to avoid breaking there?
Thanks
Cheers
Aucun commentaire:
Enregistrer un commentaire