public void MappingSample() { var product = new Product { Model = new Domain.Webhook.Model { Code = "12312", Name = "AMG C", Models = new List <Domain.Webhook.Model> { new Domain.Webhook.Model { Name = "43 4Matic" } } } }; Console.WriteLine(product.Model.Name + string.Join(" ", product.Model.Models.Select(x => x.Name))); var detail = new ListingDetail { makeName = product.Manufacturer.Make, makeId = product.Manufacturer.Code, modelId = product.Model.Code, modelName = product.Model.Name + product.Model.Name + string.Join(" ", product.Model.Models.Select(x => x.Name)), modelYear = product.Identifiers.SingleOrDefault(i => i.Name == "Year").Value }; }
public static EditListingViewModel Map(EditListingViewModel viewModel, ListingDetail entity) { return Mapper.Map(entity, viewModel); }