I have a select field
<select asp-for="UserCitizenships" asp-items="Model.CitizenshipsList" class="select2 required">
that is populated by a multiselect list
public MultiSelectList CitizenshipsList { get; set; }
And returns a List of Int
public List<int> UserCitizenships
that I handle manually in the backend. Validation from Data Annotations is not working. I need at least one property to be populated when the form submits. Any ideas?
[Required(ErrorMessage = Helpers.ErrorMessages.Required)]
public List<int> UserCitizenships
{
get
{
....