摘要: 比如你要验证用户的时候判断一下这个用户名称在数据库是否已经存在了,这时候FluentValidation 就需要注入查询数据库 只需要注入一下就可以了 public class Login3RequestValidator : AbstractValidator<Login3Request> { p 阅读全文
posted @ 2022-08-14 12:05 Bo-Hong 阅读(91) 评论(0) 推荐(0) 编辑
摘要: FluentValidation.AspNetCore 引入包 public class Login2RequestValidator : AbstractValidator<Login2Request> { public Login2RequestValidator() { RuleFor(x = 阅读全文
posted @ 2022-08-14 11:57 Bo-Hong 阅读(168) 评论(0) 推荐(0) 编辑