In this section, Phil demonstrates filtering results returned from Entity Framework Core using the LINQ Where clause. Phil demonstrates building LINQ statements using single statements as well as using multiple statements to build up your final Where clause.
- [Instructor] Applications seldom, if ever,…want to return all the records from a table…into the application.…WHERE clauses are used in SQL databases…and EF Core fully supports WHERE clauses through link.…It's going to filter based on values…and you can chain multiple WHERE clauses together as ANDs.…We'll see this in practice,…but the fact that you can build up a query…without it executing until you iterate over it…allows you to write some very specific application code…for conditional querying.…
When you're chaining statements together…and you have ORs, I just want to give a shout out…to be careful that it is executing as you expect,…and we'll see an example of where it might not do…what you expect it to.…So let's write up some WHERE statements using LINQ.…Okay let's look at some simple WHERE clauses,…and what I want to do here is just filter…the list of product, so we're going to return…a list of products.…
We can also make that an IEnumerable.…Context.Product.Where, we used a WHERE clause…and that takes a lambda.…
- 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.