public ICallStackManager CreateCallStackManager()
 {
     // our async contexts can exhibit undesirable sticky behavior if they're first accessed in
     // a synchronous context.  This clears out anything stuck on the context.
     _storageContext.Clear();
     return(new SyncToAsyncCallStackManager(_storageContext));
 }
        public void RemoveOutstandingInternalTransactions(bool removeAsync, bool removePrimary)
        {
            if (removePrimary)
            {
                TryClearContexts(_sortedPrimaryContexts);
            }

            if (removeAsync)
            {
                _asyncContext?.Clear();
            }
        }