* Process DMM all locally single call to github to download the repo archive. remove need for PAT update RTN to 0.2.13 change to batch_parse for title parsing from RTN * introduce concurrent dictionary, and parallelism
19 lines
607 B
C#
19 lines
607 B
C#
namespace SharedContracts.Extensions;
|
|
|
|
public static class DictionaryExtensions
|
|
{
|
|
public static ConcurrentDictionary<TKey, TValue> ToConcurrentDictionary<TSource, TKey, TValue>(
|
|
this IEnumerable<TSource> source,
|
|
Func<TSource, TKey> keySelector,
|
|
Func<TSource, TValue> valueSelector) where TKey : notnull
|
|
{
|
|
var concurrentDictionary = new ConcurrentDictionary<TKey, TValue>();
|
|
|
|
foreach (var element in source)
|
|
{
|
|
concurrentDictionary.TryAdd(keySelector(element), valueSelector(element));
|
|
}
|
|
|
|
return concurrentDictionary;
|
|
}
|
|
} |