标签:pre 一个 value 获得 oid date key ryu 条件
public class Test { private static ConcurrentDictionary<string, int> testDictionary = new ConcurrentDictionary<string, int>(); public void test() { string _key = "a"; int _value = 0; int curValue = 1; testDictionary.TryAdd(_key, _value); testDictionary.AddOrUpdate(_key, _value, (key, value) => { return value = curValue; }); testDictionary.TryGetValue(_key, out int getValue); testDictionary.GetOrAdd("b", 2); } }
标签:pre 一个 value 获得 oid date key ryu 条件
原文地址:https://www.cnblogs.com/cg-931210/p/9263414.html