Ejemplo n.º 1
0
        private Dictionary <Guid, Guid> UpdateContactIdentificationInfo(Guid enrchEmailDataId,
                                                                        TextEntities textEntities, string senderEmail, bool isNewEnrichedData)
        {
            HashSet <ContactEntity> contacts           = textEntities.Contacts;
            Dictionary <Guid, Guid> identifiedContacts = new Dictionary <Guid, Guid>();

            foreach (ContactEntity contactEntity in contacts)
            {
                bool isContactIdentified = false;
                if (!isNewEnrichedData)
                {
                    string contactHash = contactEntity.GetHash();
                    isContactIdentified = CheckActualContactIdentification(contactHash, enrchEmailDataId);
                }
                if (isContactIdentified)
                {
                    continue;
                }
                IEnumerable <Guid>        contactIds;
                ContactIdentificationType identificationType = IdentifyContact(contactEntity, textEntities, senderEmail,
                                                                               out contactIds);
                if (!contactIds.IsNullOrEmpty())
                {
                    if (contactIds.Count() == 1)
                    {
                        identifiedContacts.Add(contactEntity.Id, contactIds.First());
                    }
                    Guid entityId = GetTextEntityId(enrchEmailDataId, isNewEnrichedData, contactEntity);
                    if (entityId.IsEmpty())
                    {
                        continue;
                    }
                    _enrichEntitySearchHelper.AddFoundContacts(entityId, contactIds, identificationType);
                }
            }
            return(identifiedContacts);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Adds the found contacts.
 /// </summary>
 /// <param name="contactEntityId">The contact entity identifier.</param>
 /// <param name="contactIds">The contact ids.</param>
 /// <param name="identificationType">Type of the identification.</param>
 public void AddFoundContacts(Guid contactEntityId, IEnumerable <Guid> contactIds,
                              ContactIdentificationType identificationType)
 {
     AddIdentification(contactEntityId, contactIds, identificationType, "EnrchFoundContact", "ContactId");
 }