EntityFramework.Docs icon indicating copy to clipboard operation
EntityFramework.Docs copied to clipboard

Convert our code samples to show async usage

Open roji opened this issue 1 year ago • 4 comments

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 avatar Aug 16 '24 15:08 roji

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

roji avatar Aug 19 '24 19:08 roji

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

ajcvickers avatar Aug 27 '24 13:08 ajcvickers

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?

roji avatar Aug 27 '24 14:08 roji

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

ajcvickers avatar Aug 27 '24 14:08 ajcvickers