ObservableAsync.Cast(IObservableAsync) method¶
Defined in
Type: ObservableAsync
Namespace: ReactiveUI.Extensions.Async
Assembly: ReactiveUI.Extensions.dll
Applies to
net10.0, net10.0-browserwasm1.0, net10.0-desktop1.0, net9.0, net9.0-browserwasm1.0, net9.0-desktop1.0, net8.0, net8.0-ios17.5, net8.0-maccatalyst17.5, net8.0-macos14.2, net8.0-macos14.5, net8.0-tvos17.2, netstandard2.1, net462, net481
public static IObservableAsync<TResult> Cast<T, TResult>(this IObservableAsync<T> @this)
Summary: Projects each element of the observable sequence to the specified result type by performing a runtime cast.
Type parameters
| Name | Description |
|---|---|
T | The type of elements in the source sequence. |
TResult | The type to which the elements of the sequence are cast. |
Parameters
| Name | Type | Description |
|---|---|---|
this | [IObservableAsync | The source observable sequence. |
Returns: IObservableAsyncTResult.
Remarks
If an element in the source sequence cannot be cast to TResult, the sequence completes with a failure containing the exception. This method is useful for
working with sequences of objects when the actual element type is known at runtime.