Merging 2 Collection<T>
<p>I got a Function that returns a Collection&lt;string&gt;, and that calls itself recursively to eventually return one big Collection&lt;string&gt;</p>

<p>Now, i just wonder what the best approach to merge the lists? Collection.CopyTo only copies to string[], and using a foreach() loop feels like being inefficient. However, since I also want to filter out duplicates, I feel like i'll end up with a foreach that calls Contains() on the Collection.</p>

<p>I wonder, is there a more efficient way to have a recursive function that returns a list of strings without duplicates? I don't have to use a Collection, it can be pretty much any suitable data type.</p>

<p>Only exclusion, I'm bound to Visual Studio 2005 and .net 3.0, so no LINQ.</p>

<p><strong>Edit:</strong> To clarify: The Function takes a user out of Active Directory, looks at the Direct Reports of the user, and then recursively looks at the direct reports of every user. So the end result is a List of all users that are in the "command chain" of a given user.Since this is executed quite often and at the moment takes 20 Seconds for some users, i'm looking for ways to improve it. Caching the result for 24 Hours is also on my list btw., but I want to see how to improve it before applying caching.</p>
