Is there a way in c# to loop over the properties of a class?
Basically I have a class that contains a large number of property\'s (it basically holds the results of
Use something like
StringBuilder csv = String.Empty; PropertyInfo[] ps this.GetType().GetProperties(); foreach (PropertyInfo p in ps) { csv.Append(p.GetValue(this, null); csv.Append(","); }