SingleOrDefault

The LINQ operator that returns the only matching item or null, and throws if more than one item matches.

In more detail

It suits lookups by a unique key such as an identifier. The Async versions run the query against the database in EF Core.

Related terms

Taught in

References