using System.Collections.Generic;
public static class Program
private static void Main(string[] args)
var config = new MapperConfiguration(conf => conf.AddProfile<MyMapping>());
var mapper = config.CreateMapper();
var source = new StudentExamModel
var dest = mapper.Map<IReadOnlyList<StudentExam>>(source);
foreach (var item in dest)
Console.WriteLine($"{item.StudentId} - {item.ExamId}");
public int Id { get; set; }
public string Name { get; set; }
public class MyMapping : Profile
CreateMap<StudentExamModel, IReadOnlyList<StudentExam>>()
.ConvertUsing(model => model.Exams
.Select(exam => new StudentExam { StudentId = exam.Id, ExamId = exam.Id.ToString() })
public int Id { get; set; }
public string Name { get; set; }
public string ExamId { get; set; }
public int Id { get; set; }
public int StudentId { get; set; }
public class StudentExamModel
public List<Exam> Exams { get; set; }
public int StudentId { get; set; }