madstt
11/8/2012 - 8:43 AM

AutoMapper issues

AutoMapper issues

Mapper.CreateMap<IFixedFrequencyLocalReportingPoint, LocalReportingPointDto>()
    .ForMember(x => x.FrequencyId, opt => opt.MapFrom(x => x.Frequency.Id))
    .ForMember(x => x.QualifiedName, opt => opt.MapFrom(x => x.GetQualifiedName()))
    ;

Mapper.CreateMap<ITemplateBase, TemplateBaseDto>()
    .ConvertUsing<TemplateConverter>();

ITemplateBase template;
Mapper.Map<IFixedFrequencyLocalReportingPoint, LocalReportingPointDto>((IFixedFrequencyLocalReportingPoint)template);