예제 #1
0
        public ResourceUpdateValidator()
        {
            RuleFor(x => x.Name).MustHasValue("资源名称");

            RuleFor(x => x.Sort).MustHasValue("排序值");

            RuleFor(x => x.Alias).MustHasValue("别名").Must(a => H_Validator.IsLetter(a)).WithMessage("别名只能输入英文");
        }
예제 #2
0
        public ResourceAddValidator()
        {
            RuleFor(x => x.Name).MustHasValue("资源名称");

            RuleFor(x => x.ParentId).MustHasValue("父节点Id");

            RuleFor(x => x.Alias).MustHasValue("别名").Must(a => H_Validator.IsLetter(a)).WithMessage("别名只能输入英文");
        }
예제 #3
0
        public ModuleUpdateValidator()
        {
            RuleFor(x => x.Name).MustHasValue("模块名称");

            RuleFor(x => x.Type).MustHasValue("模块类型");

            RuleFor(x => x.Icon).MustHasValue("模块图标").When(a => a.Type == ModuleType.Main);

            RuleFor(x => x.RouterUrl).MustHasValue("子应用路由地址").When(a => a.Type == ModuleType.Sub);

            RuleFor(x => x.Sort).MustHasValue("排序值");

            RuleFor(x => x.Alias).MustHasValue("别名").Must(a => H_Validator.IsLetter(a)).WithMessage("别名只能输入英文");
        }