TIL: LINQ DefaultIfEmpty method in C#

from blog Just Some Code, | ↗ original
Today I was reading the AutoFixture source code in GitHub and I found a LINQ method I didn’t know about: DefaultIfEmpty. DefaultIfEmpty returns a collection containing a single element if the source collection is empty. Otherwise, it returns the same source collection. For example, let’s find all the movies with a rating greater than 9....