LINQ_SingleOrDefault()

IEnumerable::LINQ_SingleOrDefault() method

Returns the single elemet of the sequence or default value if there are zero or more than one element.

T System::Collections::Generic::IEnumerable<T>::LINQ_SingleOrDefault()

Return Value

The single element of the sequence or default one

IEnumerable::LINQ_SingleOrDefault(const Func<T, bool>&) method

Returns the single elemet of the sequence that satisfies a condition or default value if there are zero or more than one such elements.

T System::Collections::Generic::IEnumerable<T>::LINQ_SingleOrDefault(const Func<T, bool> &predicate)

Arguments

ParameterTypeDescription
predicateconst Func<T, bool>&A function to test each element for a condition.

Return Value

The single element of the sequence or default one

See Also