Trouble iterating Generic list with custom object
<p>Here's the code:</p>

<pre><code>    ProductList products = xxx.GetCarProducts(productCount);
    List&lt;CarImageList&gt; imageList = new List&lt;CarImageList&gt;();


    foreach(Product p in products)
    {
        string imageTag = HttpUtility.HtmlEncode(string.Format(@"&lt;img src=""{0}"" alt=""""&gt;", ImageUrl(p.Image, false)));

        imageList.Add(new CarImageList{ImageTag = imageTag});
        i++;
    }
</code></pre>

<p>Under the covers ProductList is really defined like this:</p>

<pre><code>public class ProductList : List&lt;Product&gt;
{
    static Random rand = new Random();

    public ProductList Shuffle()
    {
        ProductList list = new ProductList();
        list.AddRange(this);

        for (int i = 0; i &lt; list.Count; i++)
        {
            int r = rand.Next(list.Count - 1);
            Product swap = list[i];
            list[i] = list[r];
            list[r] = swap;
        }

        return list;
    }

    public Product FindById(int id)
    {
        foreach (Product p in this)
            if (p.Id == id) return p;

        return null;
    }

    public Product GetRandom()
    {
        int r = rand.Next(this.Count - 1);
        return this[r];
    }
}
</code></pre>

<p>so why do I get the error when I try to foreach through the ProductList instance?</p>

<p>Cannot convert type 'xxx.Product' to 'Product' is the error I get.  But if ProductList is really List why in the world would it have an issue with conversion?</p>
