title: Replace a collection item using Linq
body: <p>How do I find and replace a property using Linq in this specific scenario below:</p>
  
  <p><code></p>
  
  <pre><code>public interface IPropertyBag { }
  public class PropertyBag : IPropertyBag
  {
      public Property[] Properties { get; set; }
  
      public Property this[string name]
      {
          get { return Properties.Where((e) =&gt; e.Name == name).Single(); }
          //TODO: Just copying values... Find out how to find the index and replace the value 
          set { Properties.Where((e) =&gt; e.Name == name).Single().Value = value.Value; }
      }
  }
  </code></pre>
  
  <p></code>
  Thanks for helping out in advance.</p>