title: c# looping object creation
body: <p>I'm very new with c#, and was previously attempting to ignore classes and build my small program structurally more similar to PHP. After reaching a road block, I'm trying to start over and approach the problem properly OO. I'm taking a long file, and in a loop, every time certain conditions are met, I want to make a new object. How can I have it create a new object, without having to specify a unique name?</p>
  
  <pre><code>Referral ObjectName = new Referral(string, string, int);
  </code></pre>
  
  <p>Secondly, once this is done, and the strings &amp; int set their appropriate object properties, how can i unique-ify the class by one property, and then sort the class by another?</p>
  
  <p>I'm sorry if these are basic questions, I have spent a large, large amount of time first trying to figure it out on my own with google, and a textbook. If only C# would allow multi-dimensional arrays with different types!</p>
  
  <p>Thank you so much!</p>
  
  <p>PS. I do mean to extract a list of unique objects.</p>
  
  <p>All these answers, while helpful, seem to involve creating a shadow set of IEnumerables. Is there no way to do this with the class itself?</p>
  
  <p>Trying the first solution, provided by Earwicker, adding each object to a List from within the loop, when I try to Write a property of the element to the console, i get the ClassName+Referral. What could I be doing wrong?--solved. still needed .property</p>
  
  <p>still working. . .</p>