예제 #1
0
 /// <summary>
 ///     Throws whether the value is null.
 /// </summary>
 /// <typeparam name="T">A class type.</typeparam>
 /// <param name="expression">The expression property.</param>
 /// <param name="message">The message.</param>
 public static void IsNull <T>(Expression <Func <T> > expression, string message = null)
     where T : class
 {
     ThrowIf <ArgumentException>
     .IsNull(expression, message);
 }
예제 #2
0
 /// <summary>
 ///     Throws whether the value is equal to an other specified value.
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="expression">The expression property.</param>
 /// <param name="testValue">The specified value.</param>
 /// <param name="message">The message.</param>
 public static void IsEqualTo <T>(Expression <Func <T> > expression, T testValue = default(T), string message = null)
 {
     ThrowIf <ArgumentOutOfRangeException>
     .IsEqualTo(expression, testValue, message);
 }
예제 #3
0
 /// <summary>
 ///     Throws whether a specified string is null or an Empty string.
 /// </summary>
 /// <param name="expression">The expression property.</param>
 /// <param name="message">The message.</param>
 public static void IsNullOrEmpty(Expression <Func <string> > expression, string message = null)
 {
     ThrowIf <ArgumentNullException>
     .IsNullOrEmpty(expression, message);
 }