public async Task Commit(ICommand command) { if (_committed) { throw new InvalidOperationException("Session has already committed."); } try { await _sessionManager.Commit(this, command); } finally { _committed = true; } }