예제 #1
0
        public void Delete(string key)
        {
            if (string.IsNullOrEmpty(key))
            {
                throw new ArgumentException(nameof(key));
            }

            string normalizedKey = key.ToLower().ToConsulKey();

            bool result = _client.DeleteKeyValueAsync(normalizedKey).GetAwaiter().GetResult();

            if (result == false)
            {
                throw new KeyNotFoundException("Unable to delete key/value with key: " + normalizedKey);
            }
        }