Ejemplo n.º 1
0
 /// <summary>
 /// Validates that the specified object is not null.
 /// </summary>
 /// <param name="name">A user-friendly name identifying the value that is missing.</param>
 /// <param name="value">The value to validate.</param>
 public static ValidationResult Validate(string name, object value)
 {
     return
         (value == null
         ? RequiredRule.GetFailedResult(name)
         : ValidationResult.Success);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Validates that the specified string is not empty or null.
 /// </summary>
 /// <param name="name">A user-friendly name identifying the value that is missing.</param>
 /// <param name="value">The value to validate.</param>
 public static ValidationResult Validate(string name, string value)
 {
     return
         (string.IsNullOrWhiteSpace(value)
         ? RequiredRule.GetFailedResult(name)
         : ValidationResult.Success);
 }