How to find elements in a list with LINQ in C#
LINQ provides several methods for finding elements in a collection: First, FirstOrDefault, Last, LastOrDefault, Single, SingleOrDefault, Any, All, and Find. Choosing the right one avoids InvalidOperationException and keeps your intent clear.
The key distinction is what happens when no element matches: some methods throw, others return the type's default value (null for reference types, 0 / false for value types).
On this page
First vs FirstOrDefault
Last vs LastOrDefault
Single vs SingleOrDefault
Use Single when you expect exactly one match. It throws if there are zero or more than one.
Find (List<T> method)
Find() is a List<T> method (not LINQ) that returns the first match or default. It's slightly faster than FirstOrDefault for List<T> because it avoids LINQ overhead.
Any: Does Any Element Match?
All: Do All Elements Match?
Contains
Count with Predicate
Real-World Example: Finding a User by ID
Comparison Table
| Method | Returns | Throws when... |
|---|---|---|
First(pred) | First match | No match found |
FirstOrDefault(pred) | First match or default | Never |
Last(pred) | Last match | No match found |
LastOrDefault(pred) | Last match or default | Never |
Single(pred) | Exactly one match | 0 or 2+ matches |
SingleOrDefault(pred) | One match or default | 2+ matches |
Find(pred) (List only) | First match or default | Never |
Any(pred) | bool | Never |
All(pred) | bool | Never |
Contains(value) | bool | Never |
Count(pred) | int | Never |
Take It Further

The most comprehensive book covering C# 12 and .NET 8 from scratch to production.
C# 12 and .NET 8: Modern Cross-Platform Development · Mark J. Price
Get it on Amazon →As an Amazon Associate I earn from qualifying purchases.
Related Articles
Filter a collection in C# with LINQ Where() by passing a predicate function. Uses deferred execution and returns only elements satisfying the condition.
Check if a List is empty in C# using the Count property or LINQ Any() method. Prefer Any() for IEnumerable types to avoid full enumeration overhead.
Use LINQ Select() in C# to project each element into a new form. Transforms a collection with a lambda and returns a new IEnumerable with the results.