title: how to add a "get all" method using linq
body: <p>I'm wanting to add a "get all" items method in my class. with lineCollection I can see the (.find(), .findall(), .findindex() ) but I don't think this is what I'm needing? Any help?</p>
  
  <pre><code>using System.Collections.Generic;
  using System.Linq;
  
  namespace SportsStore.Domain.Entities
  {
      public class Cart
      {
          private readonly List&lt;CartLine&gt; lineCollection = new List&lt;CartLine&gt;();
  
          public IEnumerable&lt;CartLine&gt; Lines
          {
              get { return lineCollection; }
          }
  
          public void AddItem(Product product, int quantity)
          {
              CartLine line = lineCollection
                  .Where(p =&gt; p.Product.ProductID == product.ProductID)
                  .FirstOrDefault();
  
              if (line == null)
              {
                  lineCollection.Add(new CartLine {Product = product, Quantity = quantity});
              }
              else
              {
                  line.Quantity += quantity;
              }
          }
  
          public void RemoveLine(Product product)
          {
              lineCollection.RemoveAll(l =&gt; l.Product.ProductID == product.ProductID);
          }
  
          public decimal ComputeTotalValue()
          {
              return lineCollection.Sum(e =&gt; e.Product.Price*e.Quantity);
          }
  
          public void Clear()
          {
              lineCollection.Clear();
          }
  
      }
  
      public class CartLine
      {
          public Product Product { get; set; }
          public int Quantity { get; set; }
      }
  }
  </code></pre>