Last active
July 30, 2016 10:33
-
-
Save isidore/78c61f790ac304b622ab55e9df84e07f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
return new Func<string>[] | |
{ | |
Win, | |
Advantage, | |
ScoreNormal, | |
ScorePerson1, | |
ScorePerson2, | |
ScoreTie | |
}.FirstNonNull(); | |
public static T FirstNonNull<T>(this IEnumerable<Func<T>> methods) | |
{ | |
return methods.Select(x => x()).First(x => x != null); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment