title: Object properties not getting set in C#
body: <p>This is a strange problem I'm having, I have the following statement:</p>
  
  <pre><code>IEnumerable&lt;CategoryListViewModel&gt; categoryViewModels = categoryRepository.GetAllCategoryViewModels();
  </code></pre>
  
  <p>This correctly populates with exactly one element. </p>
  
  <pre><code>categoryViewModels.Where(cvm =&gt; cvm.CategoryId == localId).Single().Selected = true;
  </code></pre>
  
  <p>Yet, nothing gets updated, selected remains false. I can verify that the CategoryId and the localId are equal, if I break out:</p>
  
  <pre><code>var something = categoryViewModels.Where(cvm =&gt; cvm.CategoryId == localId).Single()
  </code></pre>
  
  <p>It correctly returns the one viewModel.  In fact, if I go in and I set the local variable "something" to Selected = false. It'll correctly update the local variable.</p>
  
  <p>Am I missing something obvious?</p>
  
  <p>Edit:</p>
  
  <pre><code>public class CategoryListViewModel
  {
      public Guid CategoryId { get; set; }
  
      public string CategoryName { get; set; }
  
      public bool Selected { get; set; }
  }
  </code></pre>