Beispiel #1
0
 public static void NotNull <T>(
     [CanBeNull, AssertionCondition(AssertionConditionType.IS_NOT_NULL)] T?arg,
     [NotNull, InvokerParameterName] string argName) where T : struct
 {
     if (arg == null)
     {
         throw CodeExceptions.ArgumentNull(argName);
     }
 }
Beispiel #2
0
 public static void GenericNotNull <T>(
     [CanBeNull, NoEnumeration] T arg,
     [NotNull, InvokerParameterName] string argName)
 {
     if (arg == null)
     {
         throw CodeExceptions.ArgumentNull(argName);
     }
 }
Beispiel #3
0
 public static void NotNull <T>(
     [CanBeNull] T?arg,
     [NotNull, InvokerParameterName] string argName) where T : struct
 {
     if (arg == null)
     {
         throw CodeExceptions.ArgumentNull(argName);
     }
 }
Beispiel #4
0
 public static void GenericNotNull <T>(
     [AllowNull, SDC.NotNull, NoEnumeration, ValidatedNotNull] T?arg,
     [InvokerParameterName] string argName)
 {
     if (arg == null)
     {
         throw CodeExceptions.ArgumentNull(argName);
     }
 }
Beispiel #5
0
 public static void NotNullAndItemNotNull <T>(
     [CanBeNull, InstantHandle] IEnumerable <T> arg,
     [NotNull, InvokerParameterName] string argName) where T : class
 {
     if (arg == null)
     {
         throw CodeExceptions.ArgumentNull(argName);
     }
     ItemNotNull(arg, argName);
 }
 public static void NotNull <T>(
     [AllowNull, SDC.NotNull, NoEnumeration] T?arg,
     [InvokerParameterName] string argName)
     where T : class
 {
     if (arg == null)
     {
         throw CodeExceptions.ArgumentNull(argName);
     }
 }
Beispiel #7
0
 public static void NotNullAndItemNotNull <T>(
     [CanBeNull, AssertionCondition(AssertionConditionType.IS_NOT_NULL)] IEnumerable <T> arg,
     [NotNull, InvokerParameterName] string argName) where T : class
 {
     if (arg == null)
     {
         throw CodeExceptions.ArgumentNull(argName);
     }
     ItemNotNull(arg, argName);
 }
Beispiel #8
0
 public static void NotNullAndItemNotNull <T>(
     [AllowNull, SDC.NotNull, InstantHandle, ValidatedNotNull] IEnumerable <T?>?arg,
     [InvokerParameterName] string argName) where T : class
 {
     if (arg == null)
     {
         throw CodeExceptions.ArgumentNull(argName);
     }
     ItemNotNull(arg, argName);
 }
Beispiel #9
0
 public static void NotNullNorEmpty <T>(
     [CanBeNull] T[] arg,
     [NotNull, InvokerParameterName] string argName)
 {
     if (arg == null)
     {
         throw CodeExceptions.ArgumentNull(argName);
     }
     if (arg.Length == 0)
     {
         throw CodeExceptions.ArgumentEmpty(argName);
     }
 }
Beispiel #10
0
 public static void NotNullNorEmpty <T>(
     [CanBeNull, InstantHandle] IEnumerable <T> arg,
     [NotNull, InvokerParameterName] string argName)
 {
     if (arg == null)
     {
         throw CodeExceptions.ArgumentNull(argName);
     }
     if (!arg.Any())
     {
         throw CodeExceptions.ArgumentEmpty(argName);
     }
 }
 public static void NotNullNorEmpty <T>(
     [AllowNull, SDC.NotNull] T?[]?arg,
     [InvokerParameterName] string argName)
 {
     if (arg == null)
     {
         throw CodeExceptions.ArgumentNull(argName);
     }
     if (arg.Length == 0)
     {
         throw CodeExceptions.ArgumentEmpty(argName);
     }
 }
Beispiel #12
0
 public static void NotNullNorEmpty <T>(
     [AllowNull, SDC.NotNull, ValidatedNotNull] ICollection <T>?arg,
     [InvokerParameterName] string argName)
 {
     if (arg == null)
     {
         throw CodeExceptions.ArgumentNull(argName);
     }
     if (arg.Count == 0)
     {
         throw CodeExceptions.ArgumentEmpty(argName);
     }
 }
Beispiel #13
0
 public static void NotNullNorEmpty <T>(
     [AllowNull, SDC.NotNull, InstantHandle, ValidatedNotNull] IEnumerable <T>?arg,
     [InvokerParameterName] string argName)
 {
     if (arg == null)
     {
         throw CodeExceptions.ArgumentNull(argName);
     }
     if (!arg.Any())
     {
         throw CodeExceptions.ArgumentEmpty(argName);
     }
 }