ConcurrentDictionary的用法

 private static ConcurrentDictionary<Guid, string> dictDbNames = new ConcurrentDictionary<Guid, string>();


添加:
 dictDbNames.TryAdd(Id, dbName);
取值
dictDbNames[Id]
判断是否存在
dictDbNames.ContainsKey(Id)

  

posted @ 2018-03-06 16:12  爱与和平  阅读(425)  评论(0编辑  收藏  举报