Loop foreach over List of objects (cannot operate on variables of type 'object')
<p>I am trying to save some objects into a list for later use. Here is how I store them:</p>

<pre><code>List&lt;Engagement&gt; engagementsList = new List&lt;Engagement&gt;();

foreach (Engagement engagement in db.Engagements)
{
    // Implementation here
}

TempData["DeletedE"] = engagementsList;
TempData.Keep();
</code></pre>

<p>Then, I am trying iterate over the list, but I get the error:</p>

<p><em>cannot operate on variables of type 'object'</em></p>

<p>I am iterating over the list by:</p>

<pre><code>foreach (Engagement e in TempData["DeletedE"])
{
    // Implementation here...
}
</code></pre>

<p>Any help is greatly appreciated.</p>