Empty

Download .net eBook

Example

To create an empty IEnumerable of int:

IEnumerable<int> emptyList = Enumerable.Empty<int>(); 

This empty IEnumerable is cached for each Type T, so that:

Enumerable.Empty<decimal>() == Enumerable.Empty<decimal>(); // This is True
Enumerable.Empty<int>() == Enumerable.Empty<decimal>();     // This is False

Stats

Contributors: 1
2015-12-10
Licensed under: CC-BY-SA

Not affiliated with Stack Overflow
Rip Tutorial: info@zzzprojects.com

Download eBook