timeout when deleting user inside of transactionScope
<ul>
<li>Background</li>
</ul>

<p>We are trying to archive old user data to keep our most common tables smaller. </p>

<ul>
<li><p>Issue</p>

<p>Normal EF code for removing records works for our custom tables.  The AspNetUsers table is a different story.  It appears that the way to do it is using <em>_userManager.Delete</em> or <em>_userManager.DeleteAsync</em>.  These work without trying to do multiple db calls in one transaction.  When I wrap this in a transactionScope, it times out.  Here is an example:</p>

<pre><code>public bool DeleteByMultipleIds(List&lt;string&gt; idsToRemove)
{
    try
    {
        using (var scope = new TransactionScope())
        {
            foreach (var id in idsToRemove)
            {
                var user = _userManager.FindById(id);
                //copy user data to archive table
                _userManager.Delete(user);//causes timeout
            }
            scope.Complete();
        }
        return true;
    }
    catch (TransactionAbortedException e)
    {
        Logger.Publish(e);
        return false;
    }
    catch (Exception e)
    {
        Logger.Publish(e);
        return false;
    }
}
</code></pre></li>
</ul>

<p>Note that while the code is running and I call straight to the DB like:</p>

<pre><code>    DELETE
    FROM ASPNETUSERS
    WHERE Id = 'X'
</code></pre>

<p>It will also time out.  This SQL works before the the C# code is executed.  Therefore, it appears that more than 1 db hit seems to lock the table.  How can I find the user(db hit #1) and delete the user (db hit #2) in one transaction?</p>