3 ms·
I find that I tend to use SingleOrDefault/FirstOrDefault, combined with an immediate null check, so that I can throw an exception with a more meaningful error m
by douche 12y ago
I find that I tend to use SingleOrDefault/FirstOrDefault, combined with an immediate null check, so that I can throw an exception with a more meaningful error message than "Sequence contains no elements" or "Sequence contains more than one matching element", particularly in Release builds that strip line numbers from log messages.