Пример #1
0
        private static string GetFacetName(Database database, ID contactFacetId)
        {
            if (contactFacetId == default(ID))
            {
                return(null);
            }

            ContactFacetNameItem cfnItem = database.GetItem(contactFacetId);

            if (cfnItem == null)
            {
                return(null);
            }
            return(cfnItem.FacetName);
        }
        private static IFacet GetFacet(Database database, ID contactFacetId)
        {
            ContactFacetNameItem cfnItem = database.GetItem(contactFacetId);

            if (cfnItem == null)
            {
                return(null);
            }
            var facetName = cfnItem.FacetName;
            var contact   = Sitecore.Analytics.Tracker.Current.Contact;

            if (contact == null)
            {
                return(null);
            }
            var facet = contact.Facets[facetName];

            return(facet);
        }