System::Collections::Generic::IEnumerable::LINQ_SingleOrDefault method

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()

ReturnValue

The single element of the sequence or default one

See Also

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)
ParameterTypeDescription
predicateconst Func<T, bool>&A function to test each element for a condition.

ReturnValue

The single element of the sequence or default one

See Also