Skip to content
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

Convert our code samples to show async usage #4781

Open
roji opened this issue Aug 16, 2024 · 4 comments
Open

Convert our code samples to show async usage #4781

roji opened this issue Aug 16, 2024 · 4 comments
Milestone

Comments

@roji
Copy link
Member

roji commented Aug 16, 2024

Our samples currently show sync I/O usage in almost all cases. I think it's probably time to guide our users in the right direction and show async.

@roji roji added this to the 9.0.0 milestone Aug 16, 2024
@roji roji changed the title Convert our samples to show async usage Convert our code samples to show async usage Aug 16, 2024
@roji roji removed the needs-design label Aug 19, 2024
@roji
Copy link
Member Author

roji commented Aug 19, 2024

Design: OK to change all our code samples to async, except for specific justified exceptions.

@ajcvickers
Copy link
Member

@roji Does this include DisposeAsync? Should we always show await using?

@roji
Copy link
Member Author

roji commented Aug 27, 2024

Good question... That could in theory be important for async closing of an open ADO.NET connection, right? That's the only thing I'm aware of that would potentially involve I/O... So I'd lean towards yes, showing await using - it would also avoid the IDE warnings/suggestions to do so...

Then there's of course... AddAsync... Here I'm really more inclined to just do Add, what do you think?

@ajcvickers
Copy link
Member

@roji I think it makes sense to use DisposeAsync. I'm on the fence about Add...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants