コード例 #1
0
        private Guid FindPrimaryContact(TextEntities textEntities, Guid enrchEmailDataId, bool newContact)
        {
            ContactEntity primaryContact = textEntities.Contacts
                                           .FirstOrDefault(contact => contact.IsFoundInLastEmail);

            if (primaryContact == null)
            {
                return(Guid.Empty);
            }
            if (newContact)
            {
                return(primaryContact.Id);
            }
            else
            {
                string hash = primaryContact.GetHash();
                return(GetTextEntityId(hash, enrchEmailDataId));
            }
        }