Skip to content

Instantly share code, notes, and snippets.

@madstt
Created November 8, 2012 08:43
Show Gist options
  • Save madstt/4037608 to your computer and use it in GitHub Desktop.
Save madstt/4037608 to your computer and use it in GitHub Desktop.
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);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment