ReadAsync method missing on type mappers
See original GitHub issueIs there a reason why the Write method comes with an asynchronous version, but not the Read method? I’m certain that the underlying TextReader comes with async reading behaviour.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Why Read and ReadAync are producing totally different ...
The only reason it even has ReadAsync is because base stream class ( Stream ) has those methods. Even if you manage to...
Read more >Generic type mapping and composites · Issue #2956
I've been getting lost in the different type mapping options lately - what is the best way to approach this? I have been...
Read more >How do Object Relational Mappers (like Entity Framework ...
Here is the C# code if we manually retrieve the data and map it to a list of the Person class: public async...
Read more >Stream.ReadAsync Method (System.IO)
Asynchronously reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read....
Read more >Change Log | CsvHelper
Fixed constructor mapping issue where parameter has a type converter but would still try and use constructor mapping. Breaking Changes. Added string field...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

So, there’s now a 4.16.0 out there. All I did was add new methods working with
IAsyncEnumerable.I changed a few of the convenience methods on the mapper to reuse the extension methods on the typed reader/writer classes under the hood, since I was essentially duplicating this code.
Apologies, it was late and I realize I didn’t bother wording the issue properly, hopefully it should be clearer now 😃
I thought it was a bit unintuitive for the consumer to find an async
Writemethod but not an equivalent asyncReadmethod.I would suggest adding two methods, one to read the entire list asynchronously, perhaps with a helper
ReadToListmethod (to avoid(await mapper.Read).ToList()), and one withIAsyncEnumerablesupport.