Question: I have a list of a custom type called Holdings. I am trying to query the list based on one property of the Holdings object to return a new list of Holdings. The LINQ query below does work correctly but I would like to replace var unitHld with List unitHld but can't get the code to work.

```
var unitHld = from hld in _holdingList
              where hld.FundCode == lookThroList[i].FundCode
              select new Holding() { Currency = hld.Currency, 
                                     FundCode = lookThroList[i].FundCode, 
                                     IdSedol = hld.IdSedol, 
                                     Nominal = hld.Nominal * unitWgt, 
                                     Price = hld.Price };

```

This new list is then slightly altered before being added back to the original list (I know the logic sounds strange but please accept this is how it has to be done). However because unitHld is var the line below does not work.

```
_holdingList.Add(unitHld);

```

Answer: 
The following call only adds a single item (where the item must be the same type as the list's elements):

```
_holdingList.Add(unitHld);

```

But you want to add a range of items, so do it like this:

```
_holdingList.AddRange(unitHld);

```

where `unitHld` is `IEnumerable<T>` and T is the type of the list's elements.

(This answer assumes that `holdingList` is of type `List<T>`, and that T is in fact `Holding` for your example.)

See [`List.AddRange()`](http://msdn.microsoft.com/en-us/library/z883w3dc%28v=vs.110%29.aspx) for details.
Try this:

```
_holdingList.AddRange(unitHld);

```