예제 #1
0
        public static IValidateValue <T> ToHaveValue <T>(this IValidateValue <T> param, string reason = null, params object[] reasonArgs)
        {
            if (object.Equals(param.Value, default(T)))
            {
                param.HandleMissingValue("be specified", null, reason, reasonArgs);
            }

            return(param);
        }
예제 #2
0
        public static IValidateValue <T> NotToBeNull <T>(this IValidateValue <T> param, string reason = null, params object[] reasonArgs)
            where T : class
        {
            if (object.ReferenceEquals(param.Value, null))
            {
                param.HandleMissingValue("be specified", null, reason, reasonArgs);
            }

            return(param);
        }