namespace AutoMapperPlayground
public static void Main()
var personDTO = new PersonDTO
Mapper.CreateMap<AddressDTO, Address>();
Mapper.CreateMap<PersonDTO, Person>();
Mapper.CreateMap<AddressDTO, Address>().ReverseMap();
Mapper.CreateMap<PersonDTO, Person>().ReverseMap();
var person = Mapper.Map<PersonDTO, Person>(personDTO);
Console.WriteLine("I'm {0} {1} and i'm from {2} state.", person.FirstName, person.LastName, person.Address.State);
public string Street { get; set; }
public string City { get; set; }
public string State { get; set; }
public string ZipCode { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public Address Address { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public AddressDTO Address { get; set; }
public string Street { get; set; }
public string City { get; set; }
public string State { get; set; }
public string ZipCode { get; set; }