1.any方法
Any<TSource>(IQueryable<TSource>)
如果源序列包含任何元素,则为 true
;否则为 false
。
Any<TSource>(IQueryable<TSource>, Expression<Func<TSource,Boolean>>)
如果源序列中存在元素通过了指定谓词中的测试,则为 true
;否则为 false
。
2.all方法
public static bool All<TSource> (this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<Func<TSource,bool>> predicate);
如果源序列中的每个元素都通过指定谓词中的测试,或者序列为空,则为 true
;否则为 false
。