title: How do I get SingleOrDefault to return object by reference from a list?
body: <p>Consider these lines of code:</p>
  
  <pre><code>  //prodProdGroup is a list within the itm object that I need to search. The items
    //within the list are of type ProductionCostCalcHelper. I need to find one
    //of the ProductionCostCalcHelper records in the list, calculate its total dollar value
    //and assign it the value
  
    ProductionCostCalcHelper prodGroupItm = itm.prodProdGroup.SingleOrDefault(f =&gt; f.MAST_PROJ.Trim() == laborItm.MAST_PROJ.Trim());
    ProductionCostCalcHelper prodGroupItm2 = itm.prodProdGroup.SingleOrDefault(f =&gt; f.MAST_PROJ.Trim() == laborItm.MAST_PROJ.Trim());
  
    if (prodGroupItm != null)
    {
          prodGroupItm.TOTAL_DOLLAR = avgDollarsPerHour * prodGroupItm.HOURS;
    }
  </code></pre>
  
  <p>I'm assuming that the SingleOrDefault method would return the object by reference but it doesn't. After changing the TOTAL_DOLLAR amount of ProdGroupItm, ProdGroupItm2 remains the same proving that they are not referencing what is in the list. Why is this? Is there a way to update the value of the object within the list?</p>