using System.Collections.Generic; namespace gaemstone.Utility; public static class CollectionExtensions { // public static TValue GetOrAdd(this IDictionary dict, // TKey key, Func valueFactory) { } public static T? FirstOrNull(this IEnumerable enumerable) where T : struct { using var enumerator = enumerable.GetEnumerator(); return enumerator.MoveNext() ? enumerator.Current : null; } }