using System.Collections; using System.Collections.Generic; namespace Umbraco.Cms.Core.Services { /// /// Manages the simplified key/value store. /// public interface IKeyValueService { /// /// Gets a value. /// /// Returns null if no value was found for the key. string GetValue(string key); /// /// Returns key/value pairs for all keys with the specified prefix. /// /// /// IReadOnlyDictionary FindByKeyPrefix(string keyPrefix); /// /// Sets a value. /// void SetValue(string key, string value); /// /// Sets a value. /// /// Sets the value to if the value is , /// and returns true; otherwise throws an exception. In other words, ensures that the value has not changed /// before setting it. void SetValue(string key, string originValue, string newValue); /// /// Tries to set a value. /// /// Sets the value to if the value is , /// and returns true; otherwise returns false. In other words, ensures that the value has not changed /// before setting it. bool TrySetValue(string key, string originValue, string newValue); } }