internal static void RemoveAmbientScope() { var current = GetIdentifier(); SetId(null); // If there was an ambient scope, we can stop tracking it now if (current != null) dbContextScopeInstances.Remove(current); }