C# source implementation that enhances LINQ to Objects with the method SingleOrFallback. Returns the single element in the given sequence, or the result of executing a fallback delegate if the sequence is empty. This method throws an exception if there is more than one element in the sequence.
$ dotnet add package MoreLinq.Source.MoreEnumerable.SingleOrFallbackNo README available.