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 bool In(this int value, params int[] array) { | |
return array.Contains(value); | |
} | |
public static int Or(this int value, int defaultValue) { | |
return value > 0 ? value : defaultValue; | |
} |
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 bool HasValue(this string value) { | |
return !string.IsNullOrEmpty(value); | |
} | |
public static bool IsEmpty(this string value) { | |
return string.IsNullOrEmpty(value); | |
} | |
public static int ToInt(this string value) { | |
if (value.IsEmpty()) { return -1; } |