withSIX.Mini.Infra.Data.Services.DbContextScope.RemoveAmbientScope C# (CSharp) Method

RemoveAmbientScope() static private method

Clears the ambient scope from the CallContext and stops tracking its instance. Call this when a DbContextScope is being disposed.
static private RemoveAmbientScope ( ) : void
return void
        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);
        }