Suppose I have the following entities (classes)
public class Target
{
public string Value;
}
public class Source
{
public string Value1;
public
AutoMapper allows you to add conditions to properties that must be met before that property will be mapped.
I was doing the mapping with some enum conditions, have a look that is little effort for the community from my side.
}
.ForMember(dest => dest.CurrentOrientationName,
opts => opts.MapFrom(src => src.IsLandscape?
PageSetupEditorOrientationViewModel.Orientation.Landscape :
PageSetupEditorOrientationViewModel.Orientation.Portrait));