摘要: 源码: public static int Count<TSource>(this IEnumerable<TSource> source) { if (source == null) throw Error.ArgumentNull("source"); ICollection<TSource> 阅读全文
posted @ 2021-11-15 17:17 vba是最好的语言 阅读(251) 评论(0) 推荐(0) 编辑
摘要: 源码: public static bool Contains<TSource>(this IEnumerable<TSource> source, TSource value) { ICollection<TSource> collection = source as ICollection<TS 阅读全文
posted @ 2021-11-15 16:00 vba是最好的语言 阅读(160) 评论(0) 推荐(0) 编辑
摘要: 源码: public static IEnumerable<TSource> Concat<TSource>(this IEnumerable<TSource> first, IEnumerable<TSource> second) { if (first == null) throw Error. 阅读全文
posted @ 2021-11-15 15:21 vba是最好的语言 阅读(54) 评论(0) 推荐(0) 编辑
摘要: 源码: public static IEnumerable<TResult> Cast<TResult>(this IEnumerable source) { IEnumerable<TResult> typedSource = source as IEnumerable<TResult>; if 阅读全文
posted @ 2021-11-15 15:15 vba是最好的语言 阅读(62) 评论(0) 推荐(0) 编辑
摘要: public static float? Average(this IEnumerable<float?> source) { if (source == null) throw Error.ArgumentNull("source"); double sum = 0; long count = 0 阅读全文
posted @ 2021-11-15 14:57 vba是最好的语言 阅读(26) 评论(0) 推荐(0) 编辑
摘要: 官网上给的案例: // Custom class. class Clump<T> : List<T> { // Custom implementation of Where(). public IEnumerable<T> Where(Func<T, bool> predicate) { Conso 阅读全文
posted @ 2021-11-15 14:52 vba是最好的语言 阅读(914) 评论(0) 推荐(0) 编辑
摘要: 相关源码: public static bool All<TSource>(this IEnumerable<TSource> source, Func<TSource, bool> predicate) { if (source == null) throw Error.ArgumentNull( 阅读全文
posted @ 2021-11-15 14:20 vba是最好的语言 阅读(44) 评论(0) 推荐(0) 编辑