Created
April 3, 2019 08:43
-
-
Save MartinZikmund/beed798a2c2e43f719b0774fa87cc792 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
private string SafeGetValue<T>(Func<T> getter) | |
{ | |
try | |
{ | |
var value = getter(); | |
if ( value == null) | |
{ | |
return "(null)"; | |
} | |
return Convert.ToString(value); | |
} | |
catch (NotImplementedException ex) | |
{ | |
return "(Not implemented)"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment