Another possible performance enhancement is the ability to precompile an Entity Framework Core LINQ query in order to bypass the hashing and hash lookup at runtime. This section demonstrates how to do just that.
- [Narrator] Explicitly Compiled Queries…is another new feature.…And this lets us, as developers,…pre-compile the link translation.…We've already discussed how link translation works,…but just as a quick review.…Entity Framework compiles your LINQ query…and caches the resulting translation…using a hash of the query.…When that query is called again,…the hash is looked up and executed if it is found.…
Explicitly compiling the LINQ queries…bypasses the computation…of the hash and the hash lookup.…In high-volume situations, this might provide…a performance gain.…In low-volume situations, it might not.…But it's there for you to use,…and, if it provides value, fantastic.…If it doesn't, we don't have to use it.…But it's another contribution to try…and get more performance out of Entity Framework.…
So let's see how this works.…Okay, so open up the Explicitly Compiled Query test file.…And you'll see a couple reminders here…to add in the compiled query.…We want to make sure we don't forget.…Now.…Compiled queries need to be static Funcs.…
- 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.