Пример #1
0
 /// <summary>
 ///     A message to be delivered to a Recipient.
 /// </summary>
 /// <param name="sender">
 ///     The sender of the message, i.e. what the receiver of the message sees as the sender of the
 ///     message.
 /// </param>
 /// <param name="digipostRecipient">
 ///     The recipient recieving the message.
 /// </param>
 /// <param name="primaryDocument">
 ///     The primary document sent to the recipient.
 /// </param>
 public Message(Sender sender, IDigipostRecipient digipostRecipient, IDocument primaryDocument)
 {
     Sender            = sender;
     DigipostRecipient = digipostRecipient;
     PrimaryDocument   = primaryDocument;
     Attachments       = new List <IDocument>();
 }
        public static messagerecipient ToDataTransferObject(IDigipostRecipient recipient)
        {
            messagerecipient messageRecipientDto = null;

            if (recipient is RecipientById)
            {
                messageRecipientDto = RecipientDataTransferObjectFromRecipientById((RecipientById)recipient);
            }

            if (recipient is RecipientByNameAndAddress)
            {
                messageRecipientDto = RecipientDataTransferObjectFromRecipientByNameAndAddress((RecipientByNameAndAddress)recipient);
            }

            return(messageRecipientDto);
        }