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 without registration, duration hours minute second in high quality. This video was added by user Milan Jovanović 17 February 2023, don't forget to share it with your friends and acquaintances, it has been viewed on our site 21,644 once and liked it 1.2 thousand people.