I found a solution to my problem and I wanted to report that to hopefully help others as they work with AutoMapper. First off, I was trying to map the wrong object. After a better inspection of the code I determined that I needed to map a class that had the following multilevel inheritance configuration.
public class MessageInsert : ISerializable, ICloneable {}
public class DateTimeInsert : MessageInsert {}
public class TimeStampInsert : DateTimeInsert, ISerializable {}
public class DateStampInsert : DateTimeInsert, ISerializable {}
public class ClockInsert : DateTimeInsert, ISerializable {}
public class CalendarInsert : DateTimeInsert, ISerializable {}
public class DataInsert : MessageInsert, ISerializable {}
public class TokenInsert : DataInsert, ISerializable {}
public class VariableInsert : DataInsert, ISerializable {}
I needed to map a MessageInsert object and have all of the properties from the child levels map over to the new object. AutoMapper handles inheritance mapping but it must be set up in a specific manner with the use of the CreateMap statements. The CreateMap statements that I used below are how I set up the mapping and they seemed to work. If someone sees a better way of doing these and wants to chime in the by all means.
The first block of statements were used to handle the namespace mapping of the different classses, enumerations, structures, etc that had a namespace associated with it.
AutoMapper.Mapper.CreateMap<ABC.QC.Properties.MessageSchedule, DBWebAgent.Properties.MessageSchedule>();
AutoMapper.Mapper.CreateMap<ABC.QC.Properties.DashPropType, DBWebAgent.Properties.DashPropType>();
AutoMapper.Mapper.CreateMap<ABC.QC.Properties.MessageType, DBWebAgent.Properties.MessageType>();
AutoMapper.Mapper.CreateMap<ABC.QC.Properties.DestinationTag, DBWebAgent.Properties.DestinationTag>();
AutoMapper.Mapper.CreateMap<ABC.QC.Properties.QcMessageBody, DBWebAgent.Properties.QcMessageBody>();
AutoMapper.Mapper.CreateMap<ABC.QC.Properties.DataInsertThreshold, DBWebAgent.Properties.DataInsertThreshold>();
AutoMapper.Mapper.CreateMap<ABC.QC.Properties.QuickCOMAlarm, DBWebAgent.Properties.QuickCOMAlarm>();
AutoMapper.Mapper.CreateMap<ABC.QC.Properties.ScrollEffectType, DBWebAgent.Properties.ScrollEffectType>();
AutoMapper.Mapper.CreateMap<ABC.QC.Properties.MessagePriorityType, DBWebAgent.Properties.MessagePriorityType>();
AutoMapper.Mapper.CreateMap<ABC.QC.Properties.QcMessageSegment, DBWebAgent.Properties.QcMessageSegment>();
AutoMapper.Mapper.CreateMap<ABC.QC.Properties.DateTimeInsert, DBWebAgent.Properties.DateTimeInsert>();
AutoMapper.Mapper.CreateMap<ABC.QC.Properties.DateStampInsert, DBWebAgent.Properties.DateStampInsert>();
AutoMapper.Mapper.CreateMap<ABC.QC.Properties.TimeStampInsert, DBWebAgent.Properties.TimeStampInsert>();
AutoMapper.Mapper.CreateMap<ABC.QC.Properties.ClockInsert, DBWebAgent.Properties.ClockInsert>();
AutoMapper.Mapper.CreateMap<ABC.QC.Properties.CalendarInsert, DBWebAgent.Properties.CalendarInsert>();
AutoMapper.Mapper.CreateMap<ABC.QC.Properties.DataInsert, DBWebAgent.Properties.DataInsert>();
AutoMapper.Mapper.CreateMap<ABC.QC.Properties.VariableInsert, DBWebAgent.Properties.VariableInsert>();
AutoMapper.Mapper.CreateMap<ABC.QC.Properties.TokenInsert, DBWebAgent.Properties.TokenInsert>();
The second set of CreateMap statements was defined to handle all of the levels of inheritance in the class.
AutoMapper.Mapper.CreateMap<ABC.QC.Properties.MessageInsert, DBWebAgent.Properties.MessageInsert>()
.Include<ABC.QC.Properties.DateTimeInsert, DBWebAgent.Properties.DateTimeInsert>()
.Include<ABC.QC.Properties.DateStampInsert, DBWebAgent.Properties.DateStampInsert>()
.Include<ABC.QC.Properties.TimeStampInsert, DBWebAgent.Properties.TimeStampInsert>()
.Include<ABC.QC.Properties.ClockInsert, DBWebAgent.Properties.ClockInsert>()
.Include<ABC.QC.Properties.CalendarInsert, DBWebAgent.Properties.CalendarInsert>()
.Include<ABC.QC.Properties.DataInsert, DBWebAgent.Properties.DataInsert>()
.Include<ABC.QC.Properties.VariableInsert, DBWebAgent.Properties.VariableInsert>()
.Include<ABC.QC.Properties.TokenInsert, DBWebAgent.Properties.TokenInsert>();
AutoMapperand how do you expect these two object types to map to each other? Would you like to flatten them and consider them equal if all their properties are the same except for theSubMessagesproperty? What are you hoping to accomplish? - nicholas