Is there a way to get the length of a collection from this?
ParallelQuery<string> Lines = File.ReadAllLines("Topics.txt").AsParallel<string>();
This has no length property. There is a count method but it takes a Func. If I don’t pass a Func parameter, I could get all the properties in the collection, but how could I not pass one in?
Thanks
You can use the
Count()extension method – but it will enumerate the entire collection.