Method From
From<T>(Func<Task<T>>)
Returns a single-element sequence containing the result of invoking the function.
Declaration
public static IAsyncEnumerable<T> From<T>(Func<Task<T>> function)
Parameters
| Type | Name | Description |
|---|---|---|
| Func<Task<T>> | function | The function to evaluate. |
Returns
| Type | Description |
|---|---|
| IAsyncEnumerable<T> | A sequence with the value resulting from invoking |
Type Parameters
| Name | Description |
|---|---|
| T | The type of the object returned by the function. |
Remarks
This operator uses deferred execution and streams the results. If the resulting sequence is enumerated multiple times, the function will be invoked multiple times too.
From<T>(Func<Task<T>>, Func<Task<T>>)
Returns a sequence containing the result of invoking each parameter function in order.
Declaration
public static IAsyncEnumerable<T> From<T>(Func<Task<T>> function1, Func<Task<T>> function2)
Parameters
| Type | Name | Description |
|---|---|---|
| Func<Task<T>> | function1 | The first function to evaluate. |
| Func<Task<T>> | function2 | The second function to evaluate. |
Returns
| Type | Description |
|---|---|
| IAsyncEnumerable<T> | A sequence with the values resulting from invoking |
Type Parameters
| Name | Description |
|---|---|
| T | The type of the object returned by the functions. |
Remarks
This operator uses deferred execution and streams the results. If the resulting sequence is enumerated multiple times, the functions will be invoked multiple times too.
From<T>(Func<Task<T>>, Func<Task<T>>, Func<Task<T>>)
Returns a sequence containing the result of invoking each parameter function in order.
Declaration
public static IAsyncEnumerable<T> From<T>(Func<Task<T>> function1, Func<Task<T>> function2, Func<Task<T>> function3)
Parameters
| Type | Name | Description |
|---|---|---|
| Func<Task<T>> | function1 | The first function to evaluate. |
| Func<Task<T>> | function2 | The second function to evaluate. |
| Func<Task<T>> | function3 | The third function to evaluate. |
Returns
| Type | Description |
|---|---|
| IAsyncEnumerable<T> | A sequence with the values resulting from invoking |
Type Parameters
| Name | Description |
|---|---|
| T | The type of the object returned by the functions. |
Remarks
This operator uses deferred execution and streams the results. If the resulting sequence is enumerated multiple times, the functions will be invoked multiple times too.
From<T>(params Func<Task<T>>[])
Returns a sequence containing the values resulting from invoking (in order) each function in the source sequence of functions.
Declaration
public static IAsyncEnumerable<T> From<T>(params Func<Task<T>>[] functions)
Parameters
| Type | Name | Description |
|---|---|---|
| Func<Task<T>>[] | functions | The functions to evaluate. |
Returns
| Type | Description |
|---|---|
| IAsyncEnumerable<T> | A sequence with the values resulting from invoking all of the |
Type Parameters
| Name | Description |
|---|---|
| T | The type of the object returned by the functions. |
Remarks
This operator uses deferred execution and streams the results. If the resulting sequence is enumerated multiple times, the functions will be invoked multiple times too.
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | When |