private void AssertNotFinished() { if (HasTermination) throw new InvalidOperationException("The context has already terminated."); }