Ejemplo n.º 1
0
        /// <summary>
        /// Use the <see cref="ClassValidator.GetPotentialInvalidValues(string, object)"/> for a given entity instance.
        /// </summary>
        /// <param name="entityType">The entity instance to validate</param>
        /// <param name="propertyName">The name of a property</param>
        /// <param name="value">The value of the property.</param>
        /// <param name="activeTags">Tags included in the validation.</param>
        /// <returns>All the invalid values.</returns>
        public virtual InvalidValue[] ValidatePropertyValue(System.Type entityType, string propertyName, object value, params object[] activeTags)
        {
            IClassValidator cv = GetElementOrNew(entityType).Validator;

            if (activeTags != null && activeTags.Length == 0)
            {
                activeTags = null;
            }
            return(cv.GetPotentialInvalidValues(propertyName, value, activeTags).ToArray());
        }
Ejemplo n.º 2
0
 private void isRightEmail(string email)
 {
     userValidator.GetPotentialInvalidValues("email", email).Should("Wrong email").Be.Empty();
 }