-
Notifications
You must be signed in to change notification settings - Fork 26
DefaultIfEmpty
Eugene Sadovoi edited this page Jul 9, 2016
·
2 revisions
Returns the elements of the specified sequence or the specified value in a singleton collection if the sequence is empty.
DefaultIfEmpty([defaultValue])
The value to return if the sequence is empty.
An Enumerable that contains defaultValue if source is empty; otherwise, source. If no defaultValue value specified it will return undefined.
This method is implemented by using deferred execution. The immediate return value is an object that stores all the information that is required to perform the action. The query represented by this method is not executed until the object is enumerated. This method can be used to produce a left outer join when it is combined with the GroupJoin method.