update action-return-types.md (#14976) (#14983)

pull/15691/head
Max Lefebvre 2019-11-13 21:57:20 -04:00 committed by Rick Anderson
parent e598136638
commit c74fc1a1d9
1 changed files with 1 additions and 1 deletions

View File

@ -44,7 +44,7 @@ When known conditions need to be accounted for in an action, multiple return pat
### Return IEnumerable\<T> or IAsyncEnumerable\<T>
In ASP.NET Core 2.2 and earlier, returning <xref:System.Collections.Generic.IAsyncEnumerable%601> from an action results in synchronous collection iteration by the serializer. The result is the blocking of calls and a potential for thread pool starvation. To illustrate, imagine that Entity Framework (EF) Core is being used for the web API's data access needs. The following action's return type is synchronously enumerated during serialization:
In ASP.NET Core 2.2 and earlier, returning <xref:System.Collections.Generic.IEnumerable%601> from an action results in synchronous collection iteration by the serializer. The result is the blocking of calls and a potential for thread pool starvation. To illustrate, imagine that Entity Framework (EF) Core is being used for the web API's data access needs. The following action's return type is synchronously enumerated during serialization:
```csharp
public IEnumerable<Product> GetOnSaleProducts() =>