Exemple #1
0
 private void DummyContactMethod()
 {
     //DocSection:GetCurrentContact
     // Gets the current contact
     IContactTrackingService contactService = new ContactTrackingService();
     ContactInfo             currentContact = contactService.GetCurrentContactAsync(User.Identity.Name).Result;
     //EndDocSection:GetCurrentContact
 }
Exemple #2
0
        private void DummyPersonalizationMethod()
        {
            //DocSection:PersonaPersonalization
            // Gets the current contact
            IContactTrackingService contactService = new ContactTrackingService();
            ContactInfo             currentContact = contactService.GetCurrentContactAsync(User.Identity.Name).Result;

            // Gets the code name of the current contact's persona
            string currentPersonaName = currentContact.GetPersona()?.PersonaName;

            // Checks whether the current contact is assigned to the "EarlyAdopter" persona
            if (String.Equals(currentPersonaName, "EarlyAdopter", StringComparison.InvariantCultureIgnoreCase))
            {
                // Serve personalized content for the "EarlyAdopter" persona
            }
            //EndDocSection:PersonaPersonalization
        }