public void UpdateProfile([NotNull] ISportPreferencesPayload data)
 {
     Tracker.Current.Interaction.Profiles.Remove(SportsFacet.DefaultKey);
     if (data.Ratings != null)
     {
         Tracker.Current.Interaction.Profiles[SportsFacet.DefaultKey].Score(data.Ratings.ToDictionary(kvp => kvp.Key, kvp => (double)kvp.Value));
     }
 }
        public void UpdateFacet([NotNull] ISportPreferencesPayload data)
        {
            var trackerContact = ContactExtensions.GetCurrentTrackerContact();

            Assert.IsNotNull(trackerContact, "Current contact is null");

            var facets = trackerContact.GetXConnectFacets();

            UpdateSportsFacet(data, facets);

            trackerContact.UpdateXConnectFacets(facets);
            UpdateXConnectContact(facets);
        }
        protected void UpdateSportsFacet(ISportPreferencesPayload data, Dictionary <string, Facet> facets)
        {
            SportsFacet sportsFacet;

            if (facets.ContainsKey(SportsFacet.DefaultKey))
            {
                sportsFacet         = (SportsFacet)facets[SportsFacet.DefaultKey];
                sportsFacet.Ratings = data.Ratings;
            }
            else
            {
                sportsFacet = new SportsFacet()
                {
                    Ratings = data.Ratings,
                };

                facets.Add(SportsFacet.DefaultKey, sportsFacet);
            }
        }