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 !"));
         }
     }
 }
Beispiel #2
0
        public bool Equals(SpUserDetail other)
        {
            if (Object.ReferenceEquals(other, null))
            {
                return(false);
            }

            if (Object.ReferenceEquals(this, other))
            {
                return(true);
            }

            if (this.GetType() != other.GetType())
            {
                return(false);
            }

            return(LoginName.Equals(other.LoginName, StringComparison.OrdinalIgnoreCase));
        }