dotnet/EntityFramework.Docs

Convert our code samples to show async usage

roji opened this issue · 4 comments

roji commented

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 commented

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

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

roji commented

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 I think it makes sense to use DisposeAsync. I'm on the fence about Add...