Пример #1
0
 public static void NotNull(object obj, string argName)
 {
     if (obj == null)
     {
         throw ErrorHelper.ArgNull(argName);
     }
 }
Пример #2
0
 public static void NotNullOrEmpty(string value, string argName)
 {
     if (string.IsNullOrWhiteSpace(value))
     {
         throw ErrorHelper.ArgNull(argName);
     }
 }
Пример #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));
     }
 }
Пример #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));
     }
 }
Пример #5
0
 public static string ToText(this byte[] input)
 {
     if (input == null)
     {
         throw ErrorHelper.ArgNull("input");
     }
     return(Encoding.UTF8.GetString(input));
 }