boot4life
boot4life

Reputation: 5314

What is the proper way to override Stream.BeginRead given the Task-returning ReadAsync

I'm looking to override BeginRead on a custom stream. ReadAsync would be much easier to implement because it can use await. Can I reuse that code to override BeginRead as well? What's a good way to do that?

Upvotes: 0

Views: 160

Answers (1)

Paulo Morgado
Paulo Morgado

Reputation: 14846

It's just tedious code.

But you can find several TaskToApm on source.dot.net.

Just choose the one that best fits your needs.

Upvotes: 1

Related Questions