Observable.Toasync<T, TResult> – metoda (Func<T, TResult>)
Převede funkci na asynchronní funkci.
Obor názvů:System.Reactive.Linq
Sestavení: System.Reactive (v System.Reactive.dll)
Syntax
'Declaration
<ExtensionAttribute> _
Public Shared Function ToAsync(Of T, TResult) ( _
function As Func(Of T, TResult) _
) As Func(Of T, IObservable(Of TResult))
'Usage
Dim function As Func(Of T, TResult)
Dim returnValue As Func(Of T, IObservable(Of TResult))
returnValue = function.ToAsync()
public static Func<T, IObservable<TResult>> ToAsync<T, TResult>(
this Func<T, TResult> function
)
[ExtensionAttribute]
public:
generic<typename T, typename TResult>
static Func<T, IObservable<TResult>^>^ ToAsync(
Func<T, TResult>^ function
)
static member ToAsync :
function:Func<'T, 'TResult> -> Func<'T, IObservable<'TResult>>
JScript does not support generic types and methods.
Parametry typu
- T
Typ
- Tresult
Typ výsledku.
Parametry
- – funkce
Typ: System.Func<T, TResult>
Funkce použitá k synchronizaci.
Návratová hodnota
Typ: System.Func<T, IObservable<TResult>>
Funkce do asynchronní funkce.
Poznámka k využití
V jazyce Visual Basic a C# můžete tuto metodu volat jako metodu instance pro libovolný objekt typu Func<T, TResult>. Pokud k volání této metody použijete syntaxi metody instance, vynechejte první parametr. Další informace naleznete v tématech a .