❤️ 关注 Furion 微信公众号有惊喜哦!
🫠 遇到问题了
Skip to main content
⭐️ 开通 VIP 服务仅需 499 元/年,尊享 365 天项目无忧23 立即开通23 ⭐️
特别赞助

3. DataValidator 静态类

3.1 验证对象数据

var result = DataValidator.TryValidateObject(obj);

3.2 验证单个值

var result = DataValidator.TryValidateValue(value, typeof(RequiredAttribure), typeof(RangeAttribute));

3.3 正则表达式验证单个值

var result = DataValidator.TryValidateValue(value,"正则表达式");

3.4 验证类型验证单个值

var result = DataValidator.TryValidateValue(value, ValidationTypes.Number);

var result2 = DataValidator.TryValidateValue(value, ValidationPattern.AllOfThem, ValidationTypes.Number, ValidationTypes.Required);