I have seen how to convert a ConcurrentDictionary to a Dictionary, but I have a dictionary and would like to convert to a ConcurrentDictionary. How do I do that?... better
Use
ConcurrentDictionary
Dictionary dictionary = new Dictionary();
dictionary.Add(1,"A");
dictionary.Add(2, "B");
ConcurrentDictionary concurrentDictionary =
new ConcurrentDictionary(dictionary);
can i set the LINQ statement to be a ConcurrentDictionary?
No. You can not.. There is no extension method available to create ConcurrentDictionary in LINQ. You can either create your own extension method or you can use the ConcurrentDictionary constructor in your LINQ query while projecting results.