public static TSource First <TSource>(this IReadOnlyList <TSource> source)
        {
            switch (source)
            {
            case TSource[] array:
                return(ArrayExtensions.First <TSource>(array));

            default:
                return(ReadOnlyList.First <IReadOnlyList <TSource>, IEnumerator <TSource>, TSource>(source));
            }
        }
示例#2
0
 public static Option <TSource> First <TSource>(this ImmutableList <TSource> source)
 => ReadOnlyList.First <ImmutableList <TSource>, TSource>(source);
 public static Option <TSource> First <TSource>(this List <TSource> source)
 => ReadOnlyList.First <List <TSource>, TSource>(source);