Entity Framework Core LINQ functions such as Where, OrderBy[Descending] and Include[ThenInclude] can be represented by delegates. This is often used in custom repositories and is demonstrated in this section.
- [Instructor] LINQ clauses can be written…as generic functions to serve as placeholders…if you want to be able to use, for example,…repository pattern where you build up the queries.…The where clause is represented by…an expression that takes an entity in a bool.…Include and ThenInclude is IQueryable of T…and then an IIncludableQueryable of T and object.…
The OrderBy and ThenBy is an expression…of func of T and in each of these T…is the entity itself, then the object that is the property.…I like to represent these as a tuple…so that I can specify ascending or descending.…To demonstrate the extension methods,…one of the files that you pulled…into your project when we were setting it up…is the IQueryable extensions file.…
When we look at this file,…there are several methods in here,…two different AddWheres, one AddIncludes,…and two AddOrderBys.…Let's start with the AddWheres.…I've got two flavors of it, the first one…you can see on 14, takes a DB set…then a params of the expression func T and bool.…
If there aren't any wheres,…
- 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.