recursive loop is updating all properties in generic list
<p>I have the following method it creates a generic list recursively. I'm getting some interesting results. The property CurrentAllocation is always overwritten with the last value. </p>

<p><strong>Here is the line in question.</strong></p>

<pre><code>courierTypeRegion.CurrentAllocation = remaining;
courierTypeRegionOutput.Add(courierTypeRegion);
</code></pre>

<p><strong>Here is the whole method</strong></p>

<pre><code>public static List&lt;CourierTypeRegion&gt; FindClosest2(decimal quantity, decimal remaining, ICollection&lt;CourierTypeRegion&gt; courierTypeRegions, List&lt;CourierTypeRegion&gt; courierTypeRegionOutput)
        {
            var processed = false;
            var courierOrderByDesc = courierTypeRegions.OrderByDescending(x =&gt; x.CourierType.PalletsPerTrailer).ToList();
            var courierCount = courierOrderByDesc.Count();
            var courierCurrent = 0;
            foreach (var courierTypeRegion in courierOrderByDesc)
            {

                if (remaining &gt;= courierTypeRegion.CourierType.PalletsPerTrailer &amp;&amp; !processed)
                {
                    courierTypeRegion.CurrentAllocation = courierTypeRegion.CourierType.PalletsPerTrailer;
                    courierTypeRegionOutput.Add(courierTypeRegion);
                    processed = true;
                }

                if (!processed)
                {
                    if (courierOrderByDesc[courierCurrent + 1] != null)
                    {
                        if (remaining &gt; courierOrderByDesc[courierCurrent + 1].CourierType.PalletsPerTrailer)
                        {
                            courierTypeRegion.CurrentAllocation = remaining;
                            courierTypeRegionOutput.Add(courierTypeRegion);
                            processed = true;
                        }
                    }
                }
                courierCurrent++;
            }

            if (!processed)
            {
                if (courierTypeRegions.Count &gt; 0)
                {
                    var courierTypeRegionRemaining =
                        courierTypeRegions.Where(x =&gt; x.CourierType.PalletsPerTrailer &gt;= remaining).OrderByDescending(
                            x =&gt; x.CourierType.PalletsPerTrailer).SingleOrDefault();
                    if (courierTypeRegionRemaining != null) courierTypeRegionOutput.Add(courierTypeRegionRemaining);
                    processed = true;
                }
            }


            var currentRemaining = quantity - courierTypeRegionOutput.Sum(x =&gt; x.CourierType.PalletsPerTrailer);

            if (currentRemaining &gt; 0)
            {
                FindClosest(quantity, currentRemaining, courierTypeRegions, courierTypeRegionOutput);
            }

            return courierTypeRegionOutput;
        }
</code></pre>
