I've being considering using reflection within a classes .ToString() method, something along the lines of this:
public override string ToString()
{
StringBuilder toString = new StringBuilder();
PropertyInfo[] props = GetType().GetProperties();
foreach (PropertyInfo prop in props)
{
toString.AppendFormat("{0} : {1} || ", prop.Name, prop.GetValue(this, null));
}
return toString.ToString();
}
Is this smelly code?