條件驗證屬性我正在尋找一些關(guān)于實現(xiàn)驗證屬性的最佳方法的建議,該屬性執(zhí)行以下操作。模型public class MyInputModel {
[Required]
public int Id {get;set;}
public string MyProperty1 {get;set;}
public string MyProperty2 {get;set;}
public bool MyProperty3 {get;set;}}我希望至少具有一個值的pro1pro2pro3,如果pro3是唯一填充的值,它不應(yīng)該等于false。如何編寫驗證屬性?為了這個?謝謝你的幫助!
- 3 回答
- 0 關(guān)注
- 362 瀏覽
添加回答
舉報
0/150
提交
取消