Пример #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);
 }