How to detect if a LINQ enumeration is materialized? -


Is there any way to find out whether LINQ (using objects in this case) has been made a numeric ? In addition to trying to inspect the type of underlying collection?

Especially, because enumerable.ToArray () will create a new array even if the underlying archive is already an array. I 'I ToArray () Finding a way to avoid that is called twice in the same collection.

Numeric is not an "underlying collection", it will Try viewing this as an archive and use the resulting reference:

  var coll = enumerated as an icon  

Comments