这就是我要找的:
[RequiredIf("IsNewClient", true, ErrorMessage =*The value of other (string) property*)]
那会更好:
[RequiredIf("IsNewClient", true, ErrorMessage =*Calling a function and get the value*)]
这就是我要找的:
[RequiredIf("IsNewClient", true, ErrorMessage =*The value of other (string) property*)]
那会更好:
[RequiredIf("IsNewClient", true, ErrorMessage =*Calling a function and get the value*)]
您可以使用类似的方法:
[RequiredIf("GoAbroad == true")]
public string PassportNumber { get; set; }
有关更多信息,请查看ExpressiveAnnotations。希望这可以帮助...