/// <inheritdoc /> public async ValueTask DisposeAsync() { foreach (var value in _scopedStateDictionary.Values) { await StateMonad.DisposeVariableAsync(value, this); } }
/// <inheritdoc /> public async Task RemoveVariableAsync(VariableName key, bool dispose, IStep?callingStep) { if (_scopedStateDictionary.Remove(key, out var v) && dispose) { await StateMonad.DisposeVariableAsync(v, this); } if (_fixedState.ContainsKey(key)) { Logger.LogSituation( LogSituation.RemoveVariableOutOfScope, callingStep, this, new[] { key } ); } }