Exemplo n.º 1
0
        public static IChainableConstraint <TConstraints> WithInvalidLength <TConstraints>(this IChainableConstraint <TConstraints> chainableConstraint, string labelKey, int length) where TConstraints : class
        {
            var message = ValidationMessageFormatter.InvalidLengthKey(labelKey, length);

            return(chainableConstraint.WithMessage(message));
        }
        public static void AddInvalidLength <TEntity, TProperty>(this IConstraintValidatorContext constraintValidatorContext, string key, int length, Expression <Func <TEntity, TProperty> > property)
        {
            var message = ValidationMessageFormatter.InvalidLengthKey(key, length);

            constraintValidatorContext.AddInvalid(message, property);
        }