예제 #1
0
 partial void DeleteArtist(Artist instance);
예제 #2
0
 partial void InsertArtist(Artist instance);
예제 #3
0
 partial void UpdateArtist(Artist instance);
예제 #4
0
        private void lstSongs_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            MusicFile curSong = (MusicFile)lstSongs.SelectedItem;
            bool foundArtist = false;

            foreach (Artist artist in dbArtists)
            {
                if (artist.Name == curSong.Artist)
                {
                    foundArtist = true;
                    break;
                }
            }

            if (!foundArtist)
            {
                Artist newArtist = new Artist();
                newArtist.Name = curSong.Artist;
                db.Artists.InsertOnSubmit(newArtist);
                db.SubmitChanges();
            }
        }