title: Iterate over object fields in C#
body: <p><code>Foo</code> is a class with a lot of string fields. I want to create a method <code>Wizardify</code> that performs an operation on many of the fields of the object. I could do it like this:</p>
  
  <pre><code>Foo Wizardify(Foo input)
  {
      Foo result;
      result.field1 = Bar(input.field1);
      result.field2 = Bar(input.field2);
      result.field3 = Bar(input.field3);
      ...
  </code></pre>
  
  <p>This is some easily generated code, but I prefer not to waste fifty lines on this. Is there a way to go over selected fields of an object? Note that there are four or five fields I want to work on in a different way and they should be excluded from the iteration.</p>