DefaultIfEmpty Method

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:
© 2016 Microsoft