Exemple #1
0
        public void CheckIdentifier(IXConnectContact contact)
        {
            if (contact == null)
            {
                throw new ArgumentNullException(nameof(contact));
            }

            if (string.IsNullOrEmpty(contact.IdentifierSource) || string.IsNullOrEmpty(contact.IdentifierValue))
            {
                throw new Exception("A contact must have an identifiersource and identifiervalue!");
            }
        }
Exemple #2
0
        public void IdentifyCurrent(IXConnectContact contact)
        {
            CheckIdentifier(contact);

            if (Tracker.Current == null || Tracker.Current.Contact == null || Tracker.Current.Contact.IsNew)
            {
                return;
            }

            if (Tracker.Current.Session != null)
            {
                Tracker.Current.Session.IdentifyAs(contact.IdentifierSource, contact.IdentifierValue);
            }
        }