I have two fields in one of my class for address like
public string Country { get; set; }
[Required(ErrorMessage = "Postcode is required")]
[RegularExpression(@"REGEX",
ErrorMessage = "Please enter a valid UK Postcode)]
public string postcode { get; set;}
However if the user selects a country other than UK then I want my Postcode field to ignore the REGEX atleast and in an ideal world validate using another REGEX depending upon the country. Can anyone suggest if this is possible in the model itself?