To configure Conditional Mapping in AutoMapper in C# and VB.NET you can use the following snippet.
Sample C#
Mapper.CreateMap<Source, Target>().ForMember(dest => dest.Value, opt => opt.MapFrom(src => src.Variable1 == "Value1" ? true : false));
Sample VB.NET
Mapper.CreateMap(Of Source, Target)().ForMember(Function(dest) dest.Value, Function(opt) opt.MapFrom(Function(src) If(src.Variable1 = "Value1", True, False)))
RT @CodeSnippetsNET: Conditional Mapping in AutoMapper http://t.co/F6aPiUpA00 #chsarp #dotnet #vb #coding