public override object GetModel(Guid contactId) { EpExpressCinemaVisitorInfoModel toReturn = new EpExpressCinemaVisitorInfoModel(); Sitecore.XConnect.Contact xConnectContact = EPRepository.GetContact(contactId, CinemaVisitorInfo.DefaultFacetKey); string favoriteMovie = "{unknown}"; if (xConnectContact?.Facets != null) { if (xConnectContact.Facets.ContainsKey(CinemaVisitorInfo.DefaultFacetKey)) { var cinemaVisitorInfo = xConnectContact.Facets[CinemaVisitorInfo.DefaultFacetKey] as CinemaVisitorInfo; favoriteMovie = cinemaVisitorInfo.FavoriteMovie; } else { } } var weKnowTreeOptions = new WeKnowTreeOptionsFactory().GetWeKnowTreeOptions(ProjConstants.Items.WeKnowTreeOptionsEPTab); var weKnowTreeBuilder = new WeKnowTreeBuilder(weKnowTreeOptions); toReturn.ContactId = xConnectContact.Id.ToString(); toReturn.FavoriteMovie = favoriteMovie; toReturn.WeKnowTree = weKnowTreeBuilder.GetWhatWeKnowTreeFromXConnectContact(xConnectContact); //VisitCount = (int)((dynamic)contact).VisitCount return(toReturn); }
public override object GetModel(Guid contactId) { Sitecore.XConnect.Contact contact = EPRepository.GetContact(contactId, new string[] {}); return(new EpTabGdprModel { ContactId = contact.Id.ToString(), LastModified = contact.LastModified }); }
public override object GetModel(Guid contactId) { Sitecore.XConnect.Contact contact = EPRepository.GetContact(contactId, SF.Foundation.Facets.FacetNames.UserSettings); var settings = contact.GetFacet <SF.Foundation.Facets.UserSettings>(); if (settings != null) { return(new UserSettingsTabModel { UserSettings = settings.Settings }); } return(new UserSettingsTabModel()); }
public override object GetModel(Guid contactId) { var contact = EPRepository.GetContact(contactId, CompanyFacet.DefaultFacetKey); return(contact.GetFacet <CompanyFacet>()); }