public virtual void SynchronizeParticipants()
 {
     if (string.IsNullOrEmpty(Entity.Sender) && string.IsNullOrEmpty(Entity.Recepient))
     {
         return;
     }
     if (Entity.GetTypedColumnValue <Guid>("ActivityCategoryId") == ExchangeConsts.ActivityMeetingCategoryId)
     {
         var recepientsEmails = (List <string>)RecepientsEmails;
         Dictionary <Guid, string> contactDictionary = ContactUtilities.GetContactsByEmails(UserConnection, recepientsEmails);
         if (contactDictionary.Count > 0)
         {
             var participantRoles = ActivityUtils.GetParticipantsRoles(UserConnection);
             foreach (var contactId in contactDictionary.Keys)
             {
                 AddActivityParticipantToInsertedValues(
                     contactId,
                     new Dictionary <string, object> {
                     { "RoleId", participantRoles["Participant"] }
                 },
                     false
                     );
             }
             var insertedValues = InsertedValues as Dictionary <Guid, object>;
             if (insertedValues != null)
             {
                 UpdateContactAndAccountByParticipant(insertedValues.Keys.ToList());
             }
         }
         Entity.SetColumnValue("Sender", string.Empty);
         Entity.SetColumnValue("Recepient", string.Empty);
     }
 }
 /// <summary>
 /// Retrieves contacts list containing list of <paramref name="emails"/>.
 /// </summary>
 /// <param name="userConnection">A instance of the current user connection.</param>
 /// <param name="emails"> A list of email addresses.</param>
 /// <returns>List of contacts.</returns>
 protected virtual Dictionary <Guid, string> GetContactsByEmails(UserConnection userConnection, List <string> emails)
 {
     return(ContactUtilities.GetContactsByEmails(userConnection, emails.Where(e => !e.IsNullOrEmpty()).ToList()));
 }