using System.Collections.Generic; namespace EC.App.Entity.Base { public class DictBase { private Dictionary Dict { get; } = new(); public DictBase() { } #region Operate public bool TryAdd(K key, V value) { return Dict.TryAdd(key, value); } public bool Remove(K key) { return Dict.Remove(key); } public bool TryUpdate(K key, V value) { Remove(key); return TryAdd(key, value); } public bool TryGet(K key, out V value) { return Dict.TryGetValue(key, out value); } public bool IsExist(K key) { return Dict.ContainsKey(key); } #endregion Operate } }