我有这样的模型:
public class RegisterData
{
[Display]
public RegisterUser registerUser { get; set; } = new RegisterUser();
[Required]
[DataType(DataType.Password)]
[Compare(registerUser.Password)]
public String ConfirmPassword { get; set; }
}
如何轻松地将ConfirmPassword与registerUser字段中的属性进行比较?