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 yet, can i set the link statement to be a ConcurrentDictionary?
var customers = _customerRepo.Query().Select().ToDictionary(x => x.id, x => x);
Use
ConcurrentDictionary<TKey, TValue> Constructor (IEnumerable<KeyValuePair<TKey, TValue>>)
constructor which can accept a dictionary object like:No.
You can not.. There is no extension method available to createConcurrentDictionary
in LINQ. You can either create your own extension method or you can use theConcurrentDictionary
constructor in your LINQ query while projecting results.