public static void RemoveFeelings(this Dictionary <string, List <string> > dictionary, PartyGoer partyGoer, string trackUri) { if (dictionary.ContainsKey(partyGoer.GetId())) { dictionary[partyGoer.GetId()].RemoveAll(p => p.Equals(trackUri)); } }
public bool DoesUserLikeTrack(PartyGoer partyGoer, string trackUri) { if (_usersLikedTracks.ContainsKey(partyGoer.GetId())) { return(_usersLikedTracks[partyGoer.GetId()].Contains(trackUri)); } return(false); }
public static List <string> GetUsersTracks(this Dictionary <string, List <string> > dictionary, PartyGoer partyGoer) { if (dictionary.ContainsKey(partyGoer.GetId())) { return(dictionary[partyGoer.GetId()]); } else { return(new List <string>()); } }
public static void AddFeelings(this Dictionary <string, List <string> > dictionary, PartyGoer partyGoer, string trackUri) { if (dictionary.ContainsKey(partyGoer.GetId())) { dictionary[partyGoer.GetId()].TryAdd(trackUri); } else { dictionary.Add(partyGoer.GetId(), new List <string> { trackUri }); } }