Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Enumerable.DefaultIfEmpty Method

 

Returns the elements of an IEnumerable<T>, or a default valued singleton collection if the sequence is empty.

Namespace:   System.Linq
Assembly:  System.Core (in System.Core.dll)

NameDescription
System_CAPS_pubmethodSystem_CAPS_staticDefaultIfEmpty<TSource>(IEnumerable<TSource>)

Returns the elements of the specified sequence or the type parameter's default value in a singleton collection if the sequence is empty.

System_CAPS_pubmethodSystem_CAPS_staticDefaultIfEmpty<TSource>(IEnumerable<TSource>, TSource)

Returns the elements of the specified sequence or the specified value in a singleton collection if the sequence is empty.

Return to top
Show:
© 2017 Microsoft