title: Updating cache object that contains collection of employees
body: <p>I have a collection of Employees that I stored inside <code>MemoryCache.Now</code> after update of particular employee details, I want to update the <strong>same</strong> cache object with updated employee details. Something like that:</p>
  
  <pre><code>var AllEmployees= cache.Get("AllEmployees");
  if(AllEmployees != null)
  {
         var empToUpdate = AllEmployees.FirstOrDefault(i =&gt; i.EmpId== Employee.EmpId);
         if (empToUpdate != null)
         {
             AllEmployees.Remove(empToUpdate );
             AllEmployees.add(empToUpdate ); 
        }
  }
  </code></pre>
  
  <p>but since cache is memory cache and it has cached <code>IEnumerable&lt;Employee&gt;,</code>i am not able to directly manipulate cache object.I am not able to call these methods <strong>FirstOrDefault,Remove,Add</strong></p>