castE<TResult> method

Enumerable<TResult> castE <TResult>([CastTransformer<T, TResult> transformer ])

Casts each element in the enumerable from one type to another.

Performs a transformation on every element in the enumerable, casting from T to TResult. The transformer function can optionally be given to specify the manner of the cast.

If T is directly compatible with TResult, the transformer function can be omitted and the casting will be performed using a value as TResult transformation.

If T and TResult are unrelated, the transformer function must be provided to facilitate the transformation. Otherwise, a ConversionError will be thrown.

Implementation

Enumerable<TResult> castE<TResult>(
    [CastTransformer<T, TResult> transformer]) {
  return CastEnumerable<T, TResult>(this, transformer);
}