Skip to content

Add support for IAsyncEnumerable<T> where T is value type #17154

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 18, 2019

Conversation

pranavkm
Copy link
Contributor

Fixes #17139

@pranavkm pranavkm requested a review from rynowak November 15, 2019 22:15
@github-actions github-actions bot added the area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates label Nov 15, 2019
}

private async Task<ICollection> ReadInternal<T>(IAsyncEnumerable<object> value)
private async Task<ICollection> ReadInternal<T>(object value)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is way smaller of a change than I expected.

Assert.Equal(new[] { "0", "1", "2", }, collection);
}

[Fact]
public async Task ReadAsync_ReadsIAsyncEnumerable_ImplementingMultipleAsyncEnumerableInterfaces()
public async Task TryGetReader_ReturnsReaderForIAsyncEnumerableOfValueType()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎆 👏 👏

}

[Fact]
public void TryGetReader_ReturnsCachedDelegate()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this behave when a type implements multiple IAsyncEnumerables<>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We cache this based on the passed in type, so it just works. I added a test for good measure.

@pranavkm pranavkm merged commit d5fd9fc into master Nov 18, 2019
@pranavkm pranavkm deleted the prkrishn/asyncenumerable-valuetype branch November 18, 2019 16:25
@pranavkm pranavkm added this to the 5.0.0-preview1 milestone Nov 18, 2019
pranavkm added a commit that referenced this pull request Dec 3, 2019
* Add support for IAsyncEnumerable<T> where T is value type

Fixes #17139
pranavkm added a commit that referenced this pull request Jan 15, 2020
* Add support for IAsyncEnumerable<T> where T is value type

Fixes #17139
mkArtakMSFT pushed a commit that referenced this pull request Jan 16, 2020
…17563)

* Add support for IAsyncEnumerable<T> where T is value type (#17154)

* Add support for IAsyncEnumerable<T> where T is value type

Fixes #17139

* Fixup ref asm

* undo changes to blazor.server.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Web API engine doesn't handle IAsyncEnumerable<int> type as expected.
2 participants