title: Assigning values to properties and reusing the code
body: <p>I have some code like this.  But imagine that there are hundreds of lines like this all duplicated across multiple functions.</p>
  
  <pre><code>MyClass.prop1 = doingsomething("test1");
  MyClass.prop2 = doingsomething("test55");
  </code></pre>
  
  <p>I want to reuse my code... how can I do it?</p>
  
  <p>I want to do something like this:</p>
  
  <pre><code>    foreach(ClassInfo)
  {
      dosomethingAssignment(ClassInfo.propertiesToAssign[i], ClassInfoStringIPassedToFunctionInFirstExample[i]);
  }
  </code></pre>
  
  <p>Maybe this isn't the way to do this in C#, but what is the best way to reuse my code?</p>