public static IDictionary<string, string> BuildPropertyDictionaryConcurrently(IEnumerable<property> properties)
{
ConcurrentDictionary<string, string> propertyDictionary = new ConcurrentDictionary<string, string>();
Parallel.ForEach(properties, (p) =>
{
if (p != null && !propertyDictionary.ContainsKey(p.name))
{
// Don't ToLower it - it causes problems when we try to get the column name out again.
//propertyDictionaryField.Add(p.name.ToLower(), p.value);
propertyDictionary[p.name] = p.value;
}
});
return propertyDictionary;
}