I am trying to make the AnswerString
required to be unique among answers that share the same ModuleID
value. How would I go about achieving this?
public class Answer
{
public int AnswerID { get; set; }
[MaxLength(25)]
[Required]
[Key]
public string AnswerString { get; set; }
public int ModuleID { get; set; }
public int PictureCount { get; set; }
}