Basically I have this class which represents 1:1 with my database
public class User
{
public int UserID { get; set; }
public string Username { get; set; }
public string Role { get; set; }
}
and I have this viewmodel
public class UserEditViewModel
{
public UserEditViewModel()
{
Roles = new List<string>();
}
public int UserID { get; set; }
[Required]
public string Username { get; set; }
[Required]
public List<string> Roles { get; set; }
}
I have no idea how to map between these 2. My current setup :
Mapper.CreateMap<UserEditViewModel, User>().ReverseMap();
