Hi,
I’m working on a Web API 2 project. Besides the requirement that some properties are required, some only can have specific values. (“000000007173”, “000000007174”, “000000007178”, “000000007179”, “000000006508”, “000000006509”, “000000007209”, “000000007210”, “2KBIM”, “10KBIM”)
Is there a way to do this?
[Required(ErrorMessage = "Please add Product Code to the request.")]
[MaxLength(15, ErrorMessage = "The product code can not be more than 15 characters")]
public string productCode { get; set; }