예제 #1
0
        public MusicTrack RemoveMusic(int id)
        {
            MusicTrack musicTrack = Context.MusicTracks.Find(id);

            if (musicTrack != null)
            {
                Context.MusicTracks.Remove(musicTrack);
                Context.SaveChanges();
            }
            return(musicTrack);
        }
예제 #2
0
 public MusicTrack Add(MusicTrack musicTrack)
 {
     Context.MusicTracks.Add(musicTrack);
     Context.SaveChanges();
     return(musicTrack);
 }