Newbe.ObjectVisitor 0.4.4 发布,模型验证器上线
2023-02-18 16:43:39 时间
Newbe.Claptrap 0.4.4 发布,模型验证器上线。
更新内容
完全基于表达式树的模型验证器
本版本,我们带来了基于表达式树实现的模型验证器。并实现了很多内置的验证方法。
我们罗列了与 FluentValidation 比较的情况:
Build in Validators | FluentValidation 9.X | Newbe.ObjectVistor |
---|---|---|
NotNull | ✔️ | ✔️ NotNull; class |
NotEmpty | ✔️ | ✔️ NotEmpty; string,enumerable |
NotEqual | ✔️ | ✔️ NotEqual; all |
Equal | ✔️ | ✔️ Equal; all |
Length | ✔️ | ✔️ Length; string,enumerable |
MaxLength | ✔️ | ✔️ MaxLength; string,enumerable |
MinLength | ✔️ | ✔️ MinLength; string,enumerable |
Less Than | ✔️ | ✔️ LessThan; number |
Less Than Or Equal | ✔️ | ✔️ LessThanOrEqual; number |
Greater Than | ✔️ | ✔️ GreaterThan; number |
Greater Than Or Equal | ✔️ | ✔️ GreaterThanOrEqual; number |
Predicate | ✔️ | ✔️ Validate; all |
Regular Expression | ✔️ | ✔️ MatchRegex,NotMatchRegex; string |
✔️ | ? MatchRegex; string | |
Credit Card | ✔️ | ? MatchRegex; string |
Enum | ✔️ | ✔️ IsInEnum; number,string,enum |
Enum Name | ✔️ | ✔️ IsEnumName; string |
Empty | ✔️ | ✔️ Empty; string,enumerable |
Null | ✔️ | ✔️ Null; class |
ExclusiveBetween | ✔️ | ✔️ IsInRange; number,enum |
InclusiveBetween | ✔️ | ✔️ IsInRange; number,enum |
ScalePrecision | ✔️ | ✔️ ScalePrecision; number |
Or | ❌ | ✔️ Or; all |
IsInSet | ❌ | ✔️ IsInSet; all |
IsNotInSet | ❌ | ✔️ IsNotInSet; all |
CanParse | ❌ | ? CanParse; all |
FluentAPI 生成器重构的代码
我们基于 0.3 已经发布的 FluentAPI 进行了核心代码重构,现在一些特定场景下需要您指定的泛型参数更少了,但是功能没有减少,更有利您进行开发。
类似的,例如下面这个变更:
// create a data visitor to cover sensitive data
_visitor = default(UserModel).V()
- .ForEach<UserModel, string>(x => CoverSensitiveData(x))
+ .ForEach<string>(x => CoverSensitiveData(x))
.Cache();
同时支持英文与简体中文方法注释
在热心网友 EventHorizon1024 的帮助下,我们在保留英文作为原始注释的情况下,对使用简体中文 IDE 的开发者们提供了全简中的方法说明。
开发者无需特殊操作,便可以在 IDE 中直接查看到简体中文的方法注释。
如何实现的详细操作方法,开发者也可以通过以下链接借鉴使用:
https://github.com/dotnet/roslyn/issues/3371#issuecomment-737623706
开发文章站点正式上线
我们非常顺利的上线了开发文档站点:
- http://ov.newbe.pro
- http://cn.ov.newbe.pro 中国大陆访问更快
- https://github.com/newbe36524/Newbe.ObjectVisitor.Docs
后续所有关于本工具包相关的文章除了在博客 https://www.newbe.pro 及相关博客公布之外,我们将会更新以上站点,丰富其中的文档。
目前,我们已经上线了几篇简单的文档:
相关文章
- 一起来学redis-redis数据结构
- 一起来学redis-redisObject
- 一起来学redis-持久化
- 一起来学redis redission
- netfilter 五链四表 - 为什么服务器没有监听 80 端口却被k3s占用了
- RedisRoad - 01 Redis 的基本操作
- RedisRoad - 02 数据类型 String
- RedisRoad - 03 数据类型: List 列表
- RedisRoad - 04 数据类型 Set 集合
- RedisRoad - 05 数据类型 ZSet 有序集合
- RedisRoad - 06 数据类型 Hash 映射
- RedisRoad - redis 使用 unlink 删除大 key
- 【开个坑】 kustz 快速发布应用到 Kubernetes
- kustz 从零开始写一个 kubernetes 发布管理工具(汇总)
- 算法学习——递推之猴子爬山
- 算法学习——递推之超级素数
- 算法学习——枚举之完美综合式
- 算法学习——递归之排队购票问题
- 算法学习——枚举之超级方程
- 算法学习——枚举之最简真分数