Ad
  • Custom User Avatar

    When expecting non-null (! null forgiving) you can use First() instead of FirstOrDefault(). That expects at least one element in the enumeration, and won't return a null-default-type. (Consequential difference: If it were null with ! it would throw a NullReferenceException, with First() it would throw a InvalidOperationException.)