Class MockAsyncEnumerable<T>
Wraps an enumerable or expression tree so EF Core async query APIs can enumerate it through IAsyncEnumerable<T>.
Inherited Members
Namespace: FastMoq.Models
Assembly: FastMoq.Database.dll
Syntax
public class MockAsyncEnumerable<T> : EnumerableQuery<T>, IOrderedQueryable<T>, IOrderedQueryable, IQueryProvider, IAsyncEnumerable<T>, IQueryable<T>, IEnumerable<T>, IQueryable, IEnumerable
Type Parameters
| Name | Description |
|---|---|
| T | The element type exposed by the queryable sequence. |
Constructors
MockAsyncEnumerable(IEnumerable<T>)
Initializes the async enumerable from an existing in-memory sequence.
Declaration
public MockAsyncEnumerable(IEnumerable<T> enumerable)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<T> | enumerable | The sequence to expose through async query APIs. |
MockAsyncEnumerable(Expression)
Initializes the async enumerable from an expression tree.
Declaration
public MockAsyncEnumerable(Expression expression)
Parameters
| Type | Name | Description |
|---|---|---|
| Expression | expression | The expression tree that defines the query. |
Methods
GetAsyncEnumerator(CancellationToken)
Returns an async enumerator over the wrapped sequence.
Declaration
public IAsyncEnumerator<T> GetAsyncEnumerator(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | A cancellation token that is ignored by this in-memory test implementation. |
Returns
| Type | Description |
|---|---|
| IAsyncEnumerator<T> | An async enumerator over the wrapped sequence. |