I have the following ViewModel:
public class RegistrationViewModel
{
public Associate Associate { get; set; }
public AssociateWeight AssociateWeight { get; set; }
[DisplayName("Confirm Weight")]
[Required(ErrorMessage = "Please enter a weight.")]
[Compare("AssociateWeight.Weight", ErrorMessage = "Please enter identical weights.")]
public decimal ConfirmWeight { get; set; }
}
The property AssociateWeight
has a property called Weight
that I would like to compare to ConfirmWeight
to make sure they're equal. How can I accomplish this?