Skip to content
Discussion options

You must be logged in to vote

Remove the async modifier if you don't want the method to behave as an iterator:

public IAsyncEnumerable<ComplexObject> Execute(IAsyncEnumerable<ComplexObject> data)
{
    return data;
}

As an iterator you are expected to yield each individual value. You can't return an IAsyncEnumerable<T> just as synchronous iterators can't return IEnumerable<T> and normal async methods can't return Task<T>.

Replies: 3 comments 9 replies

Comment options

You must be logged in to vote
4 replies
@Mike737377
Comment options

@HaloFour
Comment options

@Mike737377
Comment options

@HaloFour
Comment options

Answer selected by Mike737377
Comment options

You must be logged in to vote
4 replies
@Mike737377
Comment options

@YairHalberstadt
Comment options

@YairHalberstadt
Comment options

@alrz
Comment options

Comment options

You must be logged in to vote
1 reply
@Mike737377
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants