views:

126

answers:

0

I have an action method that accepts the following model - LanguagesViewModel:

public class LanguagesViewModel : ViewModelBase
{
 IEnumerable<LanguageItem> Languages { get; set; }
}

public class LanguageItem
{
 [Required]
 public int LanguageId { get; set; }

 [Required]
 public int SpeakingSkillId { get; set; }

 [Required]
 public int WritingSkillId { get; set; }

 [Required]
 public int UnderstandingSkillId { get; set; } 
}

I also have a custom model binder to bind the POST data to the IEnumerable<LanguageItem>.

The question is how do I get DataAnnotations validation to work?