Entity Framework Core supports async queries, with some limitations. Phil covers async and the recommended usage of async queries.
- [Instructor] EF Core supports async query execution,…so find, ToList, ToArray,…first, single, all, any.…We saw several examples of these in IntelliSense.…They all have a async version,…so FindAsync, ToListAsync, etc.…It's important to note that EF Core…doesn't support multiple open operations on a context.…So, you should always await async operations.…Now, when building this course,…I ran a bunch of tests.…
I could not get it to error…but knowing that it doesn't support multiple operations…but we should always just await…and not trust the fact…that I didn't get any errors…and multi-threading errors…are really hard to reproduce anyway.…It's important to remember and I'm sure you guys know this,…async doesn't speed up to query execution,…it just prevents your other operations…from being blocked.…
So, let's see how async works in code.…Async queries work with the async await pattern,…so very simply we make the test async…and then we can call var prodList…equals context.Product…and we can literally just do ToListAsync.…
- Entity Framework Core components and projects
- Working with scaffolded files
- Testing with xUnit
- Viewing generated SQL
- Composing queries
- Sorting and filtering results
- Working with aggregates
- Loading related data
- Logging and tracking
- Mapping functions
- Generics and delegates
- Checking concurrency
- Resiliency and transactions
Skill Level Intermediate
Learning Entity Framework Corewith Reynald Adolphe1h 35m Intermediate
1. Get to Know Entity Framework
2. Set the Stage
3. Querying Data: Part 1
4. Querying Data: Part 2
5. Advanced Query Features
6. Persisting Data
7. DbContext Options and Configuration
Thank you1m 23s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.