Skip to content

Glossary: C# Basics

First / FirstOrDefault

Also written: First, FirstOrDefault

LINQ methods that return the first item passing a test. `First` throws if none matches, while `FirstOrDefault` returns null or 0 instead.

Where the book teaches it

Related terms

LINQnullCommon exception types