C#C
C#4y ago
Esa

❔ EntityFramework async where possible?

So I want to make sure I don't do something stupid here.

I'm trying to convert my DbContext-calls to async calls where possible.
I see EF provides .FirstOrDefaultAsync() which works nicely for the Get calls I have.
However I need to do stuff like join and where which I see has no async overload.

I started doing
Task.Run(async () => await myDbContext.MyDbSet.Join() // etc

but that feels wrong. How do I make this particular call async without doing something explosively stupid?
Was this page helpful?