public static void Main()
MapperConfiguration config = new MapperConfiguration(cfg =>
cfg.AddProfile<MappingProfile>();
IMapper mapper = config.CreateMapper();
AssociatedFirm = "AssociatedFirm",
NoteVM dest = mapper.Map<NoteVM>(src);
Console.WriteLine(JsonSerializer.Serialize(dest, new JsonSerializerOptions { WriteIndented = true }));
public class MappingProfile : Profile
CreateMap<Note, NoteVM>()
.ForMember(d => d.NoteParent, opt => opt.MapFrom((src, dest, destMember, ctx) =>
if (src.AssociatedFirm != null)
if (src.Schedule != null)
public string Agent { get; set; }
public string AssociatedFirm { get; set; }
public string Review { get; set; }
public string Schedule { get; set; }
public string Participant { get; set; }
public string NoteParent { get; set; }