LINQ_Single()
Contents
[
Hide
]IEnumerable::LINQ_Single() method
Returns the single elemet of the sequence and throws an exception if there are zero or more than one element.
T System::Collections::Generic::IEnumerable<T>::LINQ_Single()
Return Value
The single element of the sequence
Exceptions
| Exception | Description |
|---|---|
| InvalidOperationException | Source sequence is empty or there are more than one element. |
IEnumerable::LINQ_Single(const Func<T, bool>&) method
Returns the single elemet of the sequence that satisfies a condition and throws an exception if there are zero or more than one such elements.
T System::Collections::Generic::IEnumerable<T>::LINQ_Single(const Func<T, bool> &predicate)
Arguments
| Parameter | Type | Description |
|---|---|---|
| predicate | const Func<T, bool>& | A function to test each element for a condition. |
Return Value
The single element of the sequence
Exceptions
| Exception | Description |
|---|---|
| InvalidOperationException | Source sequence is empty or there are more than one element that satisfied predicate. |
See Also
- Class IEnumerable
- Class Func
- Namespace System::Collections::Generic
- Library Aspose.Slides