Say I have a 'Comment' property on a 'Message' class. I also have 2 class properties which have a 'Body' property. If the class has either of the class properties set, I want AutoMapper to project the Body property into the comment property of the model, otherwise use the normal comment property on the message class.
e.g.
public class Message
{
public string Comment { get; set; }
public Inbound? InboundMessage { get; set; }
public Outbound? OutboundMessage { get; set; }
}
public class Inbound
{
public string Body { get; set; }
}
public class Outbound
{
public string Body { get; set; }
}
public class MessageModel
{
public string Comment { get; set; }
}
I've not seen anything in the documentation which handles this.