using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace CsvHelper { internal static class EnumerableExtensions { #if !NET45 public static async Task FirstOrDefaultAsync(this IAsyncEnumerable collection) { await foreach (var o in collection.ConfigureAwait(false)) { if (o != null) { return o; } } return default(T); } #endif } }