Returning multiple objects and enumerate over it
<p>I have a method which returns a <code>WorkInfo</code> object. It has 2 properties <code>CompanyName</code> and <code>WorkLocation</code>.</p>

<p>It might happen that a person has worked at multiple companies. In this case i want to </p>

<ol>
<li><p>Return an array of <code>WorkInfo</code> object</p></li>
<li><p>After the <code>WorkInfo</code> object is returned to calling method, i need to enumerate over it in following way</p>

<pre><code>foreach(WorkItem wRow in WorkInfo) 
{
   string s1 = wRow.CompanyName ;
   string s2 = wRow.WorkLocation;
}
</code></pre></li>
</ol>

<p>How do i achieve this in C# ?</p>

<p><strong>UPDATE :</strong> 
All i need to do is return a collection of multiple objects of same type and loop over it using ForEach.</p>

<p>eg A datatable returns a collection of datarows and we can loop over it using ForEach(Datarow dr in datatable.Rows)</p>

<p>Similarly, what exactly should i do to return a collection of "WorkInfo" objects which i can loop over using ForEach ?</p>
