コード例 #1
0
 public IEnumerable <ValidationResult> Validate(ValidationContext validationContext)
 {
     if (!LoginName.IsNullOrEmpty())
     {
         if (!LoginName.Equals(AdminEmailAddress) && new ValidationHelper().IsEmail(LoginName))
         {
             yield return(new ValidationResult("Username cannot be an email address unless it's same with your email address !"));
         }
     }
 }