Ejemplo n.º 1
0
        public static ValidationWithStruct <int> BeginFrom(this ValidationWithStruct <int> item, int begin)
        {
            if (ValidationOn && item.Value < begin)
            {
                ValidationController.NewError(String.Format("{0} phải bắt đầu từ {1}", item.ArgName, begin));
            }

            return(item);
        }
Ejemplo n.º 2
0
        public static ValidationWithStruct <S> NotNull <S>(this ValidationWithStruct <S> item) where S : struct
        {
            if (ValidationOn && item.Value.Equals(null))
            {
                throw new ArgumentNullException(item.ArgName, String.Format("Không thể bỏ trống {0}", item.ArgName));
            }

            return(item);
        }