public static bool TryGetCurrentData([NotNullWhen(true)] out ContextData?currentData) { currentData = null; ContextKey?contextKey = s_currentTransaction.Value; if (contextKey == null) { return(false); } else { return(s_contextDataTable.TryGetValue(contextKey, out currentData)); } }
internal static ContextData LookupContextData(TxLookup defaultLookup) { ContextData?currentData = null; if (CallContextCurrentData.TryGetCurrentData(out currentData)) { if (currentData.CurrentScope == null && currentData.CurrentTransaction == null && defaultLookup != TxLookup.DefaultCallContext) { // Clear Call Context Data CallContextCurrentData.ClearCurrentData(null, true); return(TLSCurrentData); } return(currentData); } else { return(TLSCurrentData); } }