Is there a practical difference between .All() and .TrueForAll() when operating on a List? I know that .All() is part of IEnumerable, so why add .TrueForAll()?
Is there a practical difference between .All() and .TrueForAll() when operating on a List
Share
From the docs for
List<T>.TrueForAll:So it was added before
Enumerable.All.The same is true for a bunch of other
List<T>methods which work in a similar way to their LINQ counterparts. Note thatConvertAllis somewhat different, in that it has the advantage of knowing that it’s working on aList<T>and creating aList<TResult>, so it gets to preallocate whatever it needs.