/// <summary>
        /// Transform data from base class to derved class entity.
        /// </summary>
        /// <param name="emailDocument"> base class entity emailDocumentEntity to be transformed </param>
        /// <returns> final lotus notes email document entity </returns>
        private LotusNotesEMailDocumentEntity TransformEmailDocumentEntityToLotusNotesEmailDocumentEntity(EmailDocumentEntity emailDocument)
        {
            LotusNotesEMailDocumentEntity lotusNotesEmailDocumentEntity = new LotusNotesEMailDocumentEntity
            {
                DocumentID = emailDocument.DocumentID,
                MIMEType   = emailDocument.MIMEType
            };

            lotusNotesEmailDocumentEntity.Files.AddRange(emailDocument.Files);
            lotusNotesEmailDocumentEntity.Tags.AddRange(emailDocument.Tags);
            lotusNotesEmailDocumentEntity.MessageID = emailDocument.MessageID;

            #region Unused logical properties - use them when required.

            /*
             * Below are logical properties in a email document entity - they are not needed in current system, hence to improve performance commenting out this code.
             * This shall be used need basis
             *
             * lotusNotesEmailDocumentEntity.DateReceived = emailDocument.DateReceived;
             * lotusNotesEmailDocumentEntity.DateSent = emailDocument.DateSent;
             * lotusNotesEmailDocumentEntity.From = emailDocument.From;
             * lotusNotesEmailDocumentEntity.IsDeliveryReceiptSet = emailDocument.IsDeliveryReceiptSet;
             * lotusNotesEmailDocumentEntity.IsReadReceiptSet = emailDocument.IsReadReceiptSet;
             * lotusNotesEmailDocumentEntity.Subject = emailDocument.Subject;
             * lotusNotesEmailDocumentEntity.To = emailDocument.To;
             */
            #endregion

            return(lotusNotesEmailDocumentEntity);
        }
        /// <summary>
        /// Create LotusNotesEmailDocumentObject using deserialized object's data
        /// </summary>
        /// <param name="documentEntities"> Document Entity to be transformed </param>
        /// <returns> list of lotus notes email documents </returns>
        private IEnumerable <LotusNotesEMailDocumentEntity> InitializeLotusNotesEDRMEntities(IEnumerable <EmailDocumentEntity> documentEntities)
        {
            List <LotusNotesEMailDocumentEntity> lotusNotesEmailDocumentEntities = new List <LotusNotesEMailDocumentEntity>();
            TagEntity tagEntity = null;

            foreach (EmailDocumentEntity document in documentEntities)
            {
                LotusNotesEMailDocumentEntity lotusNotesEmailDocumentEntity = TransformEmailDocumentEntityToLotusNotesEmailDocumentEntity(document);

                #region Unused logical properties - use then when required

                /*
                 * Below are logical properties in a Outlook email document entity - they are not needed in current system, hence to improve performance commenting out this code.
                 * This shall be used need basis
                 *
                 * tagEntity = document.Tags.FirstOrDefault<TagEntity>(p => p.TagName.ToString().Equals(LotusNotesEdrmManagerConstants.TagNameEmailClient));
                 * lotusNotesEmailDocumentEntity.EmailClient = (tagEntity != null) ? tagEntity.TagValue.ToString() : string.Empty;
                 */
                #endregion

                tagEntity = document.Tags.FirstOrDefault <TagEntity>(p => p.TagName.ToString().Equals(LotusNotesEdrmManagerConstants.TagNameConversationTopic));
                lotusNotesEmailDocumentEntity.ConversationTopic = (tagEntity != null) ? tagEntity.TagValue : string.Empty;

                tagEntity = document.Tags.FirstOrDefault <TagEntity>(p => p.TagName.ToString().Equals(LotusNotesEdrmManagerConstants.TagNameInReplyToId));
                lotusNotesEmailDocumentEntity.InReplyToId = (tagEntity != null) ? tagEntity.TagValue : string.Empty;

                tagEntity = document.Tags.FirstOrDefault <TagEntity>(p => p.TagName.ToString().Equals(LotusNotesEdrmManagerConstants.TagNameLotusNotesEmailDocumentId));
                lotusNotesEmailDocumentEntity.LotusNotesEmailDocumentID = (tagEntity != null) ? tagEntity.TagValue : string.Empty;

                tagEntity = document.Tags.FirstOrDefault <TagEntity>(p => p.TagName.ToString().Equals(LotusNotesEdrmManagerConstants.TagNameMailStore));
                lotusNotesEmailDocumentEntity.MailStore = (tagEntity != null) ? tagEntity.TagValue : string.Empty;

                tagEntity = document.Tags.FirstOrDefault <TagEntity>(p => p.TagName.ToString().Equals(LotusNotesEdrmManagerConstants.TagNameReferenceId));
                lotusNotesEmailDocumentEntity.ReferenceId = (tagEntity != null) ? tagEntity.TagValue : string.Empty;

                tagEntity = document.Tags.FirstOrDefault <TagEntity>(p => p.TagName.ToString().Equals(LotusNotesEdrmManagerConstants.TagNameMessageId));
                lotusNotesEmailDocumentEntity.MessageID = (tagEntity != null) ? tagEntity.TagValue : string.Empty;

                lotusNotesEmailDocumentEntities.Add(lotusNotesEmailDocumentEntity);
            }

            return(lotusNotesEmailDocumentEntities);
        }
        /// <summary>
        /// Transform data from base class to derved class entity.
        /// </summary>
        /// <param name="emailDocument"> base class entity emailDocumentEntity to be transformed </param>
        /// <returns> final lotus notes email document entity </returns>
        private LotusNotesEMailDocumentEntity TransformEmailDocumentEntityToLotusNotesEmailDocumentEntity(EmailDocumentEntity emailDocument)
        {
            LotusNotesEMailDocumentEntity lotusNotesEmailDocumentEntity = new LotusNotesEMailDocumentEntity
            {
                DocumentID = emailDocument.DocumentID,
                MIMEType = emailDocument.MIMEType
            };

            lotusNotesEmailDocumentEntity.Files.AddRange(emailDocument.Files);
            lotusNotesEmailDocumentEntity.Tags.AddRange(emailDocument.Tags);
            lotusNotesEmailDocumentEntity.MessageID = emailDocument.MessageID;
           
            #region Unused logical properties - use them when required.                
            /*
            * Below are logical properties in a email document entity - they are not needed in current system, hence to improve performance commenting out this code.
            * This shall be used need basis

            lotusNotesEmailDocumentEntity.DateReceived = emailDocument.DateReceived;
            lotusNotesEmailDocumentEntity.DateSent = emailDocument.DateSent;
            lotusNotesEmailDocumentEntity.From = emailDocument.From;
            lotusNotesEmailDocumentEntity.IsDeliveryReceiptSet = emailDocument.IsDeliveryReceiptSet;
            lotusNotesEmailDocumentEntity.IsReadReceiptSet = emailDocument.IsReadReceiptSet;            
            lotusNotesEmailDocumentEntity.Subject = emailDocument.Subject;
            lotusNotesEmailDocumentEntity.To = emailDocument.To;
           */
            #endregion

            return lotusNotesEmailDocumentEntity;
        }