Ejemplo n.º 1
0
 public bool AddSongInPartyPlaylist(SongsForPartyTable playlist)
 {
     using (var db = new EntitiesChooseEm())
     {
         db.SongsForPartyTables.Add(playlist);
         db.SaveChanges();
     }
     return(true);
 }
Ejemplo n.º 2
0
 public SongsForPartyTable UpdateSongRating(SongsForPartyTable songWithUpdatedRating)
 {
     using (var context = new EntitiesChooseEm())
     {
         SongsForPartyTable song = context.SongsForPartyTables.FirstOrDefault(p => p.songURL == songWithUpdatedRating.songURL && p.partyID == songWithUpdatedRating.partyID);
         song.rating = songWithUpdatedRating.rating;
         context.SaveChanges();
     }
     return(songWithUpdatedRating);
 }
Ejemplo n.º 3
0
        public SongsForPartyTable GetSongFromPartyPlaylist(long partyID, string songURL)
        {
            SongsForPartyTable song = null;

            using (var db = new EntitiesChooseEm())
            {
                song = db.SongsForPartyTables.FirstOrDefault(p => p.partyID == partyID && p.songURL == songURL);
            }
            return(song);
        }
Ejemplo n.º 4
0
        public List <SongsForPartyTable> GetAllSongs(long partyID)
        {
            List <SongsForPartyTable> songs = new List <SongsForPartyTable>();

            using (var db = new EntitiesChooseEm())
            {
                var sfp = db.SongsForPartyTables.Where(sP => sP.partyID == partyID);
                foreach (var item in sfp)
                {
                    SongsForPartyTable sp = new SongsForPartyTable
                    {
                        partyID    = item.partyID,
                        songURL    = item.songURL,
                        rating     = item.rating,
                        RowVersion = item.RowVersion
                    };
                    songs.Add(sp);
                }
            }
            return(songs);
        }