namespace Nop.Core.Infrastructure; /// /// Represents a thread-safe collection /// public partial interface IConcurrentCollection { #region Methods /// /// Attempts to get the value associated with the specified key /// /// The key of the item to get (case-sensitive) /// The value associated with , if found /// /// True if the key was found, otherwise false /// bool TryGetValue(string key, out TValue value); /// /// Adds a key-value pair to the collection /// /// The key of the new item (case-sensitive) /// The value to be associated with void Add(string key, TValue value); /// /// Clears the collection /// void Clear(); /// /// Gets all key-value pairs for keys starting with the given prefix /// /// The prefix (case-sensitive) to search for /// /// All key-value pairs for keys starting with /// IEnumerable> Search(string prefix); /// /// Removes the item with the given key, if present /// /// The key (case-sensitive) of the item to be removed void Remove(string key); /// /// Attempts to remove all items with keys starting with the specified prefix /// /// The prefix (case-sensitive) of the items to be deleted /// The sub-collection containing all deleted items, if found /// /// True if the prefix was successfully removed from the collection, otherwise false /// bool Prune(string prefix, out IConcurrentCollection subCollection); #endregion #region Properties /// /// Gets a collection that contains the keys in the /// IEnumerable Keys { get; } #endregion }