You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
491 B
19 lines
491 B
namespace StabilityMatrix.Core.Extensions; |
|
|
|
public static class DictionaryExtensions |
|
{ |
|
/// <summary> |
|
/// Adds all items from another dictionary to this dictionary. |
|
/// </summary> |
|
public static void Update<TKey, TValue>( |
|
this Dictionary<TKey, TValue> source, |
|
IReadOnlyDictionary<TKey, TValue> collection |
|
) |
|
where TKey : notnull |
|
{ |
|
foreach (var item in collection) |
|
{ |
|
source[item.Key] = item.Value; |
|
} |
|
} |
|
}
|
|
|