Exemplo n.º 1
0
        protected override vCardMember CreateVCardMemberOrNull(GenericComObjectWrapper <Recipient> recipientWrapper, string nameWithoutEmail, DistributionListSychronizationContext context, IEntitySynchronizationLogger synchronizationLogger, ILog logger)
        {
            var uid          = context.GetUidByEmailAddress(recipientWrapper.Inner.Address);
            var targetMember = new vCardMember();

            if (uid != null)
            {
                targetMember.Uid = uid;
            }
            else
            {
                targetMember.EmailAddress = recipientWrapper.Inner.Address;
                targetMember.DisplayName  = nameWithoutEmail;
            }
            return(targetMember);
        }
        protected override vCardMember CreateVCardMemberOrNull(GenericComObjectWrapper <Recipient> recipientWrapper, string nameWithoutEmail, DistributionListSychronizationContext context, IEntityMappingLogger mappingLogger, ILog logger)
        {
            var uid = context.GetUidByEmailAddress(recipientWrapper.Inner.Address);

            if (uid == null)
            {
                var logMessage = $"Did not find Uid of EmailAddress '{recipientWrapper.Inner.Address}'. Member won't be added to contact group";
                logger.WarnFormat(logMessage);
                mappingLogger.LogMappingWarning(logMessage);
            }

            var targetMember = new vCardMember();

            targetMember.Uid = uid;
            return(targetMember);
        }