예제 #1
0
        public bool IsValid(object value, IConstraintValidatorContext constraintValidatorContext)
        {
            ISpecified obj = value as ISpecified;

            if (obj != null)
            {
                return(obj.IsSpecified);
            }
            return(false);
        }
예제 #2
0
        public static bool IsValidAndSpecified(this object source, params ValidationTag[] tags)
        {
            if (!source.IsValid(tags))
            {
                return(false);
            }

            ISpecified specified = source as ISpecified;

            return(specified?.IsSpecified ?? false);
        }