Returns an empty IEnumerable<T> that has the specified type argument.
Assembly: System.Core (in System.Core.dll)
The type to assign to the type parameter of the returned generic IEnumerable<T>.
The method caches an empty sequence of type TResult. When the object it returns is enumerated, it yields no elements.
In some cases, this method is useful for passing an empty sequence to a user-defined method that takes an IEnumerable<T>. It can also be used to generate a neutral element for methods such as Union. See the Example section for an example of this use of .
The following code example demonstrates how to use to generate an empty IEnumerable<T>.
The following code example demonstrates a possible application of the method. The Aggregate method is applied to a collection of string arrays. The elements of each array in the collection are added to the resulting IEnumerable<T> only if that array contains four or more elements. is used to generate the seed value for Aggregate because if no array in the collection has four or more elements, only the empty sequence is returned.
Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.