Replace a Set of Choices with FirstOrDefault
How to Refactor a chain of conditionals with
When we need to find a value between multiple choices, we write consecutive
if statements to check for a valid result every time.
For example, let’s find the next film to watch from one of three sources: the latest releases in cinemas, our friends’ recommendations, and the all-time classics.