public async Task <bool> ReleaseAsync() { if (!IsAcquired) { return(false); } try { return(await _lockFactory.ReleaseLockAsync(_keyValue.Key, _keyValue.Value)); } catch { throw new DistributedLockException("An error happened on releasing the lock"); } finally { _lockFactory = null; } }