From the course: Using Entity Framework Core with Legacy Databases
Unlock the full course today
Join today to access over 22,500 courses taught by industry experts or purchase this course individually.
Solution: Product recall
From the course: Using Entity Framework Core with Legacy Databases
Solution: Product recall
(musical sting) - [Instructor] Now that you've had a chance to work on your own solution, let me show you how I solved the product recall challenge. I started by getting a list of the customers who ordered the faulty product. For each customer, I wanted to check if any of their orders had any item that matched the recall. Here I used where the collection of orders has any order item that have the product ID that matches our recalled product. Next I printed the list of customers to the screen after ordering them by last name and using the distinct extension method to eliminate any duplicates. Let's go ahead and run the program. We now have a clean list of customers that we can call and notify about the recall.
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.