Mapster mapping issue. Mapping a list of objects to a list of strings
I am trying to map a service model to a view model using Mapster. My service model contains a list of strings. My View Model contains a list of type RolesViewModel. RolesViewModel has a string property named RoleName. Below are my models public class UserViewModel { [Display(Name = "Email address")] [Required(ErrorMessage = "The email address is required")] [EmailAddress(ErrorMessage = "Invalid Email Address")] public string Email { get; set; } public List<RolesViewModel> Roles { get; set; } = new List<RolesViewModel>(); } public class RolesViewModel { public RolesViewModel(string roleName) {
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.