private static void CheckIdentifier(IXDbContact contact) { if (string.IsNullOrEmpty(contact.IdentifierSource) || string.IsNullOrEmpty(contact.IdentifierValue)) { throw new Exception("A contact must have an identifiersource and identifiervalue!"); } }
public void IdentifyCurrent(IXDbContact contact) { CheckIdentifier(contact); if (Tracker.Current?.Session != null) { Tracker.Current.Session.IdentifyAs(contact.IdentifierSource, contact.IdentifierValue); } }
public void IdentifyCurrent(IXDbContact contact) { CheckIdentifier(contact); if (Tracker.Current?.Session != null) { var identificationManager = ServiceLocator.ServiceProvider.GetRequiredService <IContactIdentificationManager>(); identificationManager.IdentifyAs(new KnownContactIdentifier(contact.IdentifierSource, contact.IdentifierValue)); } }