c# - 基于 2 个列表项的流利验证
问题描述
我的班级有 2 个列表,我需要一个基于 2 的验证规则
public class StdQA{
public int Qid {get; set;}
public int responsetypeid {get; set;}
}
public class AddlQA{
public string Qtext {get; set;}
public int responsetypeid {get; set;}
}
public class CandidateQA{
public List<StdQA> StdQAs
public List<AddlQA> AddlQAs
}
我需要使用 FluentValidation 的验证规则如下:对于候选 QA,StdQAs 和 AddlQAs 中 responsetypeid = 3 的项目计数总和应 >=5。我们还需要确保对于 AddlQA where responsetypeid = 3 Qtext 不为空或空白。我们如何在 c# .Net 中使用 FluentValidation 来实现这一点
解决方案
推荐阅读
- python - 取熊猫数据框中多列的平均值
- javascript - React-chartjs-2 动态更新高度
- php - 在我的 Laravel 应用程序中为用户集成 OnlieMeeting MS (Graph api)
- kubernetes - 如果发布大型 json,用于自动审查应用程序(gitlab-managed-apps)的入口 NGINX 非常慢
- ios - SwiftUI“线程1:EXC_BAD_INSTRUCTION(代码=EXC_I386_INVOP,子代码=0x0)”弹出时
- python - 将新项目添加到 Windows 上下文菜单(右键菜单)
- angular - 添加路由器存储配置 RouterState.Full 会引发神秘的错误消息
- java - java.lang.AssertionError:状态 404
- c++ - 不要使用静态转换进行算术转换(cpp-core-guidelines)
- javascript - 找不到变量 atob React Native+Firebase 错误