{TOC}
| Namespace: | System.Linq |
| Assembly: | System.Core.dll |
| Extends: | IEnumerable<T> |
Back to
Standard Query Operator IndexEditIntroduction
The Cast operator casts the elements of a sequence to a given type.
EditMethod Signatures
public static IEnumerable<TResult> Cast<TResult>(
this IEnumerable source)EditExceptions
Throws an ArgumentNullException if
source is null.
EditPseudo-code
If
source is null, throw an ArgumentNullException.
Iterate the
source sequence.
Type-cast the current element into the new type and return the result (pick up from here when the next element is requested).
EditLoop Count
This operator implements the standard
deferred execution iterator pattern. This means, no looping will occur until the result is iterated over.
EditCode Samples
TODO:Needs code sample.