Created
July 31, 2014 12:36
-
-
Save imbaker/12f32712dfc8bec2f555 to your computer and use it in GitHub Desktop.
IfNotNull extension method
This file contains hidden or 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
public static U IfNotNull < T, U > (this T t, Func <T, U> function) | |
{ | |
return t != null ? function (t) : default (U); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment