Did you know you can deconstruct in a foreach loop? Suppose you have a dictionary
1 2 |
public static void Deconstruct<TKey,TValue>(this KeyValuePair<TKey, TValue> kvp, out TKey key, out TValue value) => (key, value)=(kvp.Key, kvp.Value); |
If used a lot, it might be worth adding it to System
namespace; thereby avoiding adding using statements everywhere.