Course overview

Mastering LINQ and C#: Your Journey from Beginner to Expert

Course content7 lessons
Introduction to LINQ: Filtering a List of Integers in C# Introduction to LINQ: Filtering a List of Integers in C# Lesson 1 Grouping and Sorting Objects with GroupBy and Aggregating with Average Grouping and Sorting Objects with GroupBy and Aggregating with Average Lesson 2 Selecting a Specific Object with FirstOrDefault in LINQ Selecting a Specific Object with FirstOrDefault in LINQ Lesson 3 Grouping Data with GROUP BY and Navigating Individual Group Containers Grouping Data with GROUP BY and Navigating Individual Group Containers Lesson 4 Projection with SELECT: Creating Objects with Fewer Attributes Projection with SELECT: Creating Objects with Fewer Attributes Lesson 5 Conditional Projection: A SELECT That Integrates IF/ELSE Logic Conditional Projection: A SELECT That Integrates IF/ELSE Logic Lesson 6 Joining Two Collections with JOIN: One-To-Many Relationships in LINQ Joining Two Collections with JOIN: One-To-Many Relationships in LINQ Lesson 7
Previous
Up next Next
Current lesson | Lesson 3/7

Selecting a Specific Object with FirstOrDefault in LINQ

Mastering LINQ and C#: Your Journey from Beginner to Expert 0%
I'll explain how to use FirstOrDefault in LINQ to find a specific element in a C# collection, covering both the case when the element exists and when it isn't found.
Instructor
G Giovanni Pace
Up next Grouping Data with GROUP BY and Navigating Individual Group Containers