a guest Feb 19th, 2019 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //keys and bar are not the concern here
  2. ConcurrentDictioanry<string, HashSet<string>> foo = new ...;
  3. foreach(var key in keys) {
  4.     foo.AddOrUpdate(key, new HashSet<string> { bar }, (key, val) => {
  5.         val.Add(bar);
  6.         return val;
  7.     });
  8. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand