Exemple #1
0
 public static void NotNull(object obj, string argName)
 {
     if (obj == null)
     {
         throw ErrorHelper.ArgNull(argName);
     }
 }
Exemple #2
0
 public static void NotNullOrEmpty(string value, string argName)
 {
     if (string.IsNullOrWhiteSpace(value))
     {
         throw ErrorHelper.ArgNull(argName);
     }
 }
Exemple #3
0
 public static void PropertyNotNullOrEmpty(string value, string propertyPath)
 {
     if (string.IsNullOrWhiteSpace(value))
     {
         throw ErrorHelper.ArgNull(string.Format("Property path {0} cannot be null or empty", propertyPath));
     }
 }
Exemple #4
0
 public static void PropertyNotNull(object obj, string propertyPath)
 {
     if (obj == null)
     {
         throw ErrorHelper.ArgNull(string.Format("Property path {0} cannot be null", propertyPath));
     }
 }
 public static string ToText(this byte[] input)
 {
     if (input == null)
     {
         throw ErrorHelper.ArgNull("input");
     }
     return(Encoding.UTF8.GetString(input));
 }