title: Update a value with linq
body: <p>I'm trying to update the <code>Selected</code>property of an <code>IEnumerable&lt;SelectListItem&gt;</code> for a MVC-Combobox website using linq. However this is not working, as shown in the debbuging result: The <code>Count()</code> for the criteria returns an item, however the <code>Count()</code>for <code>.Selected == true</code>returns 0.</p>
  
  <pre><code>public IEnumerable&lt;SelectListItem&gt; Categories { get; set; }
  
  public CategoryModel Category
  {
      get { return category; }
      set 
      {
          category = value;
          Categories.Where(x =&gt; x.Value == value.Id.ToString()).First().Selected = true;
      }
  
  //Debugging Results
  //?Categories.Where(x =&gt; x.Value == value.Id.ToString()).Count()
  //1
  //?Categories.Count(x =&gt; x.Selected == true);
  //0
  
  }
  </code></pre>
  
  <p>Update:
  I guess the problem is more bound to the <code>IEnumerable&lt;SelectListItem&gt;</code>, because the after changing Categories to an <code>ObservableCollection</code> it works fine (example below), even though Lin<strong>Q</strong> is not designed for changing data....</p>
  
  <pre><code>System.Diagnostics.Debug.Print(Categories.Where(x =&gt; x.Id == value.Id).FirstOrDefault().Description);
  
  Categories.Where(x =&gt; x.Id == value.Id).FirstOrDefault().Description = "Stackoverflow";
  
  System.Diagnostics.Debug.Print(Categories.Where(x =&gt; x.Id == value.Id).FirstOrDefault().Description);
  </code></pre>