Mapping the 'count' on child list property in AutoMapper
I am working in an ASP.NET MVC 4 application, and have something similar to this for my domain. public class Party { public Cake PartyCake { get; set; } public List<Candles> CakeCandles { get; set; } } I want to map that to the PartyVM which looks like so: public class PartyVM { public string PartyCakeName { get; set; } public int CandlesCount { get; set; } } How can I tell AutoMapper to work out the Count of the list when doing its mappings? I have this, but all this does is tell it to ignore! Mapper.CreateMap<Party, PartyVM>() .ForMember(dest => dest.CandlesCount, opt => opt.Ignore());