LINQ Empty Generation Operator

By Peter Bromberg

The LINQ Empty operator returns an empty sequence of a given type.

Note that we can use this operator using static method invocation syntax since we typically won’t have an existing sequence to work with.

var empty = Enumerable.Empty<Employee>();

LINQ Empty Generation Operator  (689 Views)