Exemplo n.º 1
0
        public override void SaveChanges()
        {
            foreach (var artist in Artists)
            {
                if (artist.Id == 0)
                {
                    artist.Id = Artists.Max(x => x.Id) + 1;
                }
            }

            foreach (var album in Albums)
            {
                if (album.Id == 0)
                {
                    album.Id = Albums.Max(x => x.Id) + 1;
                }
            }

            foreach (var track in Tracks)
            {
                if (track.Id == 0)
                {
                    track.Id = Tracks.Max(x => x.Id) + 1;
                }
            }
        }