One LINQ Extension Method You NEED To Know For Cleaner EF Core Queries

Published: 17 February 2023
on channel: Milan Jovanović
21,644
1.2k

☄️ Master the Modular Monolith Architecture: https://bit.ly/3SXlzSt
📌 Accelerate your Clean Architecture skills: https://bit.ly/3PupkOJ
🚀 Support me on Patreon to access the source code:   / milanjovanovic  

EF Core is the most popular ORM among .NET developers, and rightfully so. It's common to write LINQ queries with EF Core to execute SQL queries on the database. LINQ can sometimes become verbose when you need to write complex conditional statements. So here's a useful LINQ extension method that will make your EF Core queries cleaner.

Join my weekly .NET newsletter:
https://www.milanjovanovic.tech

Read my Blog here:
https://www.milanjovanovic.tech/blog

Subscribe for more:
   / @milanjovanovictech  

Chapters
0:00 Setting the scene
1:04 Filtering data with EF Core
2:33 Conditional filtering in LINQ Where statement
5:22 Implementing the WhereIf extension method
7:48 Using the WhereIf method in a LINQ query


Watch video One LINQ Extension Method You NEED To Know For Cleaner EF Core Queries online, duration hours minute second in high quality that is uploaded to the channel Milan Jovanović 17 February 2023. Share the link to the video on social media so that your subscribers and friends will also watch this video. This video clip has been viewed 21,644 times and liked it 1.2 thousand visitors.