AutoMapper Newbie Question.
I have a source and destination DTO that have the same fields and child collections. How can AutoMapper map these?
Simplified source and destination DTOs share the same names:
Customer Orders Invoices CustomerInfo
try
Mapper.CreateMap<Customer, CustomerModel>();
Mapper.CreateMap<Orders, OrderModel>();
Mapper.CreateMap<Invoices, InvoicesModel>();
Mapper.CreateMap<CustomerInfo, CustomerInfoModel>();
var mappedModel = Mapper.Map<Customer, CustomerModel>(customer);
here is another similar topic: AutoMapper - mapping child collections in viewmodel
Order
,Invoice
, etc.) – D Stanley