Skip to content

Example for IEnumerable<T> action as non-blocking, is Incorrect and misleading #18090

@SDP190

Description

@SDP190

Quote:

Both of the preceding actions are non-blocking as of ASP.NET Core 3.0

However the first example seems to be incorrect, since the first action example calls: _repository.GetProducts()
which returns a List object - as shown in first example on this page - it is a synchronous blocking call to the database returning a List. Only if return type of GetProducts would be IAsyncEnumerable then even if the controller action signature itself would be IEnumerable still the serializer would detect its actually an IAsync and would iterate over it asynchronously.

Is that right?

Quote:
Capture


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions